Execute stored procedure from TestStand
I am having difficulty executing a stored procedure from the TestStand Database step types. I am using the "Data Operation" step type to set the input parameter, but I still get the following error;
Procedure or function 'sproc_prior step' expects parameter '@serial_number', which was not supplied.
I've attached the sequence file for review.
Any help would be appreciated.
Attachments:
db Stored Procedure1.seq 9 KB
We were able to fix this sequence by making the following changes:
1.) In the Open SQL Statement change the Command Type to Stored Procedure instead of Default.
2.) On the Get Results step change the Operation to Get - Retrieve Values from Record instead of Close since the Close SQL Statement takes care of that for you.
3.) Also change the Record To Operate On to Current - Use Current Record.
After making these changes the sequence should work. Also note, that it would be preferable to change the stored procedure name to us all underscores and not spaces since this is more standard for use with databases.
John B.
Applications Engineer
National Instruments
Similar Messages
-
Execute Stored Procedures from Stellent
Can we execute stored procedures from stellent 7.5.2 ?
By using java, I dont find any method to execute stored procedure from WorkSpace interface.
Please guide me to solve this..
Appreciate your help and efforts.May not be exactly what you're looking for, but I hope this helps:
http://www.corecontentonly.com/Blog/Calling-A-Stored-Procedure-From-Oracle-Fusion-ECM-Stellent
For java based execution basically:
1. Create your stored proc in the db
2. Create a component
3. Create a query resource
4. In your java code use the createResultSet method of the Workspace object and pass in the name of your query resource and then the current databinder object -
Facing error while trying to execute stored procedure from JSF Application
Hi, I am facing the below error when I try to execute a stored Procedure from JSF application which is deployed on WAS 7.0
=2013-03-04 19:06:58,550 INFO [com.lloydstsb.iw.util.DBUtils] - DBUtils : executeFileNetStoredProc method started..
=2013-03-04 19:11:58,271 ERROR [com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl] - Data Access Exception
com.lloydstsb.iw.common.exceptions.DataAccessException: Data Access Exception Occured : Integration Stored Proc- java.sql.SQLException: java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
at com.lloydstsb.iw.util.DBUtils.executeFileNetStoredProc(DBUtils.java:959)
at com.lloydstsb.iw.util.DAOUtil.executeFileNetStoredProc(DAOUtil.java:117)
at com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl.updateFileNetDetailsCustomDB(FileNetCustomDBSynchDAOImpl.java:36)
at com.lloydstsb.iw.servlet.IndexServlet.service(IndexServlet.java:127)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
The oracle version we are using is 11g.
Previously it worked fine when the application was used in 10g.
Can someone please help me in resolving this issue?
Kiran
Edited by: 991640 on Mar 4, 2013 8:25 PMjava.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
Are the the JDBC JARs packaged with the application? If so, remove the applicaiton packaged JDBC JARs as the JARs are also in WebSphere application server. -
Problem in executing Stored Procedure from Trigger
Hi,
Case1.
I am executing a stored procedure form a trigger. The stored procedure is not executing fully.
Case 2.
But when when I execute Stored Procedure alone it is executing.
CREATE OR REPLACE TRIGGER mhubadmin.call_proc_ratesheet_new
after INSERT OR delete ON mhubadmin.pvt_br_ratesheet
FOR EACH ROW
declare
var_orgid number;
begin
if inserting then
select org_child_id into var_orgid from business_relationship where br_id=:new.br_id;
mhubadmin.proc_ratesheet_new(var_orgid);
else
select org_child_id into var_orgid from business_relationship where br_id=:old.br_id;
mhubadmin.proc_ratesheet_new(var_orgid);
end if;
end;
CREATE OR REPLACE PROCEDURE proc_ratesheet_new(var_orgid in number)
IS
cursor c3 is select distinct(purs.user_id) from hubuser hu
inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
where hu.ORG_ID=var_orgid;
cursor c1(varUser_id number) is select purs.user_id,purs.ratesheet_id from hubuser hu
inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
where hu.ORG_ID=var_orgid and purs.USER_ID=varUser_id;
cursor c2(varUser_id number) is select hu.user_id,pbr.ratesheet_id from HUBUSER hu
inner join BUSINESS_RELATIONSHIP br on hu.ORG_ID=br.ORG_CHILD_ID
inner join PVT_BR_RATESHEET pbr on br.BR_ID=pbr.BR_ID
where hu.user_id in(select distinct(purs.USER_ID) from hubuser hu
inner join PVT_USER_RATESHEET purs
on hu.USER_ID=purs.USER_ID
where hu.ORG_ID=var_orgid) and hu.user_id=varUser_id;
foundFlag boolean;
incrFound integer;
insertFound integer;
deleteFound integer;
str varchar2(4000);
BEGIN
incrFound:=0;
insertFound:=0;
for c3var in c3 loop
for c2var in c2(c3var.user_id) loop
insert into test values ('Step3:'||c2var.user_id);
foundFlag:=false;
for c1var in c1(c3var.user_id) loop
if c2var.ratesheet_id=c1var.ratesheet_id then
foundFlag:=true;
incrFound:=incrFound+1;
exit;
end if;
end loop;
if foundFlag=False then
--insert into pvt_user_ratesheet (username_ratesheet_id,user_id,ratesheet_id) values (SEQ_USER_RATESHEET.nextval,c3var.user_id,c2var.ratesheet_id);
dbms_output.put_line('Inserted for user :'||c3var.user_id||' is - ratesheet :'||c2var.ratesheet_id);
insertFound:=insertFound+1;
end if;
end loop;
end loop;
commit;
incrFound:=0;
deleteFound:=0;
for c3var in c3 loop
for c1var in c1(c3var.user_id) loop
foundFlag:=false;
for c2var in c2(c3var.user_id) loop
if c1var.ratesheet_id=c2var.ratesheet_id then
foundFlag:=true;
incrFound:=incrFound+1;
exit;
end if;
end loop;
if foundFlag=False then
--delete from pvt_user_ratesheet where user_id=c3var.user_id and ratesheet_id=c1var.ratesheet_id;
--dbms_output.put_line('Deleted for userid:'||c3var.user_id||' for ratesheet :'||c1var.ratesheet_id);
deleteFound:=deleteFound+1;
end if;
end loop;
end loop;
commit;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line (SQLCODE||' '|| SQLERRM);
END;
Regards,
MathewIn general, I would suggest that you only catch errors that you can handle reasonably. If you know that a SELECT INTO might return 0 rows for example, handle the NO_DATA_FOUND exception. Having a WHEN OTHERS, particularly without re-raising the exception, only serves to hide the source of the problem. I would much rather that my code fail quickly and explicitly than hope that I see an error message in the output and that other code doesn't start failing because the system wasn't left in an appropriate state.
As Mark suggests, you may choose to implement a comprehensive logging framework using autonomous transactions, in which case a WHEN OTHERS would be reasonable, but you would still want to propagate exceptions you cannot handle.
If you see a WHEN OTHERS clause and there is no RAISE, you probably have an error waiting to happen.
Justin -
Execute stored procedure from DOS or Unix Shell
Hi, need ur help again,
How to execute the stored procedure from DOS or Unix Shell?
Thanks!sqlplus -s /NOLOG @your_sql_script.sql
-- your_sql_script.sql :
connect user/password@connect_string
execute package.procedure (param1, param2, ...) -- for packages
execute procedure (param1,...) -- for procedures
exit ;this way you won't advertise your user/password on unix systems -
Execute stored procedure from Unix shell script
My current method of executing stored procedures (wpl_1 and wpl_2) from a unix shell script is as follows:
<<wpl.sh>>
sqlplus user/password @/home/oracle/scripts/wpl.sql
<<wpl.sql>>
set serveroutput on size 1000000
set timing on
execute wpl_1('0000010676','~')
execute wpl_2('0000010676','~')
execute wpl_1('0000010236','FIX')
execute wpl_2('0000010236','FIX')
exit
Question: Is it possible to combine the two scripts (unix and oracle) together?A little rusty on this, but this may work:
My current method of executing stored procedures
(wpl_1 and wpl_2) from a unix shell script is as
follows:
<<wpl.sh>>sqlplus user/password @/home/oracle/scripts/wpl.sql << EOF
set serveroutput on size 1000000
set timing on
execute wpl_1('0000010676','~')
execute wpl_2('0000010676','~')
execute wpl_1('0000010236','FIX')
execute wpl_2('0000010236','FIX')
exit
EOF
>
Question: Is it possible to combine the two scripts
(unix and oracle) together? -
Executing Stored procedure from host file
Hi all,
I am trying to execute a procedure from a host file.I don't know where I am doing wrong but the procedure is not executing.
#!/bin/bash
echo "*********************** Initializing Global Variables ***********************"
export CONNECT_STRING=$1
export START_TIME=`date +%m/%d/%Y:%H%M`
#export DATE_FROM=`date +%m/%d/%Y:%H%M`
#export DATE_TO=`date +%m/%d/%Y:%H%M`
DATE_FROM=$5
DATE_TO=$6
sqlplus -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S -S ${CONNECT_STRING} <<EOF
WHENEVER SQLERROR EXIT FAILURE
set echo off
execute xxjy_extract_ar_transactions.main_preinterface('$DATE_FROM','$DATE_TO');
EOF
echo "From Date is $DATE_FROM"
echo "To Date is $DATE_TO" In my log i can see the From Date is 1-Jan-2013 and To date is 28-Feb-2013 which are my input parameters to concurrent program.But I don't understand why my procedure is not getting called.
Please advice.
Thanks,
SandeepPlease post the details of the application release, database version and OS.
Is the issue with this specific host concurrent program?
Did you follow the steps in these docs?
How to Register a Host Concurrent Program in Applications [ID 156636.1]
How To Create A Custom Concurrent Program With Host Method and Pass Parameters To The Shell Script [ID 266268.1]
How Do You Run A Unix Host Script From Concurrent Managers On MS Windows Platform? [ID 412392.1]
How To Setup A Custom Concurrent Host Program [ID 147455.1]What is the reason of using more than one "-S" in the sqlplus command?
Please enable trace and generate the TKPROF file to find out what is happening when you kick off this concurrent program?
FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]
How To Trace a Concurrent Request And Generate TKPROF File [ID 453527.1]
Thanks,
Hussein -
Execute stored procedure from batch file
Hi,
can someone helpme hoe to run my stored procedure from a bacth file. I need it urgently. Can some one help
Thanks,
SriHi,
You can perform the below step..
1) Create .sql file and write the line as shown below there....
exec your_procedure_name
2) create .bat file containing authentication
sqlplus username/password@databasename @.sqlfilename
suppose i have a procedure called test then and my database name is oracle and user name is scott then i will create a file like
.sql file.. and sql file name is proc.sql
exec test {(parameter if any)};
.bat file
sqlplus scott/tiger@oracle @procIf you have any issue past here.. -
How to Run Stored Procedures from Teststand
I am trying to get teststand to run an SQL stored procedure but I always get the following error
Error executing substep 'Post'.
The following SQL command failed: 'EXECUTE cdt_st_test...'
Native error code -2147217900 0x80040e14
Microsoft OLE DB Provider for SQL Server:
Syntax error or access violation
It is a test stored procedure that doesn't pass any parameters.
Which steps must I use and how do I pass parameters.I have sussed it now. I was setting the "Command Type" to stored procedure instead of default. I changed it back and did "EXECUTE cdt_st_test" and it works. I have also added the parameters there as well.
-
Executing Stored Procedure from TOAD: ORA-00900: invalid SQL statement
Ok…I have ALL the stored procedures converted into Oracle…now, when I go to test them I am getting the vague error of:
ORA-00900: invalid SQL statement
I am attempting to execute:
--EXEC IEXGetAgentSysPerf(to_date('2008/09/01', 'yyyy/mm/dd/'), to_date('2008/09/11', 'yyyy/mm/dd'), 'US HelpDesk');
EXEC IEXGetAgentSysPerf('9/1/2008', '9/11/2008', 'US HelpDesk');
(Neither work). These are calling a Stored Procedure with the following header:
PROCEDURE IEXGetAgentSysPerf (
v_curparm_IEXGetAgentSysPerf IN OUT pkg_IEX.cur_IEXGetAgentSysPerf
,v_BDateTime DATE
,v_EDateTime DATE
,v_WorkGroup VARCHAR2
The IDE is “TOAD” for Oracle. Thanks in advance.Hi,
This is your procedure
PROCEDURE IEXGetAgentSysPerf (
v_curparm_IEXGetAgentSysPerf IN OUT pkg_IEX.cur_IEXGetAgentSysPerf
,v_BDateTime DATE
,v_EDateTime DATE
,v_WorkGroup VARCHAR2
you are providing the ,v_BDateTime DATE,v_EDateTime DATE and v_WorkGroup
and how about "v_curparm_IEXGetAgentSysPerf ". So that procedures is returning the error.
Adding the the earlier post, If you want to test the Stored Procedures... then I say you work on the PL/SQL
Developer which good for debugging (easy to use...) When compare to TOAD.. :-)
Test ..it there...
- Pavan Kumar N -
Execute Stored Procedure from C#
Hi, im new to using stored procedures and i have the following stored procedure...
CREATE OR REPLACE PROCEDURE DRL_PROCEDURE2(var_SOURCE_OBJECTID IN varchar2, var_NEW_OBJECTID OUT varchar2)
AS
BEGIN
SELECT MAX(NEW_OBJECTID)
INTO var_NEW_OBJECTID
FROM DRL_CONVERSION
WHERE SOURCE_OBJECTID = var_SOURCE_OBJECTID;
END;
I want to be able to call this procedure from my windows form application and display the result of the stored procedure into a label...could someone please help me! Thanks in advance!http://www.csharpfriends.com/articles/getarticle.aspx?articleid=78
You can find how to call stored procedure (in the above link you will find an example of SQL Server 2005 which also work for you as of your oracle stored procedure) in C#.
HTH
Girish Sharma -
In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .
Hi Srinath,
The below blog might be useful
http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
regards,
Harish -
Calling Stored Procedure with TestStand to SQL 2000
When I run the Stored Procedure in the query analyzer it returns the recordset fine. I am not specifying any parameters. I am Using TestStand 2.01 and SQL Server 2000. I am using the OPEN SQL STATEMENT step to call the SP. When I run the SP in TestStand I get no data returned. If I run the SQL statment in TestStand I get the data that I am requesting. Does TestStand not support stored procedures.
Hi,
The instructions that I posted were for TestStand 3.0. In version 3.0 you can call stored procedures with input/output paramateres and to support this functionality the data operation step support several new modes.
TestStand 2.0.1 does not support parameters on stored procedures, but it does support calling stored procedures that do not take parameters. To be able to access the data back from the database you need to set the cursor location (in the Advanced tab of the Open SQL Statement step) to Client (http://digital.ni.com/public.nsf/websearch/0EF68BF97AB1A61F86256B8E007D70C0?OpenDocument).
By changing the cursor to Client I was able to succesfully call a stored procedure from TestStand 2.0.1 and to read back the recordse
t return by the database. Please let me know if you are still experiencing dificulties.
Best regards,
Alejandro del Castillo
National Instruments -
Error while executing a stored procedure from forms6i
When I execute a STORED PROCEDURE from ORACLE DB 10g this procedure works perfectly fine.
But when I execute the same from the FORMs 6i I get the following error:
PDE-PLU022 Don't have access to the stored program unit
XMLPARSERCOVER in schema CARE.
where XMLPARSERCOVER is the class and
CARE is the schema.
Regards,
Jignesh SI have tried this with both the owner of the schema and the intended user, -from both forms and directly.
All rights was granted on the stored procedure. Since posting I have found that one of the tables that the procedure might insert into, was not explicitly granted to the intended user, and after rectifying that the error message went away.
-however, the procedure now silently "finishes" without any evidence that it ever ran, if invoked from the forms application. When invoked from SQL Plus (or JDev, or Toad) it runs as expected.
I have no public synonym for the procedure, -is that necessary?
The stored procedure in question is implemented in java, and published as a stored procedure. It does rather heavy lifting, when running, using a view against another server , updating local tables and quite a lot of data validation/cleansing, and logging. All recourses are within the same schema.
Any ideas? -
Error ORA-04031 while executing a stored procedure from Pro C++ code
I am getting the error ORA-04031(Unable to allocate 4096 bytes of shared memory("Shared Pool",.....)) while trying to execute a stored procedure from my pro*C application. This happens only after a few hours since the application has been running. I am closing the cursor after every database call.
Does anyone know why it is happening and any possible solutions?
TIA
Srithaj.One thing that can be done is to flush the shared pool before starting the application.
alter system flush shared pool;
Another is to increase the shared pool size by setting the parameter shared_pool_size in init_sid.ora file.
null
Maybe you are looking for
-
Setup my brand new iMac 21.5" with Mountain Lion (10.8.4) today and migrated from old iMac (10.6.8) Time Machine backup. The backup was made today just before the new startup so is absolutely current. Searched here and found many entries but they are
-
ISight doesn't work when chatting from south america?
I have a MacBook and was able to successfully iChat with my home G5 (10.4.7) desktop no problem. Now I'm working in Uruguay and everytime I try to iChat with my home computer it tells me that the communication is not possible. Does this have to do wi
-
when i click the firefox icon to open firefox it pops up a box that says that firefox is running but not responding. i open taskmager to close the firefox process but there is no firefox process listed. i restart my computer and get the same result.
-
How can I set the Remote app to work if I have lost my apple remote?
I lost my remote to my Apple TV and I can't go into town to get another at the moment because there was a lot of snow and ice here. So, I'm wondering how I can set my iPhone 5 up as a remote using the remote app without the normal remote. I know the
-
Some games in pogo will not fully load
certain games look like they are loading but then the game screen will not come up but yet i can play some games i have look at every thing and not sure how to fix it