Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SQLDA setup for use with the OPEN Statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLDA setup for use with the OPEN Statement

    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
    Code

  • #2
    SQLDA setup for use with the OPEN Statement

    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.
    Code

    Comment


    • #3
      SQLDA setup for use with the OPEN Statement

      I cannot see something wrong with the code. Perhaps those two lines may be changed a little:
      eval sqllen = %size( sitno )
      eval sqldata = %addr(sritnod)
      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

      Comment


      • #4
        SQLDA setup for use with the OPEN Statement

        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??

        Comment


        • #5
          SQLDA setup for use with the OPEN Statement

          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

          Comment

          Working...
          X