Help: SQL command from ColdFusion to Progress 9.1D database

ZggZg

New Member
Hi there,

I'm almost clamping myself on my last straw here on this one.
I've succeeded in connecting ColdFusion 5 Server via MS ODBC (using the native Progress driver) to a copy of the Progess 9.1D demo database. Selected fields are read out, although I had to find a way first to prevent column names like Cust-Num by a Column Renaming Custom Tag. So the index column name Cust-Num is translated to custnum.

Now the next step is the problem:


I want to see if I can insert/modify records in this database.
So my query is:


<CFQUERY DATASOURCE="#application.MainDSN#" NAME="modify">

UPDATE pub.Customer

SET

name = '#form.name#',
address = '#form.address#'

WHERE cust-num = '#form.custnum#'

</cfquery>


And I get this error:



ODBC Error Code = S0022 (Column not found)


[DataDirect-Technologies][ODBC PROGRESS driver][PROGRESS]Column not found/specified (7520)


Can somebody please explain me how to get the SQL-statement right?
 

ZggZg

New Member
Problem solved (special thanks to http://rudy.ca)
1. make use of "quotation marks" when referring to indexes like Cust-Num:

<CFQUERY DATASOURCE="#application.MainDSN#" NAME="modify">
UPDATE "pub"."Customer"

SET

name = '#form.name#',
address = '#form.address#'

WHERE "Cust-Num" = '#form.custnum#'
</cfquery>

2. Custom Tag to rename column names not needed when using column name
aliases right in the query:

SELECT "pub"."Customer"."Cust-Num" as custnum

etc.
 
Top