Skip to content

Commit bd2feee

Browse files
authored
Update script.sql
1 parent 35f3811 commit bd2feee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎script.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ create or replace directory temp_dir as 'C:\temp';
115115
/
116116
grant read, write on directory temp_dir to PUBLIC
117117
/
118-
119-
-- Start migration
118+
119+
120+
-- Start migration
120121
DECLARE
121122
cur SYS_REFCURSOR;
122123
curid NUMBER;
@@ -142,7 +143,7 @@ BEGIN
142143
FROM MIGRATION_TABELS_LIST
143144
ORDER BY TABLE_NAME)
144145
LOOP
145-
OPEN cur FOR 'SELECT * FROM '||rec.TABLE_NAME||' ORDER BY 1';
146+
OPEN cur FOR 'SELECT * FROM '||rec.TABLE_NAME||' WHERE rownum <= 5000';
146147
DBMS_OUTPUT.put_line('Working on table:' ||rec.TABLE_NAME);
147148

148149

@@ -193,15 +194,15 @@ BEGIN
193194
ELSIF (desctab (indx).col_type = 12)
194195
THEN
195196
DBMS_SQL.COLUMN_VALUE (curid, indx, datevar);
196-
out_values := out_values||
197-
'to_date('''||to_char(datevar,'DD.MM.YYYY HH24:MI:SS')||
198-
''',''DD.MM.YYYY HH24:MI:SS''),';
197+
out_values := out_values|| ''''||
198+
to_char(datevar,'YYYY-MM-DD HH24:MI:SS')||
199+
''',';
199200
END IF;
200201
END LOOP;
201202
DBMS_OUTPUT.put_line(out_columns||rtrim(out_values,',')||');');
202203
-- create new file for each 2M record
203204
-- write to file with name
204-
if mod ( total_row_fetched, 2 ) = 0 then
205+
if mod ( total_row_fetched, 2000 ) = 0 then
205206
/* close old file, open new */
206207
-- if file open close it
207208
if SYS.UTL_FILE.IS_OPEN(fHandle)then
@@ -236,4 +237,3 @@ END;
236237
/
237238

238239

239-

0 commit comments

Comments
 (0)