Binding multi-byte string to stored procedure parameters
Can someone post a piece of sample code to show how to bind a multi-byte string to a stored procedure's INPUT parameter?
Thank you!
Regards, Nancy
Can someone post a piece of sample code to show how to bind a multi-byte string to a stored procedure's INPUT parameter?
Thank you!
Regards, Nancy
Similar Messages
-
How to bind arrays to PL/SQL stored procedure using OCI?
Hi,
We are having problems trying to bind arrays to PL/SQL stored procedure using OCI. Here is the situation:
- We have a stored procedure called "GetVEPFindTasks" with the following interface:
PROCEDURE GetVEPFindTasks (
p_ErrorCode OUT NUMBER,
p_ErrorMsg OUT VARCHAR2,
p_RowCount OUT NUMBER,
p_VEPFindTasks OUT t_VEPFindTaskRecordTable,
p_MaxTask IN NUMBER);
t_VEPFindTaskRecordTable is a record with the following entries:
TYPE t_VEPFindTaskRecord IS RECORD (
RTCID NUMBER,
TransNum NUMBER,
TransTimestamp VARCHAR2(20),
Pathname1 image_data.pathname%TYPE,
Pathname2 image_data.pathname%TYPE,
Pathname3 image_data.pathname%TYPE,
OperatorID operator.id%TYPE);
- Now, we are trying to call the stored procedure from C++ using OCI (in UNIX). The call that we use are: OCIBindByName and OCIBindArrayOfStruct to bind the parameters to the corresponding buffers. We bind all parameters in the interface by name. Now, we do bind the record's individual item by name (RTCID, TransNum, etc.), and not as a record. I don't know if this is going to work. Then, we use the bind handles of the binded record items (only record items such as RTCID, TransNum, and NOT error_code which is not part of the record) to bind the arrays (using OCIBindArrayOfStruct).
All of the parameters that are binded as arrays are OUTPUT parameters. The rest are either INPUT or INPUT/OUTPUT parameters. Now, when we try to execute, OCI returns with an error "Invalid number or types of arguments" (or something to that sort... the number was something like ORA-06550). Please help...
Is there any sample on how to use the OCIBindArrayOfStruct with PL/SQL stored procedures? The sample provided from Oracle is only for a straight SQL statement.
Thank's for all your help.
** Dannil Chan **As you said:
You have to pass in an array for every field and deconstruct/construct the record in the procedure. There is no support for record type or an array of records. Can you give me a example? I'am very urgently need it.
thanks
email: [email protected] -
Unused stored procedure parameters marked with a check mark in crystal reports
Post Author: epowers0213
CA Forum: General
Hello,
I have some Crystal Reports that currently use stored procedures as their datasources (I am in the process of modifying them to use datasets instead). Some of the original reports have check marks next to stored procedure parameters which I cannot find as being used anywhere in the report. Is this a legitimate possibility? (Some of them do not have check marks, however, so it is not consistent.)
More Info: I am using Crystal Reports within Visual Studio 2005. I have looked through each report in every way I can think of to find if a parameter field is being used anywhere - I have checked all formula fields, the formatting formulas for sections and individual fields, the record and group selection formulas and the grouping and sorting experts, along with any subreports (although some of them have no subreports).
(I have read on other forums that exporting a report definition file is another way to look for where fields or parameters are being used, but this does not appear possible within Visual Studio 2005.)
In some cases, I have gone ahead and replaced the stored procedure datasource location with a dataset (generated based on the same stored procedure). When I do this, Crystal automatically deletes the stored procedure parameters from the report, and I have still been able to run the modified report successfully - at least it looks ok and nothing is complaining. So is it possible that these parameters were actually not being used anywhere on the report although they were marked with a check mark?
Any help would be greatly appreciated! I want to make sure I am not changing the function of these reports somehow without knowing it...
Thank you!Are you referencing another database that Crystal can't see? Also, you can try and copy the SQL to a command object in Crystal to see if it behaves differently there.
-
Passing comma separated string to stored procedure
Hi,
There is thread with same query I created earlier and that was answered. That solution worked if I pass comma separated string containing IDs. But due to changes in the logic, I have to pass usernames instead of userIDs. I tried to modify the solution provided to use with this.
Following the link to previous post :
Re: Passing comma separated string to stored procedure
------Package-------
TYPE refcurQID IS REF CURSOR;
TYPE refcurPubs IS REF CURSOR;
procedure GetAllPersonalQueue (p_user_name in nvarchar2, TestQID OUT Test.refcurQID
, TestPubs OUT Test.refcurPubs);
------Package-------
------Package Body-------
PROCEDURE GetAllPersonalQueue (p_user_name in nvarchar2, TestQID OUT Test.refcurQID, TestPubs OUT Test.refcurPubs) as
BEGIN
Open TestQID for
select id from cfq where name in (p_user_name);
Open TestPubs for
SELECT qid FROM queues WHERE qid in(
select id from cfq where name in (p_user_name));
END GetAllPersonalQueue;
------Package Body-------
Thanks in advance
AdityaHi,
I modified the query as per the solution provided by isotope, after which the logic changed and I am passing username instead of userID in comma separated string.
Following is the changes SP, which does not throw any error, but no data is returned.
PROCEDURE GetAllPersonalQueue (p_user_name in nvarchar2, TestQID OUT Test.refcurQID, TestPubs OUT Test.refcurPubs
) is
--local variable
strFilter varchar2(100);
BEGIN
Open TestQID for
select id, name from cfq where name in
select regexp_substr(p_user_name||',','[a-z]+[0-9]+',1,level)
from dual
connect by level <= (select max(length(p_user_name)-length(replace(p_user_name,',')))+1
from dual)
Open TestPubs for
SELECT qid FROM queues WHERE qid in(
select id from cfq where name in
select regexp_substr(p_user_name||',','[a-z]+[0-9]+',1,level)
from dual
connect by level <= (select max(length(p_user_name)-length(replace(p_user_name,',')))+1
from dual)
END GetAllPersonalQueue;
Edited by: adityapawar on Feb 27, 2009 8:38 AM -
HowTo: Using special characters in SQL passthrough stored procedure parameters?
Hi all,
I am creating a Visual FoxPro 5.0a application, where I am trying to call a stored procedure in my Oracle database with the following SQLEXEC command (SQLEXEC is the Foxpro function to send sql statements to the ODBC driver):
lcSQL = "{Call Insert_FRB.NewItemPage('KABO)n$i,30000000000', '184927', '184927', 'MAIR2001011216151314', 'MAIR')}"
/* Sorry the above command should of course not break accross pages*/
lnSuccess = sqlexec(1,lcSQL)
With the parameters given, I get the ODBC error: "Connectivity error: [Oracle][ODBC Oracle Driver]Syntax Error."
I get the same error, when using the Oracle ODBC 32bit Test utility.
The call works just fine, if I replace the "$" in the first parameter 'KABO)n$i,30000000000' with a "normal" character, e.g. 'KABO)nAi,30000000000'. Oracle handles the $-character just fine, the stored procedure is working properly when called directly in SQLPLUS8.
I am using the Oracle ODBC driver sqo32_73.dll Version2.00.03.01.
Questions:
How do I have to submit the "$" to the ODBC driver, in order to be passed through to Oracle unchallenged?
Does anybody know of other special characters, which are not accepted by the ODBC-drivers for Oracle?
Thanks to any hints,
PeterYou could try downloading the Oracle 8.1.7 client and the latest
Oracle8 ODBC driver, install them on your machine, and verify
that the failure goes away. That's obviously the acid test.
I can tell you that when I worked in the ODBC driver group we
did identify and fix some bugs where our parser wasn't skipping
string literals. If this particular bug wasn't fixed earlier,
it almost certainly was then (I'm guessing that work was done 12-
18 months ago).
Justin -
ORA-03111 - JCA Binding error while invoking a stored procedure in DB
Hi,
We are facing this problem for one interface alone.
Need expert advice to fix this problem..
This is scheduled to run once in a day and fails daily for past 2 weeks..
We receive below error as response..
Same interface worked fine for past 1 yr..
Also it works fine if we reprocess the batch in next day morning...
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'DB_Legacy_To_EBS_Invoice_Conversion' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. An error occurred while preparing and executing the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. Cause: java.sql.SQLException: ORA-03111: break received on communication channel ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
AND
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'DB_Legacy_To_EBS_Invoice_Conversion' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. An error occurred while preparing and executing the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. Cause: java.sql.SQLException: ORA-01013: user requested cancel of current operation ORA-06512: at "IRSOA.XXIR_AR_SOA_CUSTOMER_INVOICE", line 213 ORA-06512: at line 1 ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution
Thanks,
SundaramLooks like the SQL might be taking a longer time to execute and might be timing out.
Please refer the following:
Re: ORA-01013: user requested cancel of current operation
http://www.dba-oracle.com/t_ora_01013_user_requested_cancel_of_current_operation.htm
Additionally, ORA-06512 indicates that there is a mismatch of the with the data length that is being processed. Refer http://www.techonthenet.com/oracle/errors/ora06512.php
Hope this helps.
Thanks,
Patrick -
Hi,
I'm new to SharePoint 2013 I want to be able to query a MSSQL database from a SharePoint App I have tried to create an External Content Type (ECT) which is produced from a MSSQL stored Procedure, this procedure has several parameters which are needed to
filter the data correctly. From here I want to produce an external list which I can then query from a c# SharePoint app. If I leave the filters in the ECT null then the list is of course empty or if enter a default values the results are limited
for the app to query so are no good.
I want to dynamically pass values to the ECT when querying from the app, is this not possible. Should I just be returning everything in an external list and then letting the query in the app filter the data, this seems inefficient?
Is this the best way to do this or should I be doing this differently?
Please can someone point me in the right direction.
ThanksHi Pandra801,
When you create a the external content type, please try to add a filter based on your select statement.
http://arsalkhatri.wordpress.com/2012/01/07/external-list-with-bcs-search-filters-finders/
Or, try to create a stored procedure based on your select statement, then create ECT using the SQL stored procedure.
A step by step guide in designing BCS entities by using a SQL stored procedure
http://blogs.msdn.com/b/sharepointdev/archive/2011/02/10/173-a-step-by-step-guide-in-designing-bcs-entities-by-using-a-sql-stored-procedure.aspx
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Passing multi-value parameter in stored procedure ssrs
I have customer parameter which is a drop down list in my report and I have set it to "allow multiple values". This is an SSRS report.
How do I pass multiple values to my stored procedure?
RJHi ,
Create a Table valued function in SQL Functions as below
Step 1
CREATE FUNCTION [dbo].[FnSplit]
@List nvarchar(2000),
@SplitOn nvarchar(5)
RETURNS @RtnValue table
Id int identity(1,1),
Value nvarchar(100)
AS
BEGIN
While (Charindex(@SplitOn,@List)>0)
Begin
Insert Into @RtnValue (value)
Select
Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1)))
Set @List = Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List))
End
Insert Into @RtnValue (Value)
Select Value = ltrim(rtrim(@List))
Return
END
Step 2 in your store procedure change the parameter where condition something like below
ALTER PROCEDURE [dbo].[SomeSP]
-- Add the parameters for the stored procedure here
@CostCentre NVARCHAR(255)
SELECT
[ProjectCode],[ProjectName],[ProjectManager],SUM([Hours]) AS [Hours MTD]FROM dbo.Rpt_NRMA_CATS NC
INNER JOIN PeriodID P ON NC.PeriodID=P.PeriodID
WHERE
([CostCentre]) collate database_default IN(SELECT Value FROM dbo.FnSplit(@CostCentre,','))
END
I hope this will help you.
Dasari -
How to change Stored Procedure Parameters to a value in a formula?
My Client is using Crystal 8.5 on MSSQL 2005. The crystal report is called from vb6 application, the client does not have access to the vb6 source code (they are upgrading vb.net), therefore I can only work in the crystal report.
The vb6 code updates 2 formula fields Start_Date and End_Date in the crystal report. I would like to pass these values as parameters to the stored procedure and suppress the "Enter Parameter Values" box.
Stored Procedure: tcs_AMP_eSuper
Parameters: @startDate, @EndDate
What I would like in crystal:
{?@startDate} = {@Start_Date}
{?@endDate} = {@End_Date}
Thanks
BarryHi Barry,
You can't run a Stored Procedure with Parameters unless you fill in the values and you can't get the values unless you prompt for them or provide then in the connection properties in code.
So in your app just fill in the parameter values when logging in. Create your own Param UI or get them from somewhere from a preselected list. As long as they are valid then CR won't prompt for them.
I don't understand why this is such a problem for you? Parameters will prompt, it's by definition. Create a UDL file, open NotePad and then rename it to *.udl. Double click the file and the OLE DB Provider log on UI will pop up. Connect to your SP with parameters and then save it. Open in edit mode and you'll see the SQL to open the SP with Values in the connection.
Something like: exec YourSP;1, startdateValue, Enddate value
So in code use that line in the log on method and the user won't get prompted. How you fill in those dates is up to you.
Don -
Problems binding array in C# to stored procedure.
I'm having trouble trying to pass an array of ID's to a stored procedure that is expecting an array (listed the procedure definition below). My current interface doesn't return an error, but it also doesn't insert the proper id's.
STORED PROCEDURE DEFINITION:
TYPE source_ids IS TABLE OF wweb.DM_ASSOCIATIONS.source_id%TYPE INDEX BY PLS_INTEGER;
PROCEDURE add_message_associations
(p_dm_message_id IN wweb.dm_messages.dm_message_id%TYPE
,p_association_type IN wweb.dm_associations.association_type%TYPE
,p_sources IN source_ids
,p_create_user IN wweb.dm_associations.create_user%TYPE)
.......variable definitions here...
v_source_id := p_sources.First;
WHILE v_source_id IS NOT NULL
LOOP
-- Check if this association already exists.
-- If not add them.
v_assoc_exists := 0;
FOR r_chk IN
(SELECT 1 AS assoc_exists_flag
FROM dm_associations a
WHERE a.dm_message_id = p_dm_message_id
AND a.association_type = p_association_type
AND a.source_id = v_source_id)
LOOP
v_assoc_exists := r_chk.assoc_exists_flag;
END LOOP;
IF v_assoc_exists = 0 THEN
-- Add the association
INSERT INTO wweb.dm_associations
(dm_association_id
,dm_message_id
,association_type
,source_id
,source_column_name
,active_flag
,create_date
,create_user
,last_update_date
,last_update_user)
VALUES
(wweb.dm_associations_s.NEXTVAL
,p_dm_message_id
,p_association_type
,v_source_id
,v_source_column_name
,1
,SYSDATE
,p_create_user
,SYSDATE
,p_create_user);
END IF;
.......error handling here...
C# CODE:
OracleParameter[] param = new OracleParameter[4];
param[0] = new OracleParameter("p_dm_message_id", OracleDbType.Long);
param[1] = new OracleParameter("p_association_type", OracleDbType.Varchar2, 5);
param[2] = new OracleParameter("p_sources", OracleDbType.Int32);
param[3] = new OracleParameter("p_create_user", OracleDbType.Varchar2, 25);
param[0].Value = 1;
param[1].Value = "ER";
param[2].Value = new Int32 [] {1, 172, 412, 7953};
param[3].Value = "SVC-GDESAI";
param[2].CollectionType = OracleCollectionType.PLSQLAssociativeArray;
param[2].Size = 4;
param[2].ArrayBindStatus = new OracleParameterStatus[4]{OracleParameterStatus.Success, OracleParameterStatus.Success, OracleParameterStatus.Success, OracleParameterStatus.Success};
cn = new OracleConnection(ConnectionString);
cn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = cn;
cmd.CommandText= "dynamic_messages_api.add_message_associations";
cmd.CommandType= CommandType.StoredProcedure;
foreach (OracleParameter p in param)
if ((p.Direction == ParameterDirection.InputOutput || p.Direction == ParameterDirection.Input) && (p.Value == null || p.Value.ToString() == ""))
p.Value = DBNull.Value;
cmd.Parameters.Add(p);
cmd.ExecuteNonQuery();
This ran fine, and created four rows in the table, but the source id's were (1, 2, 3, 4) instead of (1, 172, 412, 7953) which were the ones I passed in.
Does anyone know what I'm doing wrong here?
Thanks,
GaurangaHi,
I think you have a problem in you PL/SQL procedure. When you receive an array in the procedure, it is your responsibility to parse it explicitely with a loop or to bulk insert with a "forall" (implicit).
For instance, here is an example of a procedure of mine. I don't catch exceptions as I want the C# calling code to know about them:
The type t_* are defined like yours.
procedure UpdateDistribDates(p_bannerid in t_bannerid,
p_promonumber in t_promonumber,
p_datenumber in t_datenumber,
p_actualdate in t_actualdate ) is
BEGIN
-- First delete the existing dates in bulk
FORALL I IN P_BANNERID.FIRST..P_BANNERID.LAST
DELETE FROM PROMODISTRIBDATE
WHERE BANNERID = P_BANNERID(I)
AND PROMONUMBER = P_PROMONUMBER(I);
-- Then, insert the values passed in arrays.
FORALL I IN P_BANNERID.FIRST..P_BANNERID.LAST
INSERT INTO PROMODISTRIBDATE
(BANNERID,
PROMONUMBER,
DATENUMBER,
ACTUALDATE)
VALUES (P_BANNERID(I),
P_PROMONUMBER(I),
P_DATENUMBER(I),
P_ACTUALDATE(I));
END;
As you can see, the FORALL keyword will process the arrays passed as any other PL/SQL array in one chunk.
When you do the insert like:
INSERT INTO wweb.dm_associations
(dm_association_id
,dm_message_id
,association_type
,source_id
,source_column_name
,active_flag
,create_date
,create_user
,last_update_date
,last_update_user)
VALUES
(wweb.dm_associations_s.NEXTVAL
,p_dm_message_id
,p_association_type
,v_source_id
,v_source_column_name
,1
,SYSDATE
,p_create_user
,SYSDATE
,p_create_user);
In source_id, you insert the index of the table, not the value of the field.
I would suggest you completely rewrite this procedure by using the explicit loop like this:
1/ Explicit loop
FOR i IN 1 .. p_sources.COUNT LOOP
-- Check the existence
EXIST_FLAG := 0;
BEGIN
SELECT 1
INTO EXIST_FLAG
FROM ...
WHERE ...
AND a.source_id = p_source(i) <-- You are parsing here
AND ...
EXCEPTION
WHEN OTHERS THEN -- Nothing was found
EXIST_FLAG := 0;
END;
IF (EXIST_FLAG = 1)
INSERT INTO wweb.dm_associations
(dm_association_id
,dm_message_id
,association_type
,source_id
,source_column_name
,active_flag
,create_date
,create_user
,last_update_date
,last_update_user)
VALUES
(wweb.dm_associations_s.NEXTVAL
,p_dm_message_id
,p_association_type
,p_source(i) <-- You parse here
END IF;
END LOOP;
2/ Implicit loop and bulk insert
You would need to completely review the logic and build an array that maps exactly the row of the table you are trying to insert into. Parse the array and check for the existence of your entry, delete the row in memory when not found, then, after the loop do a bulk insert with a "forall".
Hope it helps,
Patrice -
Pass values to stored procedure parameters
I have a stored procedure in MS SQL 2005 that has a datetime parameter. I want to be able to use the stored procedure but I only want to pass a date value and assume all times for this date.
When i add the stored procedure to the report it automatically creates the parameters and I don't know how to bypass them.
Is it possible to create a date type parameter and then pass it to the stored procedure parameter?Hi Johua,
Yes, you can create a date type parameter and pass it to a stored proc that accepts a datetime parameter.
This will, however, need a container type of a report.
1) Create a new report and also create a date parameter in this report
2) Insert the original report as a subreport in, perhaps, the report header/footer section
3) Create a formula with this piece of code:
datetime({?Date},time(0,0,0));
4) Link this formula with the subreport's stored proc parameter
-Abhilash -
Getting Stored Procedure Parameters Programmatically
Hi,
Does anyone know of a way to programatically return the paramaters of a stored procedure? I am building a code generator and have found the all_procedures view to get the stored procedures name now all I need is a way to get the parameters so I can execute the SP and get the column names they return.
Thanks,
ChuckPlay around with this;;
select OBJECT_NAME, PACKAGE_NAME, ARGUMENT_NAME, POSITION, DATA_TYPE, IN_OUT, DATA_LENGTH, DATA_PRECISION, DATA_SCALE from user_arguments where UPPER(object_name) = UPPER(:object_name) and package_name is null order by position
The reference to package names is because this code will work for stand-alone procedures/functions. If the procedure/function is in a package then you would specify the package name to get the parameters. -
Stored Procedure Parameters - Setting a default value
Using SQL 2005, 2008, 2012
This should be easy, but think that I am making it hard. Below is the stored procedure that I want to call. If I want to pass a 'N' to @SearchDBsFlag how can I retain the default values for @DBName and @PreviewTextSize? I do not want to explicitly pass the
NULL, 100. I want it to pick up the default values that are defined in the stored procedure.
Create Procedure [dbo].[ifs_util_Find]
@SearchText varchar(8000)
, @DBName sysname = Null
, @PreviewTextSize int = 100
, @SearchDBsFlag char(1) = 'Y'
, @SearchJobsFlag char(1) = 'Y'
, @SearchSSISFlag char(1) = 'Y'I did look up "flag coupling" and all I found was posts from you.
Start with http://en.wikipedia.org/wiki/Coupling_(computer_programming). The terminology varies; what I call "flag coupling" is one version of Content
coupling.
Cohesion:
This is how well a module does one and only one thing; that it is logically coherent. The modules should have strong cohesion. You ought to name the module in the format "<verb><object>", where the "<object>" is a specific logical unit in
the data model. There are several types of cohesion. We rank them going from the worst form of cohesion to the best
1) Coincidental
2) Logical
3) Temporal
4) Procedural
5) Communicational
6) Informational
7) Functional
Coupling:
If modules have to be used in a certain order, then they are strongly coupled. If they can be executed independently of each other and put together like Lego blocks, then they are loosely or weakly coupled. There are several kinds of coupling, which are ranked
from worse to best:
1) Content
2) Common
3) Control
4) Stamp
5) Data
This is covered briefly in a chapter on writing stored procedures in my book on SQL PROGRAMMING STYLE. In the meantime, you can read DeMarco, Yourdon, Constantine, Myers or several other of the pioneers.
This is FAR more basic than SQL programming. This is what you are supposed to know before you write any code in any language.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
I need to get the parameter list of certain stored procedures in
a schema. One option I tried was to go thru "user_source" which
seemed to work okay.
Is there any other way to get just the parameter list, without
any of the source code?
TIA,
AtulAfter some research, found out that the parameter list can be
obtained by using an Oracle View called "all_arguments". This
returns a row for each argument of a procedure/function.
HTH,
Atul -
Passing SQL string to Stored Procedure
I have the following package:
CREATE OR REPLACE PACKAGE PKG_QUERY
AS
TYPE CURSOR_TYPE IS REF CURSOR;
PROCEDURE SP_QUERY(QUERY IN OUT CURSOR_TYPE);
END;
CREATE OR REPLACE PACKAGE BODY PKG_QUERY
AS
PROCEDURE SP_QUERY(QUERY IN OUT CURSOR_TYPE, IN_SQL IN VARCHAR2)
AS
BEGIN
OPEN QUERY FOR IN_SQL;
END;
END;
Here is what I would like to do. I would like to pass an SQL string that I build in my middle tier and pass it to the SP_QUERY procedure as IN_SQL. I can't seem to get this to compile. If I explicitly type in a select statement (ex. OPEN QUERY FOR SELECT * FROM table), it works fine. Can I pass in an SQL statement as a string and execute the query? Any help that anyone can offer would be GREATLY appreciated!!!!
Thanks for any help you can offer,
MichaelString bigString = getBigString(); // wherever it comes from
ByteArrayInputStream bais =
new ByteArrayInputStream(bigString.getBytes());
PreparedStatement ps = conn.prepareStatement("INSERT INTO SOMETABLE VALUES(?)");
//above is just an example, use your insert statement
ps.setAsciiStream(1,bais,bigString.length());Of course, that is assuming you have some type of CLOB in your database.
Maybe you are looking for
-
If my wife and I share an iTunes account, will we be able to keep independent app data?
For example, if we both install a To Do List app, will we both be able to keep our own lists? Is the data tied to the app backed up in our independent iCloud accounts and/or iTunes backups on our separate Macs?
-
[SOLVED] systemd user unit for lsyncd
After following the the systemd/User - Basic setup wiki article I have successfully setup user services for systemd. I've also setup a systemd user "unit" to run lsyncd. The user unit appears to start successfully based on the unit status shown bel
-
Streaming radio when I lose my wifi connection
I want to stream radio with wifi, but I am concerned I will rack-up big charges on my data plan if my internet connection dies. Is there a way I can force streaming to halt if I lose my wifi connection.? I discovered my iPhone will switch automatic
-
Here's the problem: I've already loaded Safari with bookmarks, so I've been using my browser history as a substitute to keep track of sites. Now, the history is gone. Specifically, the "History.plist" file in ~/Library/Safari is corrupted and crashes
-
Pl/sql anonymous block and procedure ??
Hi I want to ask a question about my sql query and procedure. I wrote a like this.. it's şanguage is my native language but my question is not related language. I wrote this query like procedure. So procedure's code same this. But this query retrieve