ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Using VARCHAR host variables in embedded SQL

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

  • Using VARCHAR host variables in embedded SQL

    Hello, I am currently working on a COBOL mainframe to Iseries conversion. I am running into problems with VARCHAR fields in the DCLGENS. The programs are blowing up with SQLCODE -412 when using VARCHAR fields on the FETCH. Any comments or suggestions would be greatly appreciated.

    PS. I have already tried the PROCESS VARCHAR statement, no help.

  • #2
    Re: Using VARCHAR host variables in embedded SQL

    To correct the error code -412 you must define the level 49 field you are using on the FETCH statement. You cannot use the high level field name (which includes the field length and the character elements of the VARCHAR field). You can use the high level field on the SELECT statement.

    Comment

    Working...
    X