How to generate the sql scripts?? [message #162896] |
Tue, 14 March 2006 00:49 |
loveoracle
Messages: 41 Registered: February 2006 Location: Mumbai
|
Member |
|
|
Dear All,
My Table structure is as follows;
*********************************
SQL> desc articles
Name Type Nullable Default Comments
--------------- ------------- -------- ------- --------
ARTICLEID NUMBER
SHOWONHOMEPAGE CHAR(1) Y 'y'
TITLE VARCHAR2(400) Y
CONTENT BLOB Y
PUBLISHINGDATE DATE Y sysdate
URL VARCHAR2(200) Y
REFERENCE BLOB Y
AUTHOR VARCHAR2(200) Y
ABOUTAUTHOR BLOB Y
ACKNOWLEDGMENTS BLOB Y
REMARKS VARCHAR2(500) Y
CREATEDBY NUMBER Y
CREATEDDATE DATE Y sysdate
MODIFIEDBY NUMBER Y
MODIFIEDDATE DATE Y
DELETED CHAR(1) Y 'n'
DUMMY VARCHAR2(100) Y
BRIEF BLOB Y
PRIORTY NUMBER Y 1
CATEGORYID NUMBER Y 0
KEYWORDS VARCHAR2(100) Y
APPROVE CHAR(1) Y 'y'
FILEPATH VARCHAR2(300) Y
SHOWASWHATSNEW CHAR(1) Y 'n'
Table contains 50 records.
I want to generate a sql scripts for this table.
With dbms_metadata I generate the sql script for table structure.
But I want to generate the script for records also.
the contains blob columns.
Any one could me tell how to generate the scripts for blob column.
Thanks in advance.
|
|
|
|
|
Re: How to generate the sql scripts?? [message #162960 is a reply to message #162933] |
Tue, 14 March 2006 06:14 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
Something like this? This not a good solution ( Since you can unload data and load it with sql*loader or just use export / import ). Why would someone need insert statements for data that already exists inside an oracle table?
scott@9i > select 'insert into dept values ('||deptno||','''||dname||''','''||loc||''');' from dept;
'INSERTINTODEPTVALUES('||DEPTNO||','''||DNAME||''','''||LOC||''');'
----------------------------------------------------------------------------------------------------
insert into dept values (10,'ACCOUNTING','NEW YORK');
insert into dept values (20,'RESEARCH','DALLAS');
insert into dept values (30,'SALES','CHICAGO');
insert into dept values (40,'OPERATIONS','BOSTON');
|
|
|