Topic
  • 1 reply
  • Latest Post - ‏2013-07-02T05:20:11Z by B.Hauser
Junius
Junius
20 Posts

Pinned topic Using a Global Temporary Table in RPG

‏2013-07-01T17:32:49Z |

I'm trying to create and use a global temporary table in RPG IV.  The compiler has no problem with my DECLARE statement, but when I try to reference it in the following SQL UPDATE statement, the compiler complains about not having any column definitions (SQL1103).  The temporary table is created using the "AS" clause.

Do I need to change the DECLARE......AS (SELECT....) WITH DATA to a regular DECLARE with column definitions followed by an INSERT statement (to load the table)?  Or, since the table is not externally described, do I need to describe it internally (in the RPG program)? 

Thanks,

Jay

PS.  since this compiler message is just a level 10 warning, I don't have to change anything for it to compile.  I'm just curious about possible solutions.

 

Updated on 2013-07-01T17:56:45Z at 2013-07-01T17:56:45Z by Junius
  • B.Hauser
    B.Hauser
    272 Posts

    Re: Using a Global Temporary Table in RPG

    ‏2013-07-02T05:20:11Z  

    This warning is sent out since the temporary table does not exist at compile time and consequently cannot be checked at compile time.

    Nevertheless the program will be generated and can be run.

    If an error occurs at runtime an apporiate SQLCODE or SQLSTATE is returned that can be checked.

    Birgitta