Skip to main content

Problem:

Release 4.0:

Below is a snippet of code produced by the OpenESQL Assistant. Some lines of code are included beginning with 'MOVE..'....but seem to have have been inserted incorrectly and should not be there:

EXEC SQL

             DECLARE CSR12 CURSOR FOR SELECT

                     "A"."T$CONO"

                   ,"A"."T$PTYP"

                   ,"A"."T$YEAR"

                   ,"A"."T$PRNO"

                   ,"A"."T$DTYP"

                   ,"A"."T$DIMX"

                   ,"A"."T$LEAC"

                   ,"A"."T$FDAH"

                   ,"A"."T$FCAH"

               FROM "BAAN_RO_S"."TTFGLD202210" A

            END-EXEC

            EXEC SQL  OPEN CSR12 END-EXEC

            PERFORM UNTIL SQLSTATE >= "02000"

              EXEC SQL

              FETCH CSR12 INTO

                  :TTFGLD202210-001

                 ,:TTFGLD202210-002

                 ,:TTFGLD202210-003

                 ,:TTFGLD202210-004

                 ,:TTFGLD202210-005

                 ,:TTFGLD202210-006

                 ,:TTFGLD202210-007

                 ,:TTFGLD202210-011

                 ,:TTFGLD202210-012

              END-EXEC

               MOVE SQLSTATE TO LNK-SQLSTATUS

              *> Process data from FETCH

              IF SQLSTATE < "02000"

              *> for array fetches, field sqlerrd(3) contains the number

              *> of rows returned

                  PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > SQLERRD(3)

?                 MOVE TTFGLD202210-001(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-002(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-003(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-004(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-005(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-006(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-007(IDX) TO LNKA-009(IDX)

?                MOVE TTFGLD202210-011(IDX) TO LNKA-009(IDX)

?                 MOVE TTFGLD202210-012(IDX) TO LNKA-009(IDX)

                 END-PERFORM

               END-IF

            END-PERFORM

            EXEC SQL  CLOSE CSR12 END-EXEC

Resolution:

You should check your settings in the OpenESQL Assistant:

Net Express IDE -> Options -> Embedded SQL... -> OpenESQL Assistant Configuration options

-> under 'Query Options' the checkbox 'Generate Interface code' should be empty to prevent  the code you see above.

Aattached is a snapshot of the 'OpenESQLSetting'.

At the time this article was created  if you have checked this box it means that you would generate code to be used in a webservice environment.

Attachments:

OpenESQLSetting.jpg

Old KB# 4270