Skip to main content
Inspiring
November 18, 2013
Question

double quotes/single quote problem in Coldfusion with back end as ORacle

  • November 18, 2013
  • 1 reply
  • 2066 views

Hi All,

Here is my problem,

I have a user defined function, which will give me the output as " table.column = <cfqueryparam cfsqltype = 'cf_sql_varchar' value = 'test'>;

but when i pass this as my where clause in the query.

I always get missing experssion (00936) error.

When I ON the debug information in CF, I copied the query its running;

any help would be highly appreciated.

I have tried replacing this double quotes with single quotes using Rereplace and replace function;  tried preservesinglequotes(); all are returning the same error.. May be I'm missing something.

THe below is the query formed; and its the one I get when I on the debug information (sql)

SELECT *  FROM  SHOP_FINDINGS  WHERE   ROWNUM<=20 AND (OPER_NAME = <cfqueryparam cfsqltype='CF_SQL_VARCHAR' value='IN STOCK'> )

I m using CF 9 and Apache server.

This topic has been closed for replies.

1 reply

meensiAuthor
Inspiring
November 20, 2013

59 views No reply.:(

I  need some help ..

Legend
November 20, 2013

<cfqueryparam> is normally used when you want to sanitize user input (URL or Form scope data etc) that is passed to a database query. In this case the string "IN STOCK" is hard-coded, so why not just use:

SELECT * FROM SHOP_FINDINGS

WHERE ROWNUM<=20 AND OPER_NAME = 'IN STOCK'

Does that SELECT statement work? Also, try specifying the column names in the SELECT, rather than using the * wildcard. The parentheses are not needed in your statement either I don't think. This error normally occurs when you specify a missing column name or wildcard, or if a bracket/comma is missing or doesn't match etc. Re-check the query and write a test template to just issue one query to test it perhaps.

meensiAuthor
Inspiring
November 21, 2013

Hi Tribute,

Thanks!!

FOr an example, I made the value as "In Stock" but actually it was the user input.

selecting the columns dint work:(

Yes I m using the test template only; i have made the function and query separately and trying it but still in vain.