vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| There is demo job $INFORMIXDIR/demo/cli/blkinsrt.c (also blkinsrtW.c Unicode version) ..Have a look if this can be of any help ...beside there is INSERT CURSOR functionality in IBM Informix ODBC Driver which can be used for such bulk inserts ..which will give you better performance than the usual insert ...For more info refer ODBC Programmer's Manual. Let me know if you are looking for sample testcase for INSERT CURSOR functionality. However In your below code snippet I think you should be using SQLBindParameter and not SQLBindCol as you are inserting data and not fetching it. Thanks -Shesh "kjuliff@gmail.com" <kjuliff@gmail.com> Sent by: informix-list-bounces@iiug.org 08/07/2006 07:18 PM To informix-list@iiug.org cc Subject bulk insert to IDS 10 DB via UNIXODBC C program fails The code copied below throws this error (val of ret is -2 >--- ERROR -- RC = 0 Reported from insertpic.c, line 111 ------------ Total Number of diagnostic records: 0) I'm trying to do a bulk insert. column1 and column2 are both char [20][50] I can loop through these arrays and see their are values in them. The columns I'm trying to insert into are both char 16. rowcnt is 20. I could probably work it out if I had an example, but I cannot find one. I hope someone can help me, Kate code snippet ret = SQLSetStmtAttr(hstmt, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)rowcnt, SQL_IS_I NTEGER); ret = SQLBindCol( hstmt, 1, SQL_C_CHAR, column1, sizeof( column1[ 0 ] ), indicat or1 ); ret = SQLBindCol( hstmt, 2, SQL_C_CHAR, column2, sizeof( column2[ 0 ] ), indicat or2 ); printf("in insertpic\n"); ret = SQLExecDirect(hstmt, "INSERT INTO stk2 (stock, comp) VALUES(?,? )", SQL_NT S); printf("val of ret is %d\n",ret); _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list |
| Thread Tools | |
| Display Modes | |
|
|