Dear Team,
I have bulk csdbe dataset in around few hundred files to upload csweb for this I use following code
list string dataFile;
dirlist(dataFile, ".\data\", filter := "*.csdbe", recursive := true);
do numeric ctr = 1 while ctr <= dataFile.length()
if setfile(DATA_DICT,dataFile(ctr)+"|password=1234")=1 then
if syncconnect(CSWeb, "http://10.10.10.10/api","user","1234") then
syncdata(PUT, DATA_DICT);
endif;
endif;
enddo;
Its not working can give me a clue to resolve this issue, also Is it possible to load data to "dirlist" batch wise
Bulk data Sync
-
- Posts: 238
- Joined: November 21st, 2022, 4:41 pm
Re: Bulk data Sync
Hello,
Are you getting an error message when this does not work? If so, please provide it, and any error logs like your sync.log file. If not, try adding "else" statements to your "if" statements, in order to give out error messages when one of them is not true. You can also do this with an "if" statement for syncdata. This way you will get an error message that tells you if your problem is with syncdata, syncconnect, or setfile. You can also use error messages to print out the dirlist while you loop, and make sure the dirlist you are getting is what you expected. Use these to debug your code.
For your other question on how to load data to "dirlist" batch wise, see the documentation on DirList. It can get the files and directories from a path and list them into the provided List, but it doesn't load data. LoadCase loads the data of a case to your current dictionary, but that means that multiple cases of the same dictionary cannot be loaded at once. To perform an operation as a batch on all data, see Batch Applications. If you need something else, please let us know.
Hope this helps,
Justin
Are you getting an error message when this does not work? If so, please provide it, and any error logs like your sync.log file. If not, try adding "else" statements to your "if" statements, in order to give out error messages when one of them is not true. You can also do this with an "if" statement for syncdata. This way you will get an error message that tells you if your problem is with syncdata, syncconnect, or setfile. You can also use error messages to print out the dirlist while you loop, and make sure the dirlist you are getting is what you expected. Use these to debug your code.
For your other question on how to load data to "dirlist" batch wise, see the documentation on DirList. It can get the files and directories from a path and list them into the provided List, but it doesn't load data. LoadCase loads the data of a case to your current dictionary, but that means that multiple cases of the same dictionary cannot be loaded at once. To perform an operation as a batch on all data, see Batch Applications. If you need something else, please let us know.
Hope this helps,
Justin