cancel
Showing results for 
Search instead for 
Did you mean: 

How to use READ_CLIENT_FILE() in real life ?

Former Member
3,465

I write a procedure that read an xml file on a client computer, parse with OPENXML() and insert the data. The database option allow_read_client_file is set to On for the user. The READCLIENTFILE authority is set for the group. The server start with -sf -read_client_file parameter.

All work fine in Interactive SQL but in the client application with a standard user, not a DBA, I get a message : "the client application don't allow the transfer".

I have see that the client application have to register a callback function but I don't found any informations on this function.

We use ADO.NET and ODBC client with SQLA 11 & 12.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

With the doc topic pointed by Volker I have found a workaround that can work for all client interface :

1) I Create a variable at the connection level @SIFXML with the long binary Data type.

2) First populate the Variable with a SELECT READ_CLIENT_FILE(ClientFilePath) INTO @SIFXML;
This is a direct call not supported in the procedure call.

3) Call the parsing and loading procedure with a little change :

CREATE PROCEDURE "EASYCOM"."EASYCAT_PARSING"()
BEGIN ATOMIC
DECLARE _CAT CHAR(6 CHAR);
DECLARE _XML XML;
IF @SIFXML IS NOT NULL THEN
SELECT CAST(@SIFXML AS XML) INTO _XML;
IF _XML IS NOT NULL THEN
SET @SIFXML = NULL;
...
parsing ans loading code ...
ENDIF;
ENDIF;
ENDIF;
END;