I have a database called A2018
and three tables for testing SQL code: ALT, ALT1, ALT2.
So I am running this:
SELECT /*insert*/* FROM ALT;
This is the output I get:
REM INSERTING into ALT
SET DEFINE OFF;
Insert into ALT (ENA,DYO) values ('2','3');
Insert into ALT (ENA,DYO) values ('1','2');
So this only for one table and my question is how to achieve this output with all tables in a single sentence without doing it separate for each table like the output I get when exporting database from Tools.
This is what i am trying to achieve:
set echo off
set pagesize 0
set long 90000
SPOOL C:\Export15.sql;
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
FROM USER_TABLES u;
SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name)
FROM USER_INDEXES u;
SELECT DBMS_METADATA.GET_DDL('CONSTRAINT',u.constraint_name)
FROM USER_CONSTRAINTS u;
select /*insert*/* from ALT ;--I WANT IT FOR ALL TABLES IN DATABASE AND NOT ONE BY ONE
SPOOL OFF;