cancel
Showing results for 
Search instead for 
Did you mean: 

How to Load table from client file in C?

Former Member
0 Kudos

Hi all,

I'm trying to determine how to write a C program to load a client file with the "load table ... using client file..." syntax without calling out to the dbisql program to load the table.  I'm probably not seeing the forest for the trees here.  I know I can use the bulk api (equivalent of bcp) but would rather use the load table because it is much faster.

jason

Accepted Solutions (1)

Accepted Solutions (1)

JasonHinsperger
Advisor
Advisor
0 Kudos

Whats your question?  You should be able to do what you want.  The LOAD TABLE statement is not DBISQL specific, so you can execute it from any SQLA DB interface.

--Jason

Former Member
0 Kudos

Thanks Jason,

I guess my question is this:  Do I have to do anything in my C program to allow for the load table from client file? 

On a side note, is there a connect option or similar to disallow the load table from client file (even if the load table from client file permission is granted on the server)?

jason

JasonHinsperger
Advisor
Advisor
0 Kudos

There is nothing special to do - you execute the statement from your program just like any other SQL statement.  The only thing to be aware of are the privilege/permission issues:

When loading from a file on a client computer:

  • READ CLIENT FILE privilege is also required for the database user.
  • Read privileges are required on the directory being read from.
  • The allow_read_client_file database option must be enabled.
  • The read_client_file secure feature must be enabled.

Revoking these privileges is also the only way you can prevent a user from executing the statement.

Former Member
0 Kudos

thanks again Jason.  I thought the read_client_file secure feature was optional but preferred.

Answers (0)