Home » RDBMS Server » Server Administration » Re: DML
Re: DML [message #370954] Mon, 13 March 2000 19:38
Amit Chauhan
Messages: 74
Registered: July 1999
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
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;
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);
str1 := str1||','||cur_rec.column_name;
str2 := str2||','||chr(39)||'||'||cur_rec.column_name||'||'||chr(39);
end if;
end loop;

Previous Topic: dbms_shared_pool command
Next Topic: Re: Add on...DML
Goto Forum:

Current Time: Tue Oct 20 10:17:42 CDT 2020