Call or execute the procedure 1000 times simultaneously
Hi all,
I hava written a procedure. And i want to call or execute the procedure 1000 times simultaneously.
I don't want like below
for i in 1..1000 loop
exec procedure1
end loop;
Any Idea ?
Bye
Nathan
You want the procedure to run 1000 simultaneously? Well, one way to do this is to set up 1000 SQL*Plus sessions and prepare 1000 EXEC statements, which you kick off at the same time. This approach is good if you're a Hindu deity.
Alternatively you can use DBMS_JOB to submit calls to the procedure, viz.
for i in 1..1000 loop
DBMS_JOB.SUBMIT(jobno , what=>'procedure1', next_date=> trunc(SYSDATE) + 11/24);
end loop; This - trunc(SYSDATE) + 11/24 - ensures that all the jobs kick off at 11 o'clock in the morning. You may need to adjust the timing to suit your needs.
Are you sure you have sufficient resources to run this job 1000 times?
Vibes, APC
Similar Messages
-
Database is Hanging after executing the Procedure ...
Dear All i am using 10G.
I Have a procedure . After executing the Procedure when i try to call that procedure it is hanging ...
it is creating Locks .. As our DBA told..And told to check the code ...
Can any one tell me how can i put mu codes with formatting ? When i copy paste my code it is showing properly but after POST MESSAGE it is showing like i have written history ...--*
I am Executing the procedure like this ...
EXEC simulator_validation ('0|BP-V1|20101004|01|1|2430962.89|27|2430962.89|MUR|20100928120106','04-SEP-2010',27,2430962.89,'MUR','000111111111');
And my code is :-
{Create Or Replace Procedure simulator_validation (lstring varchar2,ldate date,lno_item number,ltotal number,lcur varchar2,lac_no Varchar2)
IS
l_swift_code_acno number;
l_ACno_Valid number;
l_swift_code_others Number;
lpcode varchar2(5);
lCcode Varchar2(4);
lval number;
lacno varchar2(16);
v_file varchar2(20);
v_path varchar2(50);
LToken VARCHAR2(100) ;
i PLS_INTEGER := 2 ;
lfirst_char number;
lvalue Varchar2(100) ;
lcol number:= 1;
Begin
lfirst_char := Substr(lstring,0,1);
Dbms_output.put_line(lfirst_char);
IF lfirst_char = '0' Then ------------------- For the 1st Line - Should be start from 0
Loop
LToken := mcb_simulator_pkg.Split( lstring, i , '|') ;
lvalue := LToken;
IF lcol=1 then
If lvalue='BP-V1' THEN
Dbms_output.put_line('1');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0003','Invalid file type and version number');
Dbms_output.put_line('2');
End if;
Elsif lcol=2 then
If lvalue=To_Char(ldate,'YYYYMMDD') THEN
Dbms_output.put_line('3');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0004','Due date differs from the value inputted in the loading screen');
Dbms_output.put_line('4');
End if;
Elsif lcol=3 then
Begin
Select PAYMENT_PURPOSE_CODE into lpcode
From MU_PURPOSE_CODE
Where PAYMENT_PURPOSE_CODE = lvalue;
IF lpcode = lvalue Then
Dbms_output.put_line('5');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0006','Invalid payment purpose code');
Dbms_output.put_line('6');
End If;
Exception
When No_data_found Then
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0006','Invalid payment purpose code');
End;
Elsif lcol=4 then
If lvalue='1' THEN
Dbms_output.put_line('7');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0008','Total number of debit records in header does not tally with number debit records in the file.');
Dbms_output.put_line('8');
End if;
Elsif lcol=5 then
If lvalue=ltotal THEN
Dbms_output.put_line('9');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0010','Total debit transaction amount in header does not tally with the sum of debit transaction amount in the file');
Dbms_output.put_line('10');
End if;
Elsif lcol=6 then
If lvalue=lno_item THEN
Dbms_output.put_line('11');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0025','Number of credit records does not tally with credit records in the file.');
End if;
Elsif lcol=7 then
If lvalue=ltotal THEN
Dbms_output.put_line('12');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0026','Sum of credit records does not tally with total transaction amount as inputted in the loading screen');
End if;
Elsif lcol=8 then
If lvalue=lcur THEN
Begin
Select Cur_CODE into lCcode
From Mu_currency_Code
Where Cur_CODE = lvalue;
Dbms_output.put_line('13');
Exception
When No_data_found Then--------------------
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0014','Invalid Currency');
End;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0013','Currency differs from the value inputted in the loading screen');
End if;
Elsif lcol=9 then
If lvalue=Null THEN
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0015','Timestamp should not be null');
Elsif lvalue <> lvalue Then
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0046','Timestamp in header should be in the format YYYYMMDDHHMMSS');
End if;
End IF;
EXIT WHEN LToken IS NULL ;
i := i + 1 ;
lcol:=lcol+1;
End LOOP;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (9999,'0002','First line should always start with 0');
End if ;}
-------------------- For the 2nd Line , should be start from 9 .-----------------------------
{ lfirst_char := Substr(lstring,0,1);
IF lfirst_char = '9' Then
LOOP
LToken := mcb_simulator_pkg.Split( lstring, i , '|') ;
lvalue := LToken;
IF lcol=1 then
If lvalue < 0 THEN
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0017','Amount should be greater than zero');
Elsif lvalue = ltotal THEN
Dbms_output.put_line('20');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0018','Transaction amount differs from the value inputted in the loading screen');
End if;
ELSIF lcol = 2 THEN
If lvalue = Substr(lac_no,4,9) THEN
mcb_simulator_pkg.Acct_no_Validator(lvalue,1111,l_ACno_Valid);
mcb_simulator_pkg.Swift_code_validator_for_ac_no(lvalue,1111,l_swift_code_acno);
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0020','Account number differs from the account number inputted in the loading screen');
End if;
ELSIF lcol = 3 THEN
If lvalue is not null THEN
mcb_simulator_pkg.Swift_code_validator_for_other(lvalue,1111,l_swift_code_others);
Else
Dbms_output.put_line('21');
End if;
END IF;
EXIT WHEN LToken IS NULL ;
i := i + 1 ;
lcol:=lcol+1;
End Loop;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (8888,'0016','Second line should start with 9');
End IF; }
-------------------- For the 3rd Line Should be start from 1.--------------------------
{ LOOP
lfirst_char := Substr(lstring,0,1);
IF lfirst_char = '1' Then
Loop
LToken := mcb_simulator_pkg.Split( lstring, i , '|') ;
lvalue := LToken;
IF lcol=1 then
If lvalue > 0 THEN
Dbms_output.put_line('24');
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (1111,'0017','Amount should be greater than zero'); End if;
ELSIF lcol=2 then
Mcb_simulator_pkg.Acct_no_Validator(lvalue,1111,l_ACno_Valid);
Mcb_simulator_pkg.Swift_code_validator_for_ac_no(lvalue,1111,l_swift_code_acno);
ELSIF lcol = 3 THEN
If lvalue is not null THEN
mcb_simulator_pkg.Swift_code_validator_for_other(lvalue,1111,l_swift_code_others);
Else
Dbms_output.put_line('26');
End
END IF;
EXIT WHEN LToken IS NULL ;
i := i + 1 ;
lcol:=lcol+1;
End Loop;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (7777,'0022','The third line onward should start with 1');
End if;
END LOOP;
Commit;
End;}
Edited by: LuKKa on Oct 4, 2010 9:20 PM
Edited by: LuKKa on Oct 4, 2010 9:25 PMYes i gave {} but it is also coming like this ...Yes, since you should use {noformat}{noformat} before and after your example, and not putting your example between a '{' and a '}'.
So, when you post/type/copypaste:
{noformat}select *
from emp;{noformat}
on this forum, it will appear as:select *
from emp;See the FAQ for more tags/tips:
http://forums.oracle.com/forums/help.jspa -
How can i check the procedure execution time..?
Hi All,
Can any one of you tell me how can i check the procedure execution time..?
Thanks in advance.if running it from SQL*Plus,
SQL> set timing on
Or from PL/SQL, use DBMS_UTILITY.GET_TIME before and after the call and calclate the difference. -
While executing the Procedure Getting Error
Hi I am New to ODI.
I create one new Procedure just to delete the Target table.
delete from <%=snpRef.getTable("L","T_CUSTOMER","D")%>. T_Customer is my target table.Technology:Oracle(Both Source and Target)
I selected the correct Context ,Schema and Technology.
While executing the procedure i am getting following error
java.lang.Exception: Internal error: object ConnectConnection
ColConnectId:null
ColContextCode:DEV
ColConName:null
ColIndCommit:null
ColIsolLevel:null
ColLschemaName:null
ColPlanComp:null
ColTechIntName:null
DefConnectId:null
DefContextCode:DEV
DefConName:null
DefIndCommit:null
DefIsolLevel:null
DefLschemaName:FCS
DefPlanComp:null
DefTechIntName:ORACLE
ExeChannel:J
IndErr:1
IndLogMethod:null
IndLogNb:null
LogLevDet:3
Nno:1
OrdTrt:0
ScenTaskNo:1
SessNo:61001
TaskName1:Procedure
TaskName2:Delete
TaskName3:Delete
TaskType:S
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.g.y(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
Thanks in advance.i Used the below syntax and checked its working fine.
delete from <%=snpRef.getObjectName("L","T_CUSTOMER","D")%> -
How to know the User name and date, who executed the report last time.
Hi All,
We are collecting a list of reports which are not executed for past 3 months. Can anybody tell me how to know the username and date they executed the report last time.
Is there any table to look ? or is there any process ?
Thanks,
Ravi.Ravi,
Use SE16 - then look at rszcompdir.
We look up Version = 13 for queries.
Regards
Gill -
Strage behaviour while executing the Procedure
Hi All,
In Schema "Dwr_trade" we have one procedure Proc1. There is another schema
" Dwr_trade_user " this schema has execute privilege on Proc1 of "Dwr_trade" schema.
When we are executing the procedure Proc1 from "Dwr_trade" schema as follows
Dwr_trade --- (Procedure is created here)
Begin
Exec procedure Dwr_trade.Proc1
End;
It gives error ,but when we are executing the same procedure after removing the prefix "Dwr_Trade" it is executing successfully.
when we are executing the procedure from "Dwr_trade_user " then also is working fine.We are executing it as follows.
Dwr_trade_user
Begin
Exec procedure Dwr_trade.Proc1
End;
Any pointer why this is giving error in 1st case.
Many Thanks
DikshitBegin
Exec procedure Dwr_trade.Proc1 <----Isnt Syntax prob
End;
SQL> CREATE OR REPLACE PROCEDURE mypro AS
2 BEGIN
3 null;
4 END;
5 .
SQL> /
Procedure created.
SQL> EXECUTE PROCEDURE mypro;
BEGIN PROCEDURE mypro; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00103: Encountered the symbol "PROCEDURE" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge
<a single-quoted SQL string> pipe
SQL> EXECUTE PROCEDURE scott.mypro;
BEGIN PROCEDURE scott.mypro; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00103: Encountered the symbol "PROCEDURE" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge
<a single-quoted SQL string> pipe
The symbol "PROCEDURE" was ignored.
SQL> EXECUTE mypro;
PL/SQL procedure successfully completed.
SQL> EXECUTE scott.mypro;
PL/SQL procedure successfully completed.Khurram -
am trying to restore my Ipod touch 5 generation but I am receiving an error message that says your Ipod can not be restored you need your password I don't know my password so I don't know what to do. I have started the procedures 3 times but no luck till now
If it is asking for the screen-lock passcode then:
Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
iOS: Wrong passcode results in red disabled screen
If recovery mode does not work try DFU mode.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
For how to restore:
iTunes: Restoring iOS software
To restore from backup see:
iOS: Back up and restore your iOS device with iCloud or iTunes
If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
You can redownload most iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store
If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.
Otherwise follow varjak paw recommendation -
Trigger to execute the procedure
I have a procedure say p1.
I want to create a trigger . the trigger should perform the following
When the procedure throws an exception error , The trigger should execute and call the procedure again
Please help me with codeWhen the procedure throws an exception error , The trigger should execute and call the procedure againAnd when the procedure fails again, the trigger fires, calls the procedure, which fails again which fires the trigger which calls teh procedure which ... You get the picture.
An EXCEPTION is something that ought not to occur. It is literally exceptional. Consequently if you're procedure throws an exception you need to do something different, to handle it. This is a design decision.
If your exception represents a transient condition then your procedure should not throw an exception. Rather it should handle it internally, maybe by sleeping for a second (or whatever is appropriate) and then trying again.
If your exception represents something from which it is not possible for the failing unit to recover then the exception should be passed up the calling stack until it reaches a point where it can be handled. What this level might be depends on the nature of your application.
Cheers, APC -
Gettng Error while executing the procedure(oracle 10.2.0.3.0)
Hi all,
I am getting following error While executing the package .
PLS-00103: Encountered the symbol "Truncate" when expecting one of
the following:
* & = - + ; < / > at in is mod remainder not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or
like LIKE2_ LIKE4_ LIKEC_ between into using || multiset bulk
member SUBMULTISET_I have written follwing query in the package body.
EXECUTE IMMEDIATE 'TRUNCATE TABLE FORT ';
EXECUTE IMMEDIATE '
INSERT INTO FORT (CID,CODE,DESC,SCODE,SES,T_DT,SDN,LANG)
SELECT
SERVICES.CID CID,
PROFILE.FUCODE CODE,
TO_DATE(SUBSTR(SERVICES.STAT_CHNG,-7,6),'YYMMDD') T_DT,
PHOR.NUM SDN,
C_ALL.cLANGUAGE LANG
FROM
SERVICES .....Please give me the solution for this .
Thank y ou
Edited by: user636482 on Apr 10, 2009 1:08 AMI am getting following errors if I gave " ' " after not null.
LINE/COL ERROR
42/8 PLS-00103: Encountered the symbol "AND" when expecting one of the
following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
42/56 PLS-00103: Encountered the symbol "A" when expecting one of the
following:
LINE/COL ERROR
) , * & | = - + < / > at in is mod remainder not rem => ..
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
The symbol ", was inserted before "A" to continue.
42/74 PLS-00103: Encountered the symbol "D" when expecting one of the
following:
* & - + ; / at mod remainder rem return returning
<an exponent (**)> and or || multiset
The symbol "* was inserted before "D" to continue.
LINE/COL ERROR
45/6 PLS-00103: Encountered the symbol "COMMIT"
52/3 PLS-00103: Encountered the symbol "PROCEDURE" when expecting one
of the following:
end not pragma final instantiable order overriding static
member constructor map
The symbol "static" was substituted for "PROCEDURE" to continue.
85/8 PLS-00103: Encountered the symbol "AND" when expecting one of the
following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
LINE/COL ERROR
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
85/56 PLS-00103: Encountered the symbol "A" when expecting one of the
following:
) , * & | = - + < / > at in is mod remainder not rem => ..
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
The symbol ", was inserted before "A" to continue.
LINE/COL ERROR
85/74 PLS-00103: Encountered the symbol "D" when expecting one of the
following:
* & - + ; / at mod remainder rem return returning
<an exponent (**)> and or || multiset
The symbol "* was inserted before "D" to continue.
88/8 PLS-00103: Encountered the symbol "COMMIT"
95/3 PLS-00103: Encountered the symbol "PROCEDURE" when expecting one
of the following:
end not pragma final instantiable order overriding static
LINE/COL ERROR
member constructor map
The symbol "static" was substituted for "PROCEDURE" to continue.
133/3 PLS-00103: Encountered the symbol "PROCEDURE" when expecting one
of the following:
end not pragma final instantiable order overriding static
member constructor map
The symbol "static" was substituted for "PROCEDURE" to continue.
169/3 PLS-00103: Encountered the symbol "PROCEDURE" when expecting one
of the following:with out adding " ' " I am getting the previous error which I mentioned in Previous thread(TRUNCATE)
Thank you -
Error while executing the procedure
Hi,
I tried the following example it's compiled but while executing giving the errors
create or replace PROCEDURE createRZGSet (
rNm IN VARCHAR2,
rDsc IN VARCHAR2,
rId OUT NUMBER
) IS
cId INTEGER;
BEGIN
cId := 1;
SELECT q_id.NEXTVAL
INTO rId
FROM DUAL;
INSERT INTO t_set (rid,
r_nm,
r_dsc,
o_id,
flag) VALUES (rId,rNm,rDsc,cid,'P');
END;
/The above is compiled ... but while executing
SQL> declare
2 optval number;
3 begin
4 execute createRZGSet('myp','miyapur',optval);
5 dbms_output.put_line('val returned is:'||optval);
6 end;
7 /
execute createRZGSet('myp','miyapur',optval);
ERROR at line 4:
ORA-06550: line 4, column 10:
PLS-00103: Encountered the symbol "CREATERZGSet" when expecting one
of the following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "CREATERZGSet" to continue.could you please hint me in this error..
thanxThe above is compiled ... but while executing
SQL> declare
2 optval number;
3 begin
4 execute createRZGSet('myp','miyapur',optval);
5 dbms_output.put_line('val returned is:'||optval);
6 end;
7 /remove the execute key word. it belongs to SQL Plus. in pl/sql you can just give the procedure name thats enought.
SQL> declare
2 optval number;
3 begin
4 createRZGSet('myp','miyapur',optval);
5 dbms_output.put_line('val returned is:'||optval);
6 end;
7 / -
Out of memory error when calling a java stored procedure multiple times
Trying to run a PL/SQL loop calling a java stored procedure, I get the following error:
"ORA-04030: out of process memory when trying to allocate 262188 byte callheap,ioc_allocate free)"
(with some other error lines).
The stored procedure does two major things:
1) Open a socket to communicate with a server, of which it queries some data.
2) Use JDBC (with the default DB connection it has, as a stored procedure) to write the results to a table.
All socket connections, statements, etc. are properly closed and all memory should be garbage collected between each call.
Can anyone offer an explanation or additional checks to make? I'm quite sure the code isn't causing the problem, since I've tried running it as a stand alone application (outside of Oracle) and didn't have any problems.
Thanks.Hi,
Verify that the database parameters are set correctly.
EA -
Getting ORA-06512/ORA-00972 ERROR WHILE EXECUTING THE PROCEDURE????
Hi ,
while executing this procedure , I am getting follwoing errors:
Create or Replace procedure ADD_CUSTOM_INDEX is
INDX_NOT_EXIST Number;
CREATE_SQL_STATMENT VARCHAR2(1500);
ALTER_SQL_STATMENT VARCHAR2(150);
CURSOR C1 IS select INDEX_NAME,CREATE_DDL FROM W_CUSTOM_TEST, WC_COMPANY_G WHERE W_CUSTOM_TEST.SYS_TENANT_ID = WC_COMPANY_G.BU_ID;
BEGIN
for V_ROW in C1 loop
SELECT COUNT(USER_INDEXES.INDEX_NAME) INTO INDX_NOT_EXIST FROM USER_INDEXES WHERE USER_INDEXES.INDEX_NAME = V_ROW.index_name;
IF INDX_NOT_EXIST = 0 THEN
CREATE_SQL_STATMENT := ''|| '"'|| V_ROW.CREATE_DDL ||'"' ||'PARALLEL NOLOGGING';
EXECUTE IMMEDIATE CREATE_SQL_STATMENT;
ALTER_SQL_STATMENT := 'ALTER INDEX ' ||'"'|| V_ROW.INDEX_NAME ||'"'|| ' NOPARALLEL LOGGING';
EXECUTE IMMEDIATE ALTER_SQL_STATMENT;
END IF;
END LOOP;
END ADD_CUSTOM_INDEX;
ERROR at line 1:
ORA-00972: identifier is too long
ORA-06512: at "LOLAP.ADD_CUSTOM_INDEX", line 13
ORA-06512: at line 1.
sturtuce of W_custom_test table is as below:
CREATE TABLE "LOLAP"."W_CUSTOM_TEST"
("INDEX_NAME" VARCHAR2(30) NOT NULL ENABLE,
"SYS_TENANT_ID" VARCHAR2(15) NOT NULL ENABLE,
"CREATE_DDL" VARCHAR2(1200),
"COMMENTS" VARCHAR2(200),
"STAT_CD" VARCHAR2(30) DEFAULT 'Active' NOT NULL ENABLE,
"CREATED" DATE DEFAULT SYSDATE NOT NULL ENABLE,
"LAST_UPD" DATE DEFAULT SYSDATE NOT NULL ENABLE
Any Pointer??????Hi
Instead of giving as below, go for the not null constraints.
"STAT_CD" VARCHAR2(30) DEFAULT 'Active' NOT NULL ENABLE,
"CREATED" DATE DEFAULT SYSDATE NOT NULL ENABLE,
"LAST_UPD" DATE DEFAULT SYSDATE NOT NULL ENABLE
That should help
Regards
Sudheer -
How to execute the procedure in sap b1
Hai to all,
I done a procedure in sql server .but i don't know how to execute that procedure in sap b1?
can anyone help me immediately.
Regards,
Ramya.SDear Ramya.S,
You could execute the store procedure by using Recordset object in SDK DI code. It is like:
Dim myRecordSet As SAPbobsCOM.Recordset
myRecordSet =
SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecord
set)
myRecordSet.Command.Name = "TestStoredProcedure"
myRecordSet.Command.Parameters.Item("@ItemLike").Value = "IT%"
myRecordSet.Command.Parameters.Item(2).Value = "C0001"
myRecordSet.Command.Execute() -
Can you tell me how to execute the procedure?
create or replace get_dob
(ss_number varchar2,dob out date)
as
begin
select birth_dae
into dob
from person
where soc_sec_num=ss_num;
exception when no_data_found
error_notify(ss_num);
end;
the question is that when i want to execute this procedure,how can I use the command?
I try to use the "execute get_dob('wang');"in the sql/plus,but the system give me wrong information.Errors:
1. You left out the word PROCEDURE after CREATE OR REPLACE.
2. You used ss_number in one place and ss_num in two others. These must be the same name.
3. You left out the word THEN after WHEN NO_DATA_FOUND.
Possible errors:
1. Is birth_dae spelled correctly? Or, should it be birth_date?
2. Is error_notify a user-defined procedure?
Additional suggestions:
1. It is better to use table_name.column_name%TYPE instead of specifying NUMBER, VARCHAR2, DATE, etc. for your parameters. That way if the column data types are changed in the future, you don't have to change your code.
2. You will need to SET SERVEROUTPUT ON and use DBMS_OUTPUT.PUT_LINE to display the contents of the variable that holds the value of the out parameter.
3. Please see suggested code for creation of procedure and execution of procedure below. I have included one row of test data so that some output will be displayed. I commented out the exception section, in order to test it, since I don't have your error_notify procedure.
SQL> -- test data:
SQL> CREATE TABLE person
2 (birth_dae DATE,
3 soc_sec_num NUMBER)
4 /
Table created.
SQL> INSERT INTO person
2 VALUES (SYSDATE, '123456789')
3 /
1 row created.
SQL> SELECT * FROM person
2 /
BIRTH_DAE SOC_SEC_NUM
06-DEC-02 123456789
SQL>
SQL>
SQL> -- create procedure:
SQL> CREATE OR REPLACE PROCEDURE get_dob
2 (ss_number IN person.soc_sec_num%TYPE,
3 dob OUT person.birth_dae%TYPE)
4 AS
5 BEGIN
6 SELECT birth_dae
7 INTO dob
8 FROM person
9 WHERE soc_sec_num = ss_number;
10 -- EXCEPTION
11 -- WHEN NO_DATA_FOUND THEN
12 -- error_notify (ss_number);
13 END get_dob;
14 /
Procedure created.
SQL> SHOW ERRORS
No errors.
SQL>
SQL>
SQL> -- execute procedure:
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 v_dob DATE;
3 BEGIN
4 get_dob ('123456789', v_dob);
5 DBMS_OUTPUT.PUT_LINE (v_dob);
6 END;
7 /
06-DEC-02
PL/SQL procedure successfully completed. -
Not able to execute the procedure
Hi everybody,
I am trying to execute a procedure as below,
CREATE OR REPLACE procedure test1(n1 IN number, n2 IN number, tot OUT number)
is
i number := null;
begin
loop
if n2>n1 then
i:=i+1;
tot:=n1+i;
dbms_output.put_line(tot);
elsif n2<n1 then
dbms_output.put_line('Enter a higher value for n2');
end if;
end loop;
end;
All im trying to do is to print the numbers according to the values we give during the runtime, but doesn't seem to work for me.
ie.,
n1=1;
n2=5;
tot = 1,2,3,4,5;
I am sorry if there are some error's in the procedure and would really appreciate if you can help me with this. Thanks in advance for your help.
Edited by: Pravin on 31 Aug, 2010 2:25 PMWhen i run the procedure now,
CREATE OR REPLACE procedure test1(n1 IN number, n2 IN number, tot OUT number)
is
i number := null;
begin
loop
if n2>n1 then
i:=i+1;
tot:=n1+i;
dbms_output.put_line(tot);
elsif n2<n1 then
dbms_output.put_line('Enter a higher value for n1');
end if;
exit;
end loop;
end;
set serveroutput on;
variable tot number;
execute test1(1,4,:tot);
print tot;
Im getting output as,
PL/SQL procedure successfully completed.
tot
Nothing is getting printed now. Any reasons for it. I would like to appreciate everybody's help, by the way. Hope we will find a solution.
Edited by: Pravin on 31 Aug, 2010 2:40 PM
Maybe you are looking for
-
I have windows xp and I am using internet explorer. I am using copper.net dialup. I have tried 3 times, and the same thing happens.
-
Photoshop CC 2014 crashes when I open a file
I'm trying to open a .obj file and Photoshop just keeps crashing every time I open it.
-
How to get network IP camera of images or media ?
Please tell me how to use jmf to get network IP camera of images or media? if you can provide source code, send me please my e-mail: [email protected] thanks!!⊙ω⊙
-
Hi Pls help me in getting the customer opening balance for the customer statment report in R12. any sample query will be very helpful. Regards Yram
-
Can I use static variable in EJB?
Many books suggest developer don't use static variable in EJB,I want to know why? I know there isn't any problem if the static varibale is read only For writable static varible ,what will happen if I use a static Hashtable for share data Help me!Than