Unix Technical Forum

bulk insert to IDS 10 DB via UNIXODBC C program fails

This is a discussion on bulk insert to IDS 10 DB via UNIXODBC C program fails within the Informix forums, part of the Database Server Software category; --> The code copied below throws this error (val of ret is -2 >--- ERROR -- RC = 0 Reported ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 12:45 PM
kjuliff@gmail.com
 
Posts: n/a
Default 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);

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com