Error with SQL

Tags:
AS/400
RPGLE
SQL
I am trying to use a SQL statement in an RPGLE program to select a group of records. I have verified that all of the files used in my SQL statement is in the file. I keep getting the errorsSQLCOD=-000000206 SQLSTATE = 42703.
Here is my statement:
C/EXEC SQL + DECLARE C1 CURSOR FOR
C + SELECT WOCSCD, WOOWHS, WOCSOD, WOSTAT. WOODDT, WODTLR, WOCNCL
C+ FROM WOMSTl12
C+ WHERE WOWHS = :WHS and
C+ WOCSCD = :CUST and
C+ WOCNCL <> 'C' AND
C+ WOSTAT <> 'S'
C/END-EXEC
C* /EXEC SQL
C+ OPEN C1
C /END-EXEC
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

it looks like a typo in the second column name in your select. Is there an extra “o”.

in you where clause there is only one. WOOWHS vs WOWHS. 

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Splat
    The error message (SQL0206 in QSQLMSG) reads Column or global variable &1 not found.

    You might want to verify the column names for that table.

    (A listing of SQLCOD and SQLSTATE codes can be found here.)
    12,895 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: