Re: SQLin 4GLNot Working ......
Posted in 1997
In <32F43683.C44@ix.netcom.com> John Cokos <jcokos@ix.netcom.com>
writes:
>
>
>------------BA32E9F5BB31
>Content-Transfer-Encoding: 7bit
>Content-Type: text/plain; charset=us-ascii
>
> I'm having trouble with the following statement....
>
> LET cTable = "customers"
> SELECT count(*) INTO nCount FROM cTable
> WHERE status = "DEAD">
> I get an error stating that cTable is not in the database.
>
> I have tried the following, with the same results.
> LET cSQL = "SELECT count(*) FROM ", cTable
> " WHERE status = ", "\\"" DEAD, "\\""
> PREPARE qSQL FROM cSQL
> DECLARE q_cur CURSOR FOR qSQL
> FOREACH q_cur INTO nCount
> END FOREACH
>
> If I do a ... MESSAGE cSQL after the above code, the select
>statemente is correct
> (customers appears, not cTable)
>
> What am I missing here?
>
John:
I think your problem is the column 'status'. status is a reserved word
in both SQL and 4GL. You can expect weird things if you use status
like this.
Hope this cures your problem,
ed