Originally posted by Soldout
Hi I´m new to oracle!
I need some help!
I look for a way to export the, content of my oracle tables, in DLL format.
insert into table values ('....,...');
I only know the exp, imp tool, but this is no right readable DDL;
thanks for your answer
The only way I know of to do this is tro write your own SQL statement like this:
SELECT 'INSERT INTO tab (id, name, start_date) VALUES ('
|| id || ',''' || name || ''', TO_DATE( '''
|| TO_CHAR( start_date, 'YYYYMMDDHH24MISS' )
|| ''', ''YYYYMMDDHH24MISS'')'
I have used an example of a NUMBER, VARCHAR2 and DATE column to show how you would need to handle these. The method is:
Just concatenate the value: || id ||
Enclose the value in quotes - need to double up embedded quotes:
|| '''' || name || ''''
Need to convert to VARCHAR2 in a format that will not lose any time information, and then tell the insert statement to convert back to a DATE using the same format:
|| 'TO_DATE(''' || TO_CHAR(start_date,'YYYYMMDDHH24MISS') || ''',''YYYYMMDDHH24MISS'')'
To run this in SQL Plus you would need to:
SET LINESIZE <large enough>
SET PAGESIZE 0