13.10 Things That May Be Different

SQL and ODBC do not handle all of  their table operations in the same manner as file operations on the IBM i. Here are some important points which you should be aware of:

         SELECT FIELDS(#A #B #C) FROM_FILE(...)

                WHERE(...............)

            .......

            .......

         ENDSELECT

 

they have a predictable and consistent value within the loop across all platforms.   They do not have predictable and consistent values outside the loop. So:

         SELECT FIELDS(#A #B #C) FROM_FILE(...)

            .......

            IF     COND(#A < 35.5)

            .......

            ENDIF

            .......

         ENDSELECT

 

 

   is a predictable piece of logic. While:

         SELECT FIELDS(#A #B #C) FROM_FILE(...)

                WHERE(...............)

         .......

         .......

         ENDSELECT

 

         IF     COND(#A < 35.5)

         .......

         ENDIF

 

 

   in any form or variation, is an unpredictable piece of logic.   Again, this type of logic would not be expected in sensibly constructed applications, so do not worry too much about this point.   The value of A (and B and C), in terms of data read from the selection table, after exit from the SELECT loop, are actually defined as "not defined".This means that their values at the termination of a SELECT / ENDSELECT loop are not predictable or consistent across platforms.