cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to insert binary data using vc++

Former Member
0 Likes
6,723

Hello,

I am an engineering student working on a project in which sql anywhere will works as a back-end database. I have faced a problem to insert binary data into tables using

FUNC_INFO( extern, void, esqlentry, dbpp_execute_imm, (SQLCA ,char ,unsigned short int ))

I also try to run FUNC_INFO( extern, void, esqlentry, dbpp_prepare, (SQLCA ,char ,char ,short int ,char ,struct sqlda ,unsigned int )), but fails because there is no documentation found on net about these functions.

Please guide me, I am waiting for a reply.

Thanks

View Entire Topic
johnsmirnios
Product and Topic Expert
Product and Topic Expert

The dbpp_* entry points are for use by ESQL programs and calls to them are generated by the ESQL preprocessor: sqlpp. Users are not supposed to write code to call these functions directly. See http://dcx.sybase.com/index.html#1201/en/dbprogramming/pg-esql.html for information on using ESQL.

BTW, are you required to use ESQL for your project? Possibly you could use ODBC, .NET, or perhaps even a scripting language such as python or perl?

Former Member
0 Likes

Hello john, Thanks for your reply................. Actually I need to use Embedded SQL because of my project requirement and I am using dblib.dll for this purpose. I need to insert data in Long Binary type field of SQL AnyWhere table . I need to use parametrized query for this and I have used functions of dblib.dll to insert data in table, but I have header file containing function declaration , so I am unable to implement the function to prepare statement using dblib.dll. Following is prototype of function:

FUNC_INFO( extern, void, esqlentry, dbpp_prepare, (SQLCA ,char ,char ,short int ,char ,struct sqlda ,unsigned int ))

I could not get any documentation describing the parameters of this function . How can I prepare a statement using functions of this dll and Execute it to insert binary data.

Please help me out as I am new to this Embedded SQL concept....

Waiting for positive response...............

Thanks Amit Chauhan

ian_mchardy
Product and Topic Expert
Product and Topic Expert
0 Likes

When developing with Embedded SQL, you write C/C++ source usually as a .sqc file that has embedded 'EXEC SQL ...' statements to actually connect and interact with the database server. Then you preprocess your .sqc to a .c file using sqlpp (this changes the EXEC SQL ... statements to call the internal dbpp_... functions). Then you compile the .c file as usual. Please read the dcx documentation link that John posted.