Calling multiple procedures
Hi allI use Sql Developer and calling several procedure like this:
Start multip (1,2); end;
Start multip (3,2); end;
Start multip (4.2); end;
Start multip (5.2); end;
and when I am trying to run this as one, treat this as a single block and not running.
Tried that too... but still get an error.
Start multip (1,2); end; \
Start multip (3,2); end; \
Start multip (4.2); end; \
Start multip (5.2); end; \
Please suggest what should be the syntax.
Thank you
VJ
Run it as:
begin
multip(1,2);
multip(3,2);
multip(4,2);
multip(5,2);
end;
SY.
Tags: Database
Similar Questions
-
Calling a procedure from a form of Oracle database
Hello
I have a question, we will be calling the procedure from a form of Oracle, and through that we can spend as input values from 1000 to this procedure and that we must return values back to the Oracle form also. Here the damaged take two or more parameters. Please advice.
To receive the input values, we have the input parameter of the procedure as a type object, so that we can receive several parameter values.
Thanks and greetings
Srinivasuser2626293 wrote:
Hi François,Thanks for your response, please suggest me as to how we can achieve the passage of the parameters that can contain multiple values, by a call to the procedure of the form of the Oracle database
Hi Srinivas,
Here is an example of how...
CREATE OR REPLACE PROCEDURE P_GET_SAL (P_EMPID NUMBER, P_SAL OUT NUMBER) IS BEGIN SELECT SALARY INTO P_SAL FROM EMPLOYEE WHERE EMPLOYEE_ID=P_EMPID; END; SQL> VAR G_SAL NUMBER; SQL> EXEC P_GET_SAL(100,:G_SAL); PL/SQL procedure successfully completed. SQL> PRINT G_SAL; G_SAL ---------- 2300
Hope this helps
Hamid
If someone answer is useful or appropriate, please mark accordingly. *
-
Avoid calling the procedure in the cursor loop
Hi all
The following example of procedure the procedure written in cursor loop, is called each time until the end of the cursor loop...
What would be the alternative methods to write the procedure above instead to call the procedure inside the cursor for loopprocedure proc_main is DECLARE cursor c1 is select e.empno empno ,e.ename ename ,d.dname dname ,d.loc loc from emp e,dept d where e.deptno = d.deptno ; BEGIN for i in c1 LOOP proc_test(i.empno,i.ename,i.dname,i.loc) ; end loop; END; ----------- PROCEDURE proc_test (p_empno,p_ename,p_dname,p_loc) is --- --- begin select * into v1,v2,v3 .. from temp_tab where col1 =p_empno ---- ---- end;
My idea is to use collections... could you give me the code example using collections to meet the above criteria
Thank you
Published by: smile on February 28, 2012 15:45The ideal would be to collect all SQL logic and put as much of it in a single SQL statement as possible. It would be also great to determine what is the final outcome of the process and use it as a starting point for your SQL. For example, if the desired result is to upgrade the salaries of the employees where they have an entry in table x, you might find that you can avoid needing to separate the logic between multiple, i.e. instead of procedures
procedure proc_main is DECLARE cursor c1 is select e.empno empno ,e.ename ename ,d.dname dname ,d.loc loc from emp e,dept d where e.deptno = d.deptno ; BEGIN for i in c1 LOOP proc_test(i.empno,i.ename,i.dname,i.loc) ; end loop; END; ----------- PROCEDURE proc_test (p_empno,p_ename,p_dname,p_loc) is --- --- begin select * into v1,v2,v3 .. from temp_tab where col1 =p_empno ---- ---- UPDATE emp e SET sal = v2 WHERE e.empno = p_Empno; end;
You may simply have
procedure proc_main is BEGIN UPDATE emp e SET sal = ( SELECT t.new_sal FROM temp_tab t WHERE t.empno = e.empno ) WHERE EXISTS ( SELECT NULL FROM temp_tab t WHERE t.empno = e.empno ); END;
Even if your logic is more complex, you are likely to find that you can merge several of the statements that you could be running in a loop and replace that loop with a join.
Given the particular structure of what you posted if, instead of calling the procedure in a loop, you can simply move the cursor c1 as a parameter to proc_test that is
procedure proc_main is lc_c1 sys_refcursor; BEGIN OPEN lc_c1 FOR select e.empno empno ,e.ename ename ,d.dname dname ,d.loc loc from emp e,dept d where e.deptno = d.deptno ; proc_test(c1) ; END; ----------- PROCEDURE proc_test (p_Cursor sys_refcursor) is begin LOOP FETCH .... ...DO SOMETHING... EXIT WHEN p_Cursor%NOTFOUND; END LOOP; CLOSE p_Cursor; END;
But I highly recommend that you consider trying to merge as much of your SQL before considering the approach of cursor.
HTH
David
-
Hi friends I want to know how to call a procedure that has values arrary as parameter?
I have a procedure as shown below, and I am using oracle 11g.
create or replace procedure procedureName (v_hospital_id in NUMBER,
v_process_id VARR_VARRY,
v_cnt OUT NUMBER);
Now, how to call this procedure from PLSQL. If v_process_id values ('abc123', 'xyz234', 'sfs234')
Please present the definition of VARR_VARRY
If it's a simple table of varchar2.
declare
v_cnt NUMBER;
Start
procedureName (1, VARR_VARRY('abc123','xyz234','sfs234'), v_cnt);
end;
-
ORA-06508, procedure cannot call the procedure of package
I have a large stored procedure that calls a package (procedure) that manages a number of procedures to determine whether the process can continue or not. (It checks authorization of the student to enroll in a class). We have a web process calling the stored procedure, and that works fine. What does not work, is a call to the package. Oracle returned ORA-06508: PL? SQL: could not find program unit called.
I have included instructions for debugging, so I know that it is the specific call to a procedure in the package fails with ORA-06508. Thinking it's perhaps something in the package, I inserted a debug statement as the first line in the procedure called in the package. (Debugging instructions call a procedure inserts of rows in a table of debugging with independent validation).
When I log in the user account with sqlplus and run a test, everything works fine. But when the web process is running under the same user, the process fails to call the procedure of package and fails with ORA-06508.
It seems as if the web process runs with the rights of the appellant, or a role is not granted.
Can someone help me understand what the problem is?
offered hv, I appreciate your comments.
We solved the problem: remove the package that couldn't be cited, then re-create. That's all!
Apparently, something in the database was tangled upward. The server recently had problems with disk space, then it might have been related to that. But we'll never know for sure.
The stored procedure and packaging (procedures) which he called were owned by the same schema, and there is no mechanism that I can find to prevent one of the other appellant. But that was the case - Oracle threw the ORA-06508 exception when the stored procedure called the package procedure.
I replaced the stored procedure and package several times fine-tuning debugging code, but this has not fixed the problem.
Finally let it drop and then re-create the package, it's which solved the problem.
Regarding requests to view the code, there is no way that I could reproduce the problem, since the error that occurred was against the permissions and rules which packages run and the procedures of the Oracle. Thanks for all the tips and suggestions.
-
call a procedure of package DB type complicated if the type defined in the package itself
Hello world
I use jdev 11.1.1.7.0
I defined a package of data with a procedure and internal two types as follows:
Create Or Replace Package Db_Package As Type rec Is Record(Rec_Type Varchar2(10), Rec_Desc varchar2(10) ); Type recordList Is Table Of rec; Procedure Test_Procedure(p_out out recordList); END db_package;
evil
I want to call this procedure in the module of the application. I know how to call a procedure or function db AM,
but in this case that I've defined two types in the package itself and I use one of these types as to the procedure output parameter, I had a problem.
below is the example of code to call the db procedure, but it does not work because the plsqlBlock.registerOutParameter () setting will not
CallableStatement plsqlBlock = null; String statement = "Begin DB_PACKAGE.Test_Procedure(:1); END;"; try { plsqlBlock = getDBTransaction().createCallableStatement(statement, 0); plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY);// it doesn't work plsqlBlock.executeUpdate(); Object object = plsqlBlock.getObject(1); } catch (Exception e) { e.printStackTrace(); }
I know that if I set the types of packets (rec, recordList) as types of oracle (instead of setting in the packaging itself) so I can call the procedure with success, in this case I should use below:
plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY,"Recordlist");
but I wonder how you can call a procedure from the package if the types defined in the package itself.
Kind regards
Habib
JDBC supports the types of oracle level package only from 12 c database and jdbc driver ojdbc7 (which requires java 7).
Dario
-
How to call the procedure on the page of the ofa
Hi all
I have a button.when I click this button need to call the procedure and should return the values.i tried with below code.am is error.i am passing two parameters to the procedure.please suggest me where I made a mistake in the code.
code in am
-------------
public String calprorate (String laseid, String billingid)
{
OADBTransaction oadbtransaction = (OADBTransaction) getTransaction ();
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl) getTransaction ();
String retValues;
System.out.println ("number:" + laseid);
StringBuffer str = new StringBuffer();
Str.Append ("BEGIN");
Str.Append (LEASE_PRORATE_PKG ".") LEASE_PRORATE_PROC1 (»);
Str.Append ("p_lease_id = >: 1");
Str.Append ("p_billing_id = >: 2");
Str.Append ("P_PRORATE = >: 3");
System.out.println ("params");
Str.Append (»); «) ;
Str.Append ("END");
System.out.println ("End");
OracleCallableStatement oraclecallablestatement =
(OracleCallableStatement) oadbtransaction.createCallableStatement (str.toString (), 1);
System.out.println ("Oracle");
try {}
oraclecallablestatement.setString(1,laseid);
oraclecallablestatement.setString(2,billingid);
oraclecallablestatement.setInt (1, Integer.parseInt (laseid));
oraclecallablestatement.setInt (2, Integer.parseInt (billingid));
System.out.println ("param");
oraclecallablestatement.registerOutParameter (3, Types.VARCHAR);
System.out.println("3");
oraclecallablestatement. Execute();
System.out.println ("exe");
retValues = oraclecallablestatement.getString (3);
}
catch (System.Exception e)
{
System.out.println ("delivery");
throw OAException.wrapperException (e);
}
Return retValues;
System.out.println ("End");
}
code co:
-------------
If (pageContext.getParameter ("Calc")! = null) {}
Vo1 OAViewObject = (OAViewObject) am.findViewObject ("AddonBillingVO");
System.out.println ("VO");
{if(VO1!=null)}
CNT int = vo1.getRowCount ();
System.out.println ("count:" + cnt);
If (cnt > 0)
{
RowSetIterator rs = vo1.createRowSetIterator("empIterator");
System.out.println ("EMP");
If (rs! = null)
{
While (rs.hasNext ())
{
AddonBillingVORowImpl line = rs.next ((AddonBillingVORowImpl));
System.out.println ("impl");
If (line! = null)
{
String laseid = row.getAttribute("LeaseId").toString ();
System.out.println (laseid);
String billingid = row.getAttribute("AddonBillingId").toString ();
[Serializable] param = {}
laseid, billingid
};
String newupc = (String) am.invokeMethod ("calprorate", param);
}
}
Khalil.
You can paste your spec procedure here?
Also see: Oracle tips of Johny: OAF: sample code to call the PL/SQL of OA Framework procedure
-
Case function can be used as a parameter when calling a procedure, please notify
The daily procedure is called with the parameter 3 following one of the parameters using a function box between them as shown below.
Daily_Ins (c1.p_mtrid, c1.p_UOM CASE WHEN "KWH" THEN 1 ELSIF 'KW' THEN 2 END, v_dateHold);
In my opinion, using decode is illegal, so I think that I cannot say something like :
Daily_Ins (c1.p_mtrid, ( decode c1.p_UOM, "KWH", 1 'KW', 2), v_dateHold);
I think I just found something on the net
SQL > DECLARE
2 wages NUMBER: = 20000;
3 employee_id NUMBER: 36325 =;
4
5 PROCEDURE give_bonus (emp_id in NUMBER, bonus_amt number) IS
6 BEGIN
7 DBMS_OUTPUT. Put_line (emp_id);
8 DBMS_OUTPUT. Put_line (bonus_amt);
9 END;
10
BEGIN 11
12 give_bonus (employe_id,
13 CASES
14 salary when > = 10000 AND salary<=20000 then="">=20000>
15. WHAT salary > 20000 AND salary<= 40000="" then="">=>
16. WHAT > 40000 salary THEN 500
17 0 OTHERWISE
18 END);
END 19;
20.
PL/SQL procedure successfully completed.
-
How to call the procedure type table
Hi I have the below requirement
Created in the sub table type
CREATE or REPLACE the TYPE char_type IS the TABLE OF VARCHAR2 (4000);
create or replace procedure test_proc_type (p_type char_type) is
Start
I'm looping 1.p_type.count
dbms_output.put_line (p_type (i));
end loop;
end;
How to call the procedure with parameter as a type!
SQL> create or replace type char_type as table of varchar2(4000) 2 / Type created. SQL> create or replace procedure test_proc_type (p_type char_type) 2 is 3 begin 4 for i in 1..p_type.count loop 5 dbms_output.put_line (p_type(i) ) ; 6 end loop; 7 end; 8 / Procedure created. SQL> set serveroutput on SQL> SQL> exec test_proc_type(char_type('A','B','C','D','E')) A B C D E PL/SQL procedure successfully completed. SQL>
-
Hello
I need help to call a procedure within a package.
I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.
Thanks in advance
I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.
This forum, as the title suggests, is for developer Sql questions only and NOT for questions of SQL or PL/SQL.
If this is not related to Sql Developer then please mark ANSWERED and repost it in SQL and PL/SQL forum
https://community.Oracle.com/community/Developer/English/oracle_database/sql_and_pl_sql
During the validation you must provide your name and full version.
You must also explain why even need help because procedure X can call just procedure Y directly since they are in the same package.
For an Oracle DB, see documentation and examples of ' packages of PL/SQL to help "in the doc of the PL/SQL language
http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/packages.htm#CIHIJECJ
-
NullPointerException when calling stored procedure
I have the stored procedure
create or replace PROCEDURE GREETING_PROC
(
TEXT_PARAM IN VARCHAR2
MSG_TEXT VARCHAR2 OUT
) AS
BEGIN
MSG_TEXT: = "Hello" | TEXT_PARAM;
END;
My stored procedure call method
public class UserBean {}
public UserBean() {}
Super();
}
Public Shared Sub main (String [] args) {}
UserBean userBean = new UserBean();
userBean.callP ();
userBean.callStoreProcedure ();
}
public void callStoreProcedure() {}
CallableStatement st = null;
SysUser SysUserEOImpl = new SysUserEOImpl();
try {}
String sql = "BEGIN GREETING_PROC (: TEXT_PARAM,: MSG_TEXT); END; « ;
St = sysUser.getDBTransaction () .createCallableStatement (sql, sysUser.getDBTransaction (). DEFAULT VALUE);
st.setObject ("TEXT_PARAM", "Scoot");
st.registerOutParameter ("MSG_TEXT", Types.VARCHAR);
St.Execute ();
System.out.println ((String) St.GetObject ("MSG_TEXT"));
} catch (SQLException e) {}
throw new Aexception.getLocalizedMessage (e);
}
}
then I got an exception:
Exception in thread "main" java.lang.NullPointerException
at cic.opsi.model.bean.UserBean.callStoreProcedure(UserBean.java:35)
at cic.opsi.model.bean.UserBean.main(UserBean.java:27)
Hello
What statemet is UserBean.java:35)?
Second, create a new SysUserEOImpl()!
If you want to call stored proc, put the java code calling stored proc in ViewRowImpl/ViewObjectImpl/ApplicationModuleImpl and export this code in the customer interface. Then put this method in the pageDef as
a call him as an OperationBinding Zeeshan Baig blog: the PL/SQL procedure call and function in the Oracle ADF application
Extending the functionality of the components Business
ADF/OFA for Oracle Techies: ADF call stored procedure with Out parameters
Latest Oracle technology: call Store procedures for Oracle ADF Application
-
How to call a procedure with parameter SYS_REFCURSOR OUT
Hello
With the help of Oracle 11 g R2.
I would like to know if it is possible to display the results of a SYS_REFCURSOR in a query. For example, if I had the following stored procedure
create or replace procedure testprocedure (result OUT sys_refcursor) as begin open result for select 1 from dual union all select 2 from dual; end;
I want to call this procedure similar to how a query is called and executed. Like this
Select * from testprocedure
I have seen lots of examples on the web that show how it is possible to loop through the results of a sys_refcursor inside an anonymous block and display the results using dbms_output.putline, but this isn't the method I'm looking for.
Read this: PL/SQL 101: understanding Ref Cursor
You're wrong if you think a ref cursor is a result set of data that you can query from.
-
calling a procedure in the loop
I just want to know one thing:
I call a procedure with the following parameters
DECLARE
PROFIT_CENTER NUMBER ;
START
PROFIT_CENTER : = 1109--(de même, je fais tourner le proc pour 5 profit_centers plus 1123,1132,1122,3211,1111 un par un en passant les valeurs manuellement, il prend près d'une minute pour chaque centre de profit)
Prc_test_calc () PROFIT_CENTER);
COMMIT;
END;
For each proc profit_center takes 1 minute (approx.) time.
But when I'm putting loop to call the procedure for each profit_center, I don't know why it takes too long for each profit_center
Please let me know is there something wrong with the loop below
DECLARE
PROFIT_CENTER NUMBER ;
cursor c_profit is
Select separate PROFIT_CENTER de plng_pc où profit_center in ()1109 1123,1132,1122,3211,1111)-Plng_pc is a table where profit_center information is obtain from
START
For pc_rec in c_profit
loop
Prc_test_calc ( pc_rec . PROFIT_CENTER );
COMMIT;
End loop;
END;
Could you please sugget me if something goes wrong?
Hello
as suggested, have you checked the query for the cursor loop and have you tried the process with no cursor loop.
Concerning
André
-
Call a procedure from javascript
Hello
I would like to help on the following please.
I have a JavaScript in page region 'function and Global Variable declaration ':
In the same page one have a number of standard reports. A number of columns in each of these reports sets a link. The binding for all the columns settings are defined as follows:function openUrl(pUrl) { window.open(pUrl,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=1024, height=768"); }
As you see, the user of the application, click on the link on the column of the report and a popup is generated showing the report. It all works very well.Target: URL URL: javascript:openUrl('http://#SERVERNAME#:9704/xmlpserver/Publications/Dock_Report.xdo?_xpf=&_xpt=0&_xdo=%2FPublications%2FDock_Report.xdo&_xmode=4&_paramsID_USU=#ID_USU#&_paramsIDCR=#IDCR#&_paramsIDCU=#IDCU#&_xt=DPol_Layout&_xf=pdf&_xautorun=true');
My requirement is to call a procedure from the augments that are included in the column link that was clicked by the user of the application.
My question is how to achieve this as the url is inside a call to javascript?#ID_USU# #IDCR# #IDCU#
Can I use the Javascritp set in the page to extract the details, and then use javascript to call a procedure?
Any help, pointers, ideas, everything is welcome.
Request Express 4.0.2.00.07
Thank you
Published by: zooid on 4 April 2013 22:47Have you seen this javascript API? http://docs.Oracle.com/CD/E17556_01/doc/apirefs.40/e15519/javascript_api.htm#BGBJHEHG
It has very convenient function: apex.submit (pOptions);
Specify the target URL as:
JavaScript:rowClick('#ID_USU#',_'#IDCRM#',_'#IDCU#');
Then add a function to your page somewhere:
function rowClick(idUsu, idcrm idcu){ openUrl(/*url*/); apex.submit({request: "SOME_REQUEST_VALUE", set: {Px_ID_USU: idUsu, Px_IDCRM: idcrm, Px_IDCU: idcu}}); }
(Where you have page elements for each of the items that you want to set.
Then you can have a process of PL/SQL page, under condition of request = expression 1, term 1 = SOME_REQUEST_VALUE
And do you want to ;-)
-
Train stuck compilation when I call a procedure
Hello
I call a WHEN BUTTON PRESSED trigger procedure in a form.
The compilation is caught in the Middle when compiling reaches this trigger.
But when I compile the procedure that is called the form from the outside, its getting compiled successfully.
Any body can help me on this. Please let me know what could be the reason for this.
Thank you
SameerYou use a completely outdated version of the forms. At the very least, you should spend the last forms 6i forms, by applying the Patch 18. That will bring you to 6.0.8.27.0 the same level, Oracle does not support, but some of us still use it.
I think that there has always been problems using the links in the database, so I don't know what would be your solution. .. perhaps build procedures that run on the database to do the work, instead of starting in your form when they need to use the links in the database. Then call the procedures of your form.
Maybe you are looking for
-
Want 7640: Can my scan want x 7640 HP for Evernote
I'm trying to find how to use my desire 7640 officejet all-in-one to scan directly into Evernote. Should what software I use?
-
Does anyone play Everquest on a Windows 7 platform?
I can't play. Also, did the matter of IE version?
-
HP 15-r221nv: reset BIOS HP 15-r221nv - Clearing CMOS password did not work.
Hello I tried to access my BIOS (hit F10) but it asked for a password that I never install. I took out the CMOS battery and at first start, I got a message saying that the BIOS has taken over the default values. After hitting Enter and F10 at startup
-
I hit CRL + ALT + DEL to lock my computer (XP SP3). When I press CRL + ALT + DELETE to open a session back (unlock) is application name to username/password instead of just remember my user name and only to enter the password. How can I just change
-
HelloI help a non-profit with some design work. I created documents printed for them using Museo via typeKit via my subscription of the CC. They use stand-alone for CS6 InDesign and Photoshop non-profit license; it requires a subscription to creative