Re: sql error
Posted in 1996
The problem is in the SELECT statement:
SELECT status
INTO v_meta_status
FROM bgc_content
WHERE content_id = v_content_id
is translated into "SELECT ? FROM bgc_content WHERE content_id = ?"
which is not legitimate SQL. It does this because status is an I4GL global
variable, and this overrides the database column name. Use an @ in front
of the status, or use the table name (or an alias) in the statement:
SELECT C.Status
INTO v_meta_status
FROM BGC_Content C
WHERE C.Content_id = v_content_id
You are neither the first person to be cvaught like this, nor are you
likely to be the last. If you run into such problems again, look at the
.ec or .c file generated from the .4gl file to see whether the SQL is OK.
If you are using p-code, you can do an octal dump on the p-code file to see
the translated code.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
>From: costrom@inter.NL.net (Craig Ostrom)
>Date: Thu, 18 Jan 1996 09:51:24 GMT
>X-Informix-List-Id: <news.20364>
>
>I have compiled the following 4gl program successfully, but get a syntax
>error on line 37 (Error -201). I have tried everything to find out where
>the error is coming from, even commenting-out line 74, but without
>success.
>
>part.4gl:
>[...lots of code deleted...]
> select status
> into v_meta_status
> from bgc_content
> where content_id = v_content_id>[...lots of code deleted...]