Home » RDBMS Server » Server Administration » How to generate the sql scripts??
How to generate the sql scripts?? [message #162896] Tue, 14 March 2006 00:49 Go to next message
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 #162931 is a reply to message #162896] Tue, 14 March 2006 03:51 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>> But I want to generate the script for records also.
What do you mean by that?
insert statements?
Why are you doing this?
Re: How to generate the sql scripts?? [message #162933 is a reply to message #162931] Tue, 14 March 2006 03:56 Go to previous messageGo to next message
loveoracle
Messages: 41
Registered: February 2006
Location: Mumbai
Member

Hi Mahesh,

Now my article table contains 50 records.
I Client requested me that they want the table creation script
and insert record screpts.
That's why I want this.
Please help.

Thanks in advance,
Prathamesh.
Re: How to generate the sql scripts?? [message #162960 is a reply to message #162933] Tue, 14 March 2006 06:14 Go to previous message
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');
Previous Topic: about spfile
Next Topic: What's the difference between sys and system ?
Goto Forum:
  


Current Time: Fri Jan 10 17:00:09 CST 2025