Re: DML [message #370954] |
Mon, 13 March 2000 19:38 |
Amit Chauhan
Messages: 74 Registered: July 1999
|
Member |
|
|
Hi,
TRy this script. Its a crude one, but it works !!. Just cut-paste the content between <<<<<< FILE A THE SQL THAT AND RUN IN PUT PROMPT.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
undef table_name
accept table_name prompt 'Enter table Name :'
set serverout on size 20000
set head off
set feedback off
set verify off
set pages 0
spool a.sql
declare
cursor c is
select column_name from user_tab_columns
where table_name = upper('&&table_name');
str1 varchar2(2000) := null;
str2 varchar2(2000) := null;
str3 varchar2(2000) := null;
str4 varchar2(2000) := null;
i number := 0;
begin
for cur_rec in c loop
i := i+1;
if (i = 1) then
str1 := cur_rec.column_name;
str2 := chr(39)||'||'||cur_rec.column_name||'||'||chr(39);
else
str1 := str1||','||cur_rec.column_name;
str2 := str2||','||chr(39)||'||'||cur_rec.column_name||'||'||chr(39);
end if;
end loop;
s
|
|
|