-
Hi friends,
can we use multiple sql statements in a procedure?
I trued like this
SQL> create procedure proctab1 (table1 in varchar2,table2 in varchar2)
2 as
3 begin
4 execute immediate
5 'create table ' || table1 || ' (name varchar2(10))' ,
6 'create table ' || table2 || ' (name varchar2(10))';
7 end;
8 /
Warning: Procedure created with compilation errors.
if anybody knows the correct syntax please help me
regards
SrinivasM
-
No, that has to be in two EXECUTE IMMEDIATE statements.
execute immediate 'create table ' || table1 || ' (name varchar2(10))';
execute immediate 'create table ' || table2 || ' (name varchar2(10))';
Jeff Hunter
-
not working
Hi Jeff Hunter,
I tried the way as you said. but even though i am getting copilation errors
i tried like this
SQL> create procedure proctab1 (table1 in varchar2,table2 in varchar2)
2 as
3 begin
4 exceute immediate 'create table ' || table1 || ' (name varchar2(10))';
5 exceute immediate 'create table ' || table2 || ' (name varchar2(10))';
6 end;
7 /
Warning: Procedure created with compilation errors.
and i tried again like this
SQL> create procedure proctab1 (table1 in varchar2,table2 in varchar2)
2 as
3 begin
4 exceute immediate 'create table ' || table1 || ' (name varchar2(10))'; ,
5 exceute immediate 'create table ' || table2 || ' (name varchar2(10))';
6 end;
7 /
Warning: Procedure created with compilation errors.
help me
SrinivasM
-
sorry Jeff Hunter its working
HI Jeff Hunter,
thank you its working fine
regards
SrinivasM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|