SQLin 4GLNot Working ......
Posted in 1997
------------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?
Thanks
John Cokos
--
+-------------------------------------------------------+
_/_/_/_/_/_/_/ _/_/_/_/_/_/_/ _/_/_/_/_/_/_/
_/_/ _/_/ _/_/
_/_/ _/_/ _/_/_/_/_/_/_/
_/_/ _/_/ _/_/
_/_/ _/_/ _/_/
_/_/_/_/_/_/_/ _/_/_/_/_/_/_/_/ _/_/_/_/_/_/_/
Call Center Solutions...Database Management / Design
List Brokerage
Barcoding / Caging Services
V:(609)546-0434 F:(609)310-0575
+-------------------------------------------------------+
------------BA32E9F5BB31
Content-Transfer-Encoding: 7bit
Content-Type: text/html; charset=us-ascii
<HTML><BODY>
<DT> I'm having trouble with the following statement....</DT>
<DT> </DT>
<DT> LET cTable = "customers"</DT>
<DT> SELECT count(*) INTO nCount FROM cTable</DT>
<DT> WHERE status = "DEAD"</DT>
<DT> </DT>
<DT> I get an error stating that cTable is not in
the database.</DT>
<DT> </DT>
<DT> I have tried the following, with the same results.</DT>
<DT> LET cSQL = "SELECT count(*) FROM ",
cTable</DT>
<DT>
" WHERE status = ", "\\"" DEAD, "\\""</DT>
<DT> PREPARE qSQL FROM cSQL</DT>
<DT> DECLARE q_cur CURSOR FOR qSQL</DT>
<DT> FOREACH q_cur INTO nCount</DT>
<DT> END FOREACH</DT>
<DT> </DT>
<DT> If I do a ... MESSAGE cSQL after the above
code, the select statemente is correct</DT>
<DT> (customers appears, not cTable)</DT>
<DT> </DT>
<DT> What am I missing here?</DT>
<DT> </DT>
<DT>Thanks</DT>
<DT>John Cokos<BR>
-- <BR>
+-------------------------------------------------------+<BR>
<BR>
_/_/_/_/_/_/_/ _/_/_/_/_/_/_/
_/_/_/_/_/_/_/<BR>
_/_/
_/_/
_/_/<BR>
_/_/
_/_/
_/_/_/_/_/_/_/<BR>
_/_/
_/_/
_/_/<BR>
_/_/
_/_/
_/_/<BR>
_/_/_/_/_/_/_/ _/_/_/_/_/_/_/_/ _/_/_/_/_/_/_/<BR>
<BR>
Call Center Solutions...Database Management / Design<BR>
List Brokerage<BR>
Barcoding / Caging Services<BR>
<BR>
V:(609)546-0434
F:(609)310-0575 <BR>
+-------------------------------------------------------+<BR>
</DT>
</BODY>
</HTML>
------------BA32E9F5BB31--