Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"USING CLIENT FILE" not supported in sqlanywhere #48

Open
swapson opened this issue Jul 18, 2022 · 0 comments
Open

"USING CLIENT FILE" not supported in sqlanywhere #48

swapson opened this issue Jul 18, 2022 · 0 comments

Comments

@swapson
Copy link

swapson commented Jul 18, 2022

Hi,

I am trying upload client file in Sybase IQ, internally the procedure uses "USING CLIENT FILE" for directly loading file from client machine to database. but sqlanywhere is failing due to file permissions issue.

  1. Is this feature supported by sqlanywhere nodejs dependecy like java sajdbc.jar dependency ?
  2. If yes, could you please help me to configure nodejs sqlanywhere db connection with appropriate file permission?

Error
[Error: Code: -500001 Msg: RAISERROR executed: Error - Unable to load #temp_stats table & sql error code = -6 & Error Message = Operation failed on file due to file permissions. File: /mnt/d/workspaceNodeJS/fileuploadTest2/data/file.csv
-- (oslib/hos_clientfileio.cxx]

in java same thing is possible using callback

  1. sajdbc.jar & supporting DLL or *.so files

class T_filetrans_callback implements sap.jdbc4.sqlanywhere.SAValidateFileTransferCallback
{
T_filetrans_callback()
{
}

public int callback(String filename, int is_write)
{
    System.out.println( "File transfer granted for file " + filename +                          
                        " with an is_write value of " + is_write );                         
    return( 1 ); // 0 to disallow, non-zero to allow
}

}

// create and register validate file transfer callback
con = connect();
T_filetrans_callback filetran_worker = new T_filetrans_callback();
((sap.jdbc4.sqlanywhere.IConnection)con).setSAValidateFileTransferCallback( filetran_worker );

Java callback details : https://130.214.205.8/index.html#sqla170/en/html/3bd590f46c5f1014a6ebdf8646d9a523.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant