cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Pagination through impex export

former_member637004
Discoverer
0 Likes
1,200

Hi all,

I'm trying to export batches of records through the pagination query. When i execute the query through flexible search it is working, but getting an error during Impex Export. I want to export similar data from Production from a table which has 2 million records

FlexibleSearch query which is working fine-

select {c:pk} from {b2bcustomer as c} ORDER BY {c:PK} ASC LIMIT 1000 OFFSET 0

Impex export script which is throwing error - Caused by: bsh.TargetError: Sourced file: inline evaluation of: ``impex.exportItemsFlexibleSearch ("select {c:pk} from {b2bcustomer as c} ORDER BY . . . '' : Method Invocation impex.exportItemsFlexibleSearch

"#% impex.setTargetFile( ""test.csv"");"
insert b2bcustomer;uid;name
"#% impex.exportItemsFlexibleSearch (""select {c:pk} from {b2bcustomer as c} ORDER BY {c:PK} ASC LIMIT 1000 OFFSET 0"");"
View Entire Topic
aimprosoft
Participant

hi NagaSrinivas Chitirala,

I'd suggest you another solution: try to split items you are trying to export by creationTime

i.e. (oracle version):

"#% impex.setTargetFile( ""export.csv"");"
insert_update b2bcustomer;uid;name
"#% impex.exportItemsFlexibleSearch (""select {pk} from {b2bcustomer} where {creationtime} > TO_DATE('2019-09-20', 'YYYY/MM/DD')"");"

Hope this helps.

Regards,

Igor.