cancel
Showing results for 
Search instead for 
Did you mean: 

Loader cli

Former Member
0 Kudos

Hi

I have problems using the java API of the loader cli. I want to import content from a file into a table in a database of an other host.

Connecting to the database is not the problem, but reading from the file. The relevant command looks like

IMPORT TABLE testImportTable DATA INSTREAM FILE 'testImport.csv'

I get always the following error-message:

Error opening file 'testImport.csv': OS error: 'No such file or directory'

I tried many other filenames, like C:\testImport.csv, the error-message is alway the same, and of course, the file does exist on the pc, where this java-client is working. Is there any other reason, why this error-message appear, than the obvious?

Where (which directory) does the loader search for the testImport.csv?

Do I have to set the destination directory in any way?

Maybe, does the loader search for the file on the host of the database, on which it is connected?

I tried an export to find the destination directory myself, but this doesn' t work, too:

EXPORT TABLE testImportTable DATA OUTSTREAM FILE 'testExport.csv'

Everytime I tried this, I got the following error-message:

Error opening file 'testExport.csv': OS error: 'Permission denied'

The Operation system of my applications is windows xp. I do not know whether this is important.

If someone has any idea what the problem might be. Please tell me( and sry for the bad english^^)

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi there,

since I've used loadercli some times sucessfully, I doubt that this is a bug in the loadercli.

Instead I'm rather sure that the error messages from Windows API are correct.

An easy way to figure this out would be to use ProcMon from the Sysinternals-Suite and check what file paths are really used for the open file calls.

regards.

Lars

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

I finally found out, what went wrong^. Instead of calling

Loader.dbLoader(null, null)
to get the loaderInstance, I filled the parameters with the destination host and database. Therefore (I think), the loader tried to do all the fileoperations on that host and that was not possible^.

However, now it works fine^^

Best regards

mmAlex

Former Member
0 Kudos

Hi

thanks for the help. I used that Windows Process Monitor, but there was nothing to see, it seems like the loader didn't try to open any file that looks like testImport.csv.

I used the loader cli direct from command line without using java classes. It worked. Maybe, the error-messages from the java-api are misleading. Can it be, the java-api wasn't able to access to the loader-cli-program, because I missed to configure something somewhere?

PS: a file named loader.log doesn't exist on my computer^^

steffen_schildberg
Active Participant
0 Kudos

Hi,

would you mind to check for the log file loader.log on your machine. May be there is a hint what exactly went wrong. Usually if given an absolute path the Loader uses it, in case a relative path is given or a file name only the Loader tries to find it relative to the path where it started from. Have you tried using the Loader from a command prompt?

Regards,

Steffen