Question?? - passing 2D array as a parameter of a stored procedure
Hi,
I have been having a lot of trouble with executing a stored procedure. I'm hoping someone can help me with this:
THe stored proc. has 10 parameters, 5 IN and 5 OUT. One of these parameters coming out is a 2D array, however I"m not sure how I would be able to call the correct OCCI type coming out.
I've declared a 2D array char sample[10][10];
and then:
stmt - > registerOutParam ( 7, oracle::occi:OCCI*???, sizeof(sample);
and then :
char outarray[10][10];
out_array = stmt -> getString??? get*??
I tried just passing a string itself, but as the procedure is looking for a 2D array, the program aborts, but I'm really not sure how I can solve this...??
I'm kind of new to this subject, and I would really appreciate any help anyone can provide, with being able to pass in a 2D char array and being able to receive the outcomning data.
Thanks a lot for any help!
Hi,
thank you for the link, it helped a lot....
my C++ app that calls my stored procedure does compile, however, when I execute it "Aborts". I debugged it and found that right before my
stmt->executeUpdate()
statement, it outputs "Aborts", I'm really not sure why this is aborting, are there any specific debug statements or anything I can use specific to occi so that I can trace why my program aborts right before the executeUpdate statement (also I have checked my procedure and it is compiled and valid, and all my parameter types are correct).
Does anyone have any ideas??
Any help on this matter is really appreciated... thank you
Similar Messages
-
Pass a datarow as input parameter in a stored procedure
Hi everyone!
I wonder if anyone know how to pass a datarow (better if tipized like "tablenameRow") as input parameter for a stored procedure.
links or suggestions are welcome! (i'm newbie in .net programming, so if you can post some code i'll be really grateful!)
Thank you!Hi,
YES!! its possible you can pass a datarow to a SP from your Dot net application.
Here below i'm going to give you an example for Desktop Application.
For Passing a datarow as Input Parameters, your SP need to support for all these parameters.
I mean, if a data row has 03 Columns. Then your procedure should be able to take 03 arguments/parameters.
--Adjust code according to your need.
--Its for C# Desktop application.
--Visual Studio Professional, Framework (2.0)
//Setting connections.
OracleConnection con=new OracleConnection("Data Source=orcl9i; user id=scott; password=tiger");
OracleComand cmd=new OracleCommand(con);
cmd.Type=CommandType.StoredProcedure; //you are useing SP
cmd.Text="my_stored_procedure"; //Mention SP name.
--if DataRow has Three columns. You need three parameters.
OracleParameter p1=new OracleParameter ();//By default parameters are input parameters.
OracleParameter p2=new OracleParameter ();
OracleParameter p3=new OracleParameter ();
//We assume that Datarow already has data in it.
p1.ParametersName="sp_var1 ";
p1.OracleDbType=OracleDbType.Varchar;
p1.Value=tablenameRow[1]; //Here DataRow object's Column1 is input.
p2.ParametersName="sp_var2 ";
p2.OracleDbType=OracleDbType.Varchar;
p2.Value=tablenameRow[2]; //Here DataRow object's Column2 is input.
p3.ParametersName="sp_var3 ";
p3.OracleDbType=OracleDbType.Varchar;
p3.Value=tablenameRow[3]; //Here DataRow object's Column3 is input.
cmd.OracleParameter.Add(p1); //Add parameters.
cmd.OracleParameter.Add(p2); //Add parameters.
cmd.OracleParameter.Add(p3); //Add parameters.
cmd.ExecuteNonQuery(); //Execute Procedure here.
Feel free to ask if still found problem.
.... -
Is it possible to pass a null Input Oracle parameter to a stored procedure
I have a stored procedure that take 3 inputs and gives 1 output.I'm using Oracle parameter to add all 3 input parameters as follows :
OracleParameter inobj = cmd.Parameters.Add("wid", OracleDbType.Int32,50);
inobj.Direction = ParameterDirection.Input;
inobj.Value = _employeeID;
and added the output parameter as follows:
OracleParameter outobj = _cmd.Parameters.Add("w_first", OracleDbType.Varchar2, 50);
outobj.Direction = ParameterDirection.Output;
On the UI end , the user has a choice to provide 1 input or all inputs or any 2 inputs based on his interest. Stored Proc looks as follows:
SP( inp1 in parameter, inp2 in parameter, inp3 in parameter, output1 out parameter)
If i just get 1 input or 2 inputs from the user, is it fine to query the data for output using same stored procedure or should i have individual stored procedures for each scenario(combination of different inputs)?
Will i get any pl/sql error that says invalid number of arguements?This means if i have 1 input , i need to have a different method to pass 1 parameter value and other input parameters as null and if there are 2 inputs will need different method to handle. So 5 different methods all together?
What if the stored procedure is as follows ,will its make things easier so that only one method is used for all scenarios?(optional parameters is set default value as null in the stored proc)
Create or Replace
Procedure GetFoo
(cur_z OUT sys_refcursor,
pub_date IN varchar2,
fname IN varchar2 default null,
lname IN varchar2 default null,
phone IN varchar2 default null
IS
BEGIN
---get some data
END;
*actually i can test this but, all the database servers are down today. So, i need to have idea if this thing works before i confirm with someone. Thanks. -
Passing an array of structures to an Oracle stored procedure (CFMX)
I'm looking to write a Oracle stored procedure where I would pass in an array of structures and loop over each iteration to insert the bits and pieces within the structures to the DB.,
I haven't written this type of procedure / package before. I am planning to do an sp / package similar to what is sketched out in the second reply to this thread: http://forums.oracle.com/forums/thread.jspa?threadID=1078772
Assuming I do, how can I call the procedure from ColdFusion (I'm using MX) and pass in my array? As far as I can see, none of the CF_SQL_Types make sense.Let me know if you make any progress. I'm fighting the same battle. What I've done so far is to convert my array of struct into a delimited CLOB that looks like this:
prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|
Then I wrote a stored proc to suck it up using a pipelined function. It's not to bad but parsing the CLOB on the ORACLE side is somewhat time consuming.
I've also converted the array to XML and used dbms_xmlstore to convert but, on large arrays, it is very slow and the CLOB gets huge fast.
I was hoping to use the cf_sql_refcursor but I can't figure out how.
Warren -
Can I pass an array as an input parameter for a stored procedure on SQL Server 2000
I am trying to pass an array to a stored procedure residing on my SQL Server 2000 database server. Is this even possible? If it is possible, what is the syntax for this?
Any help would be greatly appreciated.
ThanksI have passed arrays to and from a database using SQL and ActiveX, including to and from stored procedures, but I cannot recall the precise method used to do so. If memory serves, everything is in the form of a string. You need to do a lot of parsing and 'unparsing' to get this data into your stored procedure.
You are left with a couple of options to get your data to the stored procedure. I recommend using SQL in LabVIEW wherever possible as it saves the amount of external code calls (and believe me, calling ActiveX procedures developed by someone else in Visual Basic is NOT much fun at all...). You can either send the array and other data to the stored procedure (you will find the syntax in the SQL references in LabVIEW help under SQL), or you can send
the array to the database, and have the database then act upon the array.
I strongly recommend making routines (subVIs) to handle these operations.
Sorry I don't have the syntax, I don't have SQL installed on this machine. If you can't find the syntax in the help, please post here again.
-Mike Du'Lyea -
Passing Multi-Value Parameter to a Stored Procedure
Has anyone experienced passing a Parameter (MultiValue) to a Stored Procedure? I am aware that Crystal Passes the Param as an Array. How would you go about handling this within a Stored Procedure???
Hi Daniel
Try as below:
1. Create a Crystal report, and add a multi-value parameter.
2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
//Formula: @JoinFormula
Join ({?Multi-value parameter array},";")
====================
NOTE:
In the formula above, a semi-colon (";") is the delimiter.
====================
3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
Doing so passes a multi-value parameter to the stored procedure.
Hope this helps!!!!
Regards
Sourashree -
How to pass the parameter of a stored procedure to iReport
Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
In the Report Query, i tried
1. sp_storedprocedure ' value'
2. sp_storedprocedure +''''+$P{parameter}+''''+
3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank youFor M$ SQL server I find that it only works when U use the fully qualified name...
e.g. catalod.dbo.my_procedure_name 'variable'
My full query in the Report Query window is something like this:
EXEC arc.dbo.jasper_Invoice 1000
Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
CREATE PROC jasper_MyProc (@my_rec_id integer) AS
SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
...to wrap your SELECT statement, then call the PROC
Edited by: Sylinsr on Apr 22, 2008 4:23 PM -
Would like to pass multi-value parameter to a stored procedure
Hi,
Is it possible to pass a multi-value parameter to a stored procedure using crystal reports.
Is there is a way to do so??/
Thanks,
Brian.Hi,
Is it that you want to pass 2 or more parameters to a stored proc. it is possible
go to database expert
select your connection and click on add command their you will have to create parameters and pass to a proc
for ref..
{CALL `menagerie`.`sp_timer`({?delay time},{?delay time2})}
where `menagerie`.`sp_timer` is a stored proc.
and delay time and delay time2 are parameters.
but if it is like you have to pass multiple values to stored proc using single parameter as per my experience its
not possible. -
How to pass parameter from 1 stored procedure to another stored procedure inside crystal report
Hi
I have several stored procedure in my Crystal Report. I am wondering if it is possible for me to pass a parameter to one of the stored procedure and to use the result of that stored procedure E.g. CustomerCode. To another 2 stored procedure to generate the report dynamically?
I have 3 stored procedure
The 1st one is used to gather information and process the calculation
another 2 stored procedure is used for generate the graph and both of them required to take 2 parameters. The 1st stored procedure will require 1 parameter (E.G. Reference Code) and will return a set of information including the data that could be use on the other 2 stored procedures.
After I added these 2 stored procedure, it requires me to pass 3 parameters to the report. I would like to know if I could only pass the Reference Code for stored procedure 1 and use it to retrieve the information for the other 2 parameter?
Thanks in advance
ChiHi Chi
To pass parameter from 1 stored procedure to another stored procedure, you will have to create sub report. In your case you will have to create 2 sub reports for 2nd and 3rd stored procedure and link those sub reports with the main report using Reference Code field in order to pass the values.
After creating the report when you will refresh the report, it will ask 4 parameters, one parameter for main report, one for the first subreport and two for second subreport to fetch the data correctly.
Regards
Poonam Thorat. -
How to pass a table as parameter on a stored procedure
Hello all,
I want to pass the name of a table as parameter into a stored procedure, that will be used for cursors etc.
But when i pass the parameter and i compile the S.P. it give me error (error: table not existing...)
Any Help?
Thanks in advance, MarcoMarco wrote:
As i've written above, i'm using stored procedures like 'batch' programs which will be executed with oracle scheduler (passing to s.p. the name of the 'input' tables)
These input tables are 'external' tables which have got the same structure; for example i've got TABLEX_001, TABLEX_002, XXTAB etc. with the same structure.
This is the the reason... what do you think?An external table definition can reference multiple files via the LOCATION definition or you can user "ALTER TABLE" to alter the location and change the file that the external table points to.
Thus you only need one static External Table and use an alter table (via execute immediate) to change the file location it points to, or if you want all the data together, just specify all the files in the location.
That would be clean design, using one fixed table, without the need to pass any table names, just dynamically altering the file names if necessary at run time. -
Set Null as Default for input parameter to a stored procedure
hi ,
How can we set default values as NULL to an input parameter in a stored Procedure.
create or replace procedure emp_proc ( p_test_input in varchar2
p_emp_id in number,
p_emp_name in varchar2,
p_manager_id in number )
as
begin
if ( upper ( p_test_input ) = 'I' )
then
insert into emp
values ( p_emp_id ,p_emp_name ,p_Manager_id,sysdate );
elsif ( upper ( p_test_input ) = 'D' )
then
delete from emp
where emp_id = p_emp_id;
else
dbms_output.put_line
( 'Please input ''A'' for ADD or ''D'' Delete EMPLOYEE'
end if;
end;As Shown above if i want to do only delete operation
i want to call this procedure like without passing extra parameters .
EXECUTE emp_proc('D',1010);Edited by: Rede on May 28, 2010 12:21 PM
Edited by: Rede on May 28, 2010 12:22 PMcreate or replace procedure emp_proc ( p_test_input in varchar2,
p_emp_id in number,
p_emp_name in varchar2 default null,
p_manager_id in number default null ) -
Array data sporadically lost when calling stored procedure
We have weird problem with stored procedures for which I have not been able to find an explanation so far.
Our app has a bunch of stored procedures which process arrays of integers or strings.
From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ?We have weird problem with stored procedures for which I have not been able to find an explanation so far.
Our app has a bunch of stored procedures which process arrays of integers or strings.
From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ? -
Problem in OUT Parameter in the stored procedure
Hi,
I have a problem in the OUT parameter of the stored procedure under the package. I encountered the error PLS-00306. Below are the codes.
Package
CREATE OR REPLACE package body test as
procedure sp_countries(rst OUT country_typ) as
sql_stmt VARCHAR2(300);
begin
sql_stmt := 'SELECT * FROM countries WHERE region_id = 1';
OPEN rst FOR sql_stmt;
end;
end test;
by the way. i declared the country_typ as this:
TYPE country_typ IS REF CURSOR;
Here is the code that will call this package:
declare
tst countries%ROWTYPE;
begin
test.sp_countries(tst);
dbms_output.put_line(tst.country_name);
end;Works for me. Although I had to use emp instead of your table:
SQL> create or replace
2 package test as
3 TYPE country_typ IS REF CURSOR;
4 procedure sp_countries(rst OUT country_typ);
5 end;
6 /
Package created.
SQL> CREATE OR REPLACE
2 package body test as
3 procedure sp_countries(rst OUT country_typ) as
4 sql_stmt VARCHAR2(300);
5 begin
6 sql_stmt := 'SELECT * FROM emp WHERE deptno = 20';
7 OPEN rst FOR sql_stmt;
8 end;
9 end test;
10 /
Package body created.
SQL> var tcur refcursor
SQL> exec test.sp_countries(:tcur);
PL/SQL procedure successfully completed.
SQL> print tcur
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7566 JONES MANAGER 7839 02-APR-81 2975 20
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
SQL> -
Trouble while passing an array as a parameter to an JDBC Control
Hi everyone, recently I have upgraded my WLS Workshop 8.1 application to WLS 10gR3 using the workshop 8.1 application upgrade but after the upgrade to beehive controls I'm having troubles in a couple of methods that receive an array as a parameter. One of the methods is the following:
* @jc:sql array-max-length="all" max-rows="all"
* statement::
* select COUNT(*) FROM (
* SELECT la.lea_gkey,la.eme_gkey
* FROM (SELECT gkey, name, role FROM employees WHERE {sql:fn in(gkey,{emeGkeyArray})}) e,
* lead_assignees la,
* leads le,
* cities ct,
* (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100
* WHERE e.gkey = la.eme_gkey
* AND la.lea_gkey = le.gkey
* AND le.city = ct.gkey(+)
* AND le.gkey = cn.lea_gkey(+)
* AND le.gkey = targets.lea_gkey(+)
* AND le.gkey = top5.lea_gkey(+)
* AND le.gkey = top100.lea_gkey(+)
* {sql: whereClause}
* UNION
* SELECT DISTINCT la.lea_gkey,la.eme_gkey
* FROM (SELECT gkey, name, role FROM employees WHERE {sql:fn in(gkey,{emeGkeyArray})}) e,
* lead_assignees la,
* shared_accounts sa,
* leads le,
* cities ct,
* employees asign,
* (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100
* WHERE e.gkey = sa.eme_gkey
* AND asign.gkey = la.eme_gkey
* AND asign.active='X'
* AND sa.lea_gkey = le.gkey
* AND sa.lea_gkey = la.lea_gkey
* AND le.city = ct.gkey(+)
* AND le.gkey = cn.lea_gkey(+)
* AND le.gkey = targets.lea_gkey(+)
* AND le.gkey = top5.lea_gkey(+)
* AND le.gkey = top100.lea_gkey(+)
* {sql: assigneeClause}
* UNION
* SELECT DISTINCT la.lea_gkey,la.eme_gkey
* FROM (SELECT gkey, name, role FROM employees WHERE {sql:fn in(gkey,{emeGkeyArray})}) e,
* lead_assignees la,
* shared_accounts sa,
* leads le,
* cities ct,
* (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5,
* (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100
* WHERE e.gkey = la.eme_gkey
* AND sa.lea_gkey = le.gkey
* AND sa.lea_gkey = la.lea_gkey
* AND le.city = ct.gkey(+)
* AND le.gkey = cn.lea_gkey(+)
* AND le.gkey = targets.lea_gkey(+)
* AND le.gkey = top5.lea_gkey(+)
* AND le.gkey = top100.lea_gkey(+)
* {sql: sharedClause})::
@JdbcControl.SQL(arrayMaxLength = 0,
maxRows = JdbcControl.MAXROWS_ALL,
statement = "select COUNT(*) FROM ( SELECT la.lea_gkey,la.eme_gkey FROM (SELECT gkey, name, role FROM employees WHERE {sql:fn in(gkey,{emeGkeyArray})}) e, lead_assignees la, leads le, cities ct, (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100 WHERE e.gkey = la.eme_gkey AND la.lea_gkey = le.gkey AND le.city = ct.gkey(+) AND le.gkey = cn.lea_gkey(+) AND le.gkey = targets.lea_gkey(+) AND le.gkey = top5.lea_gkey(+) AND le.gkey = top100.lea_gkey(+) {sql: whereClause} UNION SELECT DISTINCT la.lea_gkey,la.eme_gkey FROM (SELECT gkey, name, role FROM employees WHERE {sql:fn in(gkey,{emeGkeyArray})}) e, lead_assignees la, shared_accounts sa, leads le, cities ct, employees asign, (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100 WHERE e.gkey = sa.eme_gkey AND asign.gkey = la.eme_gkey AND asign.active='X' AND sa.lea_gkey = le.gkey AND sa.lea_gkey = la.lea_gkey AND le.city = ct.gkey(+) AND le.gkey = cn.lea_gkey(+) AND le.gkey = targets.lea_gkey(+) AND le.gkey = top5.lea_gkey(+) AND le.gkey = top100.lea_gkey(+) {sql: assigneeClause} UNION SELECT DISTINCT la.lea_gkey,la.eme_gkey FROM (SELECT gkey, name, role FROM employees WHERE {sql:fn in(gkey,{emeGkeyArray})}) e, lead_assignees la, shared_accounts sa, leads le, cities ct, (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100 WHERE e.gkey = la.eme_gkey AND sa.lea_gkey = le.gkey AND sa.lea_gkey = la.lea_gkey AND le.city = ct.gkey(+) AND le.gkey = cn.lea_gkey(+) AND le.gkey = targets.lea_gkey(+) AND le.gkey = top5.lea_gkey(+) AND le.gkey = top100.lea_gkey(+) {sql: sharedClause})")
public Long getProspectsCount(String[] emeGkeyArray, String whereClause, String assigneeClause, String sharedClause) throws SQLException;
The execution of the method is the following:
pendingApprovals = leadsListingDB.getProspectsCount(employeeHierarchyArray, pendingApprovalsClause, pendingApprovalsClause, pendingApprovalsClause);
When the method is executed all the String parameters (whereClause, assigneeClause & sharedClause) are replaced well except the array parameter (emeGkeyArray) so the execution throws the following exception because the array is not replaced:
<Jan 20, 2010 1:01:26 PM CST> <Debug> <org.apache.beehive.controls.system.jdbc.JdbcControlImpl> <BEA-000000> <Enter: onAquire()>
<Jan 20, 2010 1:01:26 PM CST> <Debug> <org.apache.beehive.controls.system.jdbc.JdbcControlImpl> <BEA-000000> <Enter: invoke()>
<Jan 20, 2010 1:01:26 PM CST> <Info> <org.apache.beehive.controls.system.jdbc.JdbcControlImpl> <BEA-000000> <PreparedStatement: select COUNT(*) FROM ( SELECT la.lea_gkey,la.eme_gkey FROM (SELECT gkey, n
me, role FROM employees WHERE (gkey IN ())) e, lead_assignees la, leads le, cities ct, (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn, (SELECT lea_gkey, tag FROM lead
tags WHERE tag = 'TARGET') targets, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100 WHERE e.gkey = la.eme_gkey AND la.l
a_gkey = le.gkey AND le.city = ct.gkey(+) AND le.gkey = cn.lea_gkey(+) AND le.gkey = targets.lea_gkey(+) AND le.gkey = top5.lea_gkey(+) AND le.gkey = top100.lea_gkey(+) AND LA.ACTIVE = 'X' AND LE.WE
KLY_POTENTIAL > 0 AND (LE.APPROVED IS NULL OR LE.APPROVED != 'Y') AND LA.SALE_STAGE IN(3034,3005) UNION SELECT DISTINCT la.lea_gkey,la.eme_gkey FROM (SELECT gkey, name, role FROM employees WHERE (gkey I
())) e, lead_assignees la, shared_accounts sa, leads le, cities ct, employees asign, (select lea_gkey,name,email,phone,title from contacts where principal = 'X') cn, (SELECT lea_gkey, tag FROM lea
tags WHERE tag = 'TARGET') targets, (SELECT leagkey, tag FROM lead_tags WHERE tag = 'TOP5') top5, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP100') top100 WHERE e.gkey = sa.eme_gkey AND asi
n.gkey = la.eme_gkey AND asign.active='X' AND sa.lea_gkey = le.gkey AND sa.lea_gkey = la.lea_gkey AND le.city = ct.gkey(+) AND le.gkey = cn.lea_gkey(+) AND le.gkey = targets.lea_gkey(+) AND le.gkey
= top5.lea_gkey(+) AND le.gkey = top100.lea_gkey(+) AND LA.ACTIVE = 'X' AND LE.WEEKLY_POTENTIAL > 0 AND (LE.APPROVED IS NULL OR LE.APPROVED != 'Y') AND LA.SALE_STAGE IN(3034,3005) UNION SELECT DISTINCT
la.lea_gkey,la.eme_gkey FROM (SELECT gkey, name, role FROM employees WHERE (gkey IN ())) e, lead_assignees la, shared_accounts sa, leads le, cities ct, (select lea_gkey,name,email,phone,title from c
ntacts where principal = 'X') cn, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TARGET') targets, (SELECT lea_gkey, tag FROM lead_tags WHERE tag = 'TOP5') top5, (SELECT lea_gkey, tag FROM lead_tags
WHERE tag = 'TOP100') top100 WHERE e.gkey = la.eme_gkey AND sa.lea_gkey = le.gkey AND sa.lea_gkey = la.lea_gkey AND le.city = ct.gkey(+) AND le.gkey = cn.lea_gkey(+) AND le.gkey = targets.lea_gkey(+
AND le.gkey = top5.lea_gkey(+) AND le.gkey = top100.lea_gkey(+) AND LA.ACTIVE = 'X' AND LE.WEEKLY_POTENTIAL > 0 AND (LE.APPROVED IS NULL OR LE.APPROVED != 'Y') AND LA.SALE_STAGE IN(3034,3005)) Params:
{}>
<Jan 20, 2010 1:01:26 PM CST> <Debug> <org.apache.beehive.netui.pageflow.FlowController> <BEA-000000> <Invoking exception handler method handleException(java.lang.Exception, ...)>
[LeadsMailer] Unhandled exception caught in Global.app:
java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
So the big question is if that behavior is due to a bug of I'm doing something wrong. Do someone can give me an advice about this problem because the array parameter has no problems in workshop 8.1?
Thanks in advance!Greetings
I may not have an answer for you, but i am in the same boat! I am trying to pass an array to store in the database. I have 2 out of 8 columns that need to be stored as arrays. Everything saves EXEPT for the 2 arrays in question. I am using BEEHIVE with my web app. The strange thing is that i do not receive any syntax errors or runtime codes. I am still searching for an answer. If i find anything out, i will let you know.
John Miller
[email protected] -
Passing an array as IN parameter to call a function
I have a function the definition is
TYPE VAR_VALUE_RECORD IS RECORD(VAR VARCHAR2(100),
VALUE VARCHAR2(100));
TYPE VAR_VALUE_TAB IS TABLE OF VAR_VALUE_RECORD;
FUNCTION GENERIC_WF(P_MSG_TYPE IN VARCHAR2,P_CDCS_NBR IN VARCHAR2, P_CDCS_SEQ IN VARCHAR2, P_DEBTORID IN NUMBER,
P_EXTRAS IN VAR_VALUE_TAB) RETURN VARCHAR2;
I am trying to call this function
select WF_NOTIFICATIONS_PKG.GENERIC_WF('Manual Debt Establish Notification','2009A13636','001',105195359,'this is a test') from dual
ERROR at line 1:
ORA-06553: PLS-306: wrong number or types of arguments in call to 'GENERIC_WF'
I am getting the above error, how do I pass the array as parameter.
I will appreciate your help.
ThnaksHi,
try this,
Create OR Replace Package WF_NOTIFICATIONS_PKG Is
Type VAR_VALUE_RECORD Is Record( VAR Varchar2(100)
, Value Varchar2(100));
Type VAR_VALUE_TAB Is Table Of VAR_VALUE_RECORD Index BY Pls_Integer;
Function GENERIC_WF( P_MSG_TYPE IN Varchar2
, P_CDCS_NBR IN Varchar2
, P_CDCS_SEQ IN Varchar2
, P_DEBTORID IN Number
, P_EXTRAS IN VAR_VALUE_TAB ) Return Varchar2;
End WF_NOTIFICATIONS_PKG;
Create OR Replace Package Body WF_NOTIFICATIONS_PKG Is
Function GENERIC_WF( P_MSG_TYPE IN Varchar2
, P_CDCS_NBR IN Varchar2
, P_CDCS_SEQ IN Varchar2
, P_DEBTORID IN Number
, P_EXTRAS IN VAR_VALUE_TAB ) Return Varchar2 Is
Begin
Return ( P_EXTRAS(P_EXTRAS.First).var || ' - ' || P_EXTRAS(P_EXTRAS.First).Value );
End GENERIC_WF;
End WF_NOTIFICATIONS_PKG;
SQL> Declare
2 v_value_Tab WF_NOTIFICATIONS_PKG.VAR_VALUE_TAB;
3 v_return Varchar2(100);
4 Begin
5 v_value_Tab(1).var := 'this is a test 1';
6 v_value_Tab(1).value := 'this is a test 2';
7
8 v_return := WF_NOTIFICATIONS_PKG.GENERIC_WF( 'Manual Debt Establish Notification'
9 , '2009A13636'
10 , '001'
11 , 105195359
12 , v_value_Tab );
13
14 Dbms_Output.put_line(v_return);
15 End;
16 /
this is a test 1 - this is a test 2
PL/SQL procedure successfully completedRegards,
Christian Balz
Maybe you are looking for
-
How can I transfer contact from first icloud user to second icloud user ?
i have first i cloud user and i add all contact in my iphone in to it. but in present, i want to change my icloud user in to the other, so i want to transfer all contact to my new icloud user. How can i do? thk
-
Regardless of where I right-click on a displayed webpage (NOT the menu bar at the top of the screen), be it highlighted text, a blank spot in a webpage, or anything, the context menu for a hyperlink pops up (with the options for opening it in a new t
-
Hi, I wrote a simple program to help me learn about using locales and currency in java. The program worked file for the default locale, but gives an exception when I pass it a US locale. I expect this is something very simple that I've done wrong but
-
Process types(Variants) missing
hi friends, I have created a process chain with 5 process types(All are loading data ). I loaded data whenever necessary. when I monitoring the process chain which was run last, I did not see last two process types(variants) in my log view.this is mo
-
Help Having a problem with my directed graph, and its been frying my head. from the test that I've ran ita ppears to be working sort of the problem that I'm having is once I've created a node, I then attach an edge to that node, however where there a