How to Call PL/SQL Procedure
Hi
I am trying to call PL/SQL Procedure in OCI but i didn't get success, Please answer,
Thank you in advance
null
Here is a very short sample. Hope it helps
char SQLStatemen[] ="BEGIN spFoo (:P_Name);END;";
/* Initialize everything */
OCIBindByName (CommandHandler, &OCIBindName, ErrorHandler, (text *) ":P_Name", -1, (dvoid *) Name, strlen(Name) +1, SQLT
_STR, (dvoid *) 0,(ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT) == OCI_ERROR);
OCIStmtExecute (ServiceContext, CommandHandler,ErrorHandler, 1, 0, (OCISnapshot *) NULL,(OCISnapshot *) NULL, OC
I_DEFAULT);
/* if P_Name is an out parameter, at this point, it has the value it got from the database */
/* logoff and close everything */
Similar Messages
-
How to call pl/sql procedure/function from XML
Hi,
I have a requirement to call pl/sql function/procedure from the RTF template. How can I do this?Hi,
I have got the same requirement. We need to call the store PL/SQL procedure from the XML template to generate the fixedwidth files. Could you tell me if you are able to call PL/SQL procedure from XML template?
Thanks,
Ram -
How to call PL/SQL procedure from Jdeveloper
hai
i am using JDeveloper 10g version 10.1.3. i am working on Web Application[JSF,ADF BC]. i had commit button in one form. when i click that button a PL/SQL procedure can be invoked.( the procedure is to check for primary key)
how to do this
thanks in advance
C.RThere are already some threads about calling PL/SQL from Java. E.g.: adf bc jsf application and database stored procedure
Ronald -
How to call Pl/sql procedure from form ?
Hi all,
I need to call a procedure from form after the user has pressed the button to invoke the sql procedure, can anyone please advise me on how to do it ?
Thanks.
LimHi,
Thanks for your reply.
yes, I have include in when-button-pressed trigger as
AIC_PROC_AR_CCID_UPD;
Below is my procedure :-
CREATE OR REPLACE PROCEDURE AIC_PROC_AR_CCID_UPD(errbuf out Varchar2,
retcode out Number ) is
VAR_BUF VARCHAR2(240);
Cursor C1 is
SELECT CONCATENATED_SEGMENTS ACCT,
SEGMENT5 SEG5
FROM AIC_GL_COA AGC
WHERE AGC.CODE_COMBINATION_ID IS NULL;
Rec1 C1%RowType;
BEGIN
FOR Rec1 IN C1 LOOP
BEGIN
UPDATE AIC_GL_COA A SET ( DESCRIPTION, CODE_COMBINATION_ID, SEGMENT5 )=
( SELECT FFVT.DESCRIPTION, GLA.CODE_COMBINATION_ID, GLA.SEGMENT5
FROM GL_CODE_COMBINATIONS_KFV GLA,
FND_FLEX_VALUES_TL FFVT,
FND_FLEX_VALUES FFV
WHERE GLA.CONCATENATED_SEGMENTS = REC1.ACCT
AND FFV.FLEX_VALUE = REC1.SEG5
AND FFV.FLEX_VALUE_ID = FFVT.FLEX_VALUE_ID
AND FFV.FLEX_VALUE_SET_ID = 1002673 )
WHERE A.SEGMENT5 = REC1.SEG5 ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'NO RECORD UPDATE !!');
END;
END LOOP;
COMMIT;
RETURN;
END;
However, when I try to compile it, error prompt :-
Error 306 at line 1, column 1
wrong number or types of arguments in call to 'AIC_PROC_AR_CCID_UPD'
Error 0 at line 1, column 1
statement ignored.
By the way, my form 6i is running at client site and connection to procedure in unix server. Will this is ok ?
Thanks
Rgds
Lim -
How to call PL/SQL procedure from PERL
I have a requirement to create a PERL wrapper for few PL/SQL procedure.
Can any one tell me how to call the procedures from PERL ?
Thanks in advance.
....sriniA quick Google search shows:
http://www.saturn5.com/~jwb/dbi-examples.html#ora_sp -
How to Call pl/sql procedure from shell script
Hi,
I've one procedure which takes the xml file name as input from one of the remote location. Every day users keep one file in that location.
For eg:
ACS_RPO00020110316_20110316220956.xml
ACS_RPO00020110319_20110319220956.xml
I need to read the latest file in this case. In this case second one is the latest file.
Can some body please help me how to write script to pass parameter to that procedure that via shell program and execute that.
Thanks in advance.
Regards
Nagendrahi
I executed the below mentioned steps, but I did not get any result:
I am pasting all the steps which I did
-bash-3.2$ ls -lrt
total 316
-rw-r--r-- 1 oratest dba 4884 Mar 16 03:56 XXGEBIZ_EPO160320110356.xml
-rw-r--r-- 1 oratest dba 4884 Mar 16 03:57 XXGEBIZ_EPO160320110357.xml
-rw-r--r-- 1 oratest dba 4884 Mar 16 17:52 GEBIZ_ACS_RPO00020110316_20110316175216.xml
-rw-r--r-- 1 oratest dba 38 Mar 16 18:18 GEBIZ_ACS_RPO00020110316_20110316181858.NODATA
-rw-r--r-- 1 oratest dba 63 Mar 16 22:09 GEBIZ_ACS_RPO00020110316_20110316220956.xml
-rw-r--r-- 1 oratest dba 9716 Mar 16 22:14 GEBIZ_ACS_RPO00020110316_20110316221429.xml
-rw-r--r-- 1 oratest dba 12988 Mar 17 01:42 GEBIZ_POC_RPO000EPO20110317_20110317014247.xml
-rw-r--r-- 1 oratest dba 13103 Mar 17 01:53 GEBIZ_POC_RPO000EPO20110317_20110317015356.xml
-rw-r--r-- 1 oratest dba 38 Mar 17 01:57 GEBIZ_POC_RPO00020110317_20110317015712.NODATA
-rw-r--r-- 1 oratest dba 38 Mar 17 18:44 GEBIZ_ACS_RPO00020110317_20110317184423.NODATA
-rw-r--r-- 1 oratest dba 12326 Mar 17 18:46 GEBIZ_ACS_RPO00020110317_20110317184603.xml
-rw-r--r-- 1 oratest dba 67578 Mar 18 01:32 GEBIZ_POF_RPO000EPO20110318_20110318013232.xml
-rw-r--r-- 1 oratest dba 14484 Mar 18 20:27 GEBIZ_POF_RPO000EPO20110318_20110318202754.xml
-rw-r--r-- 1 oratest dba 47653 Mar 19 01:29 GEBIZ_PYS_RPO00020110319_20110319012953.xml
-rw-r--r-- 1 oratest dba 937 Mar 21 09:34 GEBIZ_SUPP.xml
-rw-r--r-- 1 oratest dba 947 Mar 21 09:35 GEBIZ_SUPP1.xml
-rwxrwxrwx 1 oratest dba 121 Mar 21 17:43 test
-bash-3.2$
-bash-3.2$ cat > test
ls -lrt | tail -1
filelist = $(ls GEBIZ_SUPP*.xml)
for file in $filelist ; do
echo "inside loop"
file = $file
echo "file name " $file
done
XGBZ_SUPP_MAST_XMLTAG_PROC $file
-bash-3.2$ chmod 777 test
-bash-3.2$ ./test
-bash: ./test: Text file busy
-bash-3.2$
Initially I listed down all the files, in a sample file I've written the steps. But nothing is executed.
One thing I want to ask here XGBZ_SUPP_MAST_XMLTAG_PROC is my procedure. I think I need to invoke sqlplus in the so as to execute my pl/sql script.
Gurus, please let me know how to write them.
Regards
Nagendra -
Calling PL/Sql Procedure in Jdeveloper 11g
Hi All,
How to call PL/Sql Procedure in Jdeveloper 11G. Here my procedure prints some statements in procedure using "dbms.output.put_line" . Here I want to call that procedure using button (or) ImageLink and print all the statements in pl/sql procedure in Jdeveloper Environment.
Can anybody help on this .
Thanks in Advance .
Edited by: u41411 on Sep 28, 2009 7:18 AMHer is what I use to call Oracle DB procedure:
procCall = "BEGIN " + YOUR_PROC_NAME + "(); END;";
returned = am.getTransaction().executeCommand(procCall);
where am is my application Module
Hope this help.
Jack -
How to call a sql stored procedure in java...... HELP
Hi I am making an application for taking backup in sql automatically so i have created a dts package which is called by a stored procedure. Now the problem is that how to call that stored procedure in a Java program so that after running my java program i get my database backup.
Please please solve my problem.
thanks in advance.
If possible please send the code.
Message was edited by:
Andy_Davis
Message was edited by:
Andy_DavisHi... I am trying to create a dts package which is called by a stored procedure... How can i do this? IF possible can you please send me the code as well..
Thanks a ton...
Susan_Davis -
How to call pl/sql stored procedure in JDBC query dialogbox
Hi,
how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
Cheers,
Raghuplease refer : Re: problem If you have more doubts, please ask in that question.
-
How to call PL-SQL/stored procedure in Creator
Anybody can tell how to call PL-SQL/Stored procedures inside creator...
Hi!!!
You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
Byeee -
How to call a sql server stored procedure from oracle
Hi all,
Please anybody tell me how to call a sql server stored procedure from oracle.
I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
"dbo"."CreateReceipt"@hsa
where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
my database version is 10g
Please help me how can i call it... I need to pass some parameters too to the SP
thanking youhi,
thank you for the response.
when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
my code is,
declare
c INTEGER;
nr INTEGER;
begin
c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
end;
Create_Receipt is the sp which requires two parameters.
please give me a solution
thanking you
sreejith -
How to call PL/SQL function in processRequest
Hi,
I am trying to execute a function called xxhr_trg_evaluation_pkg.xx_get_class_desc(1);
how i can execute the above function inside the processRequest and pass the return value into a String variable.
Thanks in advance
Regards....AshrafAshraf,
The following code will help you how to call function or procedure in processRequest.
processRequest Code:
public void processRequest(OAPageContext pageContext, OAWebBean webBean){
OAApplicationModule oaam = pageContext.getApplicationModule(webBean);
OADBTransaction dbtrans;
OADBTransaction txn = (OADBTransaction)oaam.getOADBTransaction();
//statement which have similar execute statement like pl/sql in toad
CallableStatement cs =txn.createCallableStatement("begin :1:=xxhr_trg_evaluation_pkg.xx_get_class_desc(:2);end;",0);
//variable going to hold the return value
String outputVal="";
//pass input value to the callable statement
try{
cs.setString(2,1+"");
catch(Exception e){
try{
cs.execute();
outputVal=cs.getString(1);
catch(Exception e){
try{
cs.close();
catch(Exception e){
//if have done any update/insert/etc means do the commit from here also else you haven't given commit in the function by using the following syntax
dbtrans.commit();
Thanks,
SAN -
Calling PL/SQL procedures from a Windows CMD script
Hello,
I am writing a Windows CMD script. From this script I want to call procedures from a PL/SQL package which selects, inserts or deletes rows from the database.
How do I go about logging into the database from the cmd script and calling PL/SQL procedures from there?
Does anyone have any examples of such scripts? Thanks in advance.No, it is not a job that needs to be scheduled.
The script will be used when needed to select info from a certain table and also to insert or delete certain info into/from this table (so, it is just simple sql statements which I have put into a package), but I'm sure how to log into the database and execute the procedures from this package in a cmd script. -
How to call a Store Procedure with IN PARAMETER
Hi, im new using Oracle 10G with Oracle SQL Developer, my cuestion is how to call a Store Procedure with IN PARAMETER, I tried the following without results
SELECT * FROM procedure_name(parameter);
PROCEDURE procedure_name(parameter);
EXEC procedure_name(parameter);
CALL procedure_name(parameter);
Please help me....Hi,
As Beijing said,
EXEC procedure_name(parameter);
CALL procedure_name(parameter);work for me.
So does
BEGIN
procedure_name(parameter);
END;Can you be more specific about what you're doing? That is, are you testing it in SQL Developer? Where are you entering the commands? Where are you looking for output? Do you get error messages? Does anything else (like "SELECT SYSDATE FROM dual;") work? -
Calling PL/SQL Procedures from Java
Hello,
I want to know, if it is possible to call PL/SQL Procedures from
SQLJ(which uses htp.print from the Package web toolkit ).
Though, it is possible to call normal procedures but if I want
to call PL/SQL procedures with htp.print then I get I error.
For example:
#sql{Call html_test()};
Can you give me a advice?
Your help is much appreciated!
M|llerOracle's htp packages are develop to be work with
mod_plsql/OAS/OWS webserver.
If you are trying to use htp packages first need to instanciate
some enviroment vars for htp packages, for example first you has
to call to owa.initialize procedure, populate owa.cgi array and
so on.
If you need more information about how this toolkit works you
could get the source of DB Prism at
http://www.plenix.com/dbprism/ this open source framework
includes backward compatibility with mod_plsql application and
then includes settings of this values from Java code.
Best regards, Marcelo.
Maybe you are looking for
-
I'm having a problem with animated gif in dreamweaver. I set it up so that when I mouse over a button a gif plays then when I mouse off of it another gif plays to restore the page to it's original look. Basically an image moves from one side of the s
-
Hi, i am working on MQ-XI-BW Scenario.i have configured JMS Adapter in Plain J2SE Adapter Engine.But the status is red with a message "javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'BWXI:TEST.QMGR' at com.ibm.mq.jms.se
-
Hi Detlev, I have received a requirement wherein the pdf file needs to be stored within portal, and on click of a link on the left detailed tree navigation iview, the pdf file needs to open up. The user does not want to store document in KM. Please a
-
How to Perform ERP system configuration ?
Could any one let me know regarding this ERP system configuration. ? Thanks in advance, Hawkin
-
Blind Spot since 7.0.2?
Since I've updated my iPhone 4 from 7.0 to 7.0.2 I have massive problems with the display/touch. There is a blind spot in the lower middle around the r-t-z-f-g-h- Keys and above! I can, sometimes, hit the key when i come from the e sliding to r or fr