@@ -115,8 +115,9 @@ create or replace directory temp_dir as 'C:\temp';
115
115
/
116
116
grant read, write on directory temp_dir to PUBLIC
117
117
/
118
-
119
- -- Start migration
118
+
119
+
120
+ -- Start migration
120
121
DECLARE
121
122
cur SYS_REFCURSOR;
122
123
curid NUMBER ;
@@ -142,7 +143,7 @@ BEGIN
142
143
FROM MIGRATION_TABELS_LIST
143
144
ORDER BY TABLE_NAME)
144
145
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 ' ;
146
147
DBMS_OUTPUT .put_line (' Working on table:' || rec .TABLE_NAME );
147
148
148
149
@@ -193,15 +194,15 @@ BEGIN
193
194
ELSIF (desctab (indx).col_type = 12 )
194
195
THEN
195
196
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
+ ' ' ' ,' ;
199
200
END IF;
200
201
END LOOP;
201
202
DBMS_OUTPUT .put_line (out_columns|| rtrim(out_values,' ,' )|| ' );' );
202
203
-- create new file for each 2M record
203
204
-- write to file with name
204
- if mod ( total_row_fetched, 2 ) = 0 then
205
+ if mod ( total_row_fetched, 2000 ) = 0 then
205
206
/* close old file, open new */
206
207
-- if file open close it
207
208
if SYS .UTL_FILE .IS_OPEN(fHandle)then
236
237
/
237
238
238
239
239
-
0 commit comments