View Full Version : SQLDA setup for use with the OPEN Statement
coteijgeler@chello.nl
11-13-2005, 11:49 PM
Not a working sample, but some snippets and reminders. For each value to pass (your parameter marker you have to fill an SQL_VAR element in the array (DIM is just example). Use DS SQLVAR for this. SQLTYPE should have an integer value for each data type. The SQLLEN is the length of the used host variable, except for packed and zoned fields; those have the value (256 * number of digits) + number of decimals. A packed field, defined as 30 9 (9 decimals) get the length of: (256 * 30) + 9. SQLDATA gets the address of the host variable the value is stored. See the SQL Reference Manual, appendix C. Hopes this help. Regards, Carel Teijgeler <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b30ccc2/0')
Guest.Visitor
11-14-2005, 12:33 PM
Please take a look at the attached code and tell me what I'm missing. My Cursor opens, I just don't receive any data. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6b30ccc2/2')
coteijgeler@chello.nl
11-14-2005, 09:19 PM
I cannot see something wrong with the code. Perhaps those two lines may be changed a little: <center> eval sqllen = %size( sitno ) </center><center> eval sqldata = %addr(sritnod) </center> I would make SQLLEN = %size(sritnod), the host variable you are using. After the OPEN clause test the SQLCOD and/or SQLSTAT values. Perhaps they may give an indication what went wrong. Saw your question on another forum as well,. There you gave the SQL statement. If you have two parameter markers in an SQL statement you should give two entries in the SQLDA with correct data (according to datat type). So the test on #itno should be removed. Regards, Carel Teijgeler
Guest.Visitor
11-15-2005, 10:21 AM
I'm trying to set up the SQLDA for use on the OPEN statement using a DESCRIPTOR (which I want to contain my host variables parameter markers). Does anyone have a working example??
Guest.Visitor
11-15-2005, 10:21 AM
SQLSTT = 0 SQLCOD = 0 The follow Fetch Statement Yielded no records: FETCH NEXT FROM TAGCSR INTO :stitno, :stwhse, :stitcl, :stitsc :stitd1, :stitd2, :stlpr1, :ststcs, :stmxo1, :stohq1, :stpoq1, :stunm1, :stmno1
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.