tracker issue : CF-4013936

select a category, or use search below
(searches all categories and all time range)
Title:

Postgres cast shorthand :: doesn't work when using cfscripts new query()

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/Workaround

Reporter/Name(from Bugbase): Mingo Hagen / Mingo Hagen (Mingo Hagen)

Created: 06/29/2015

Components: Database

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Platforms All

Vote Count: 0

Problem Description: When using PostgreSQL as a datasource the shorthand SELECT '10'::int will generate an error, the reason is that a the query.cfc file interprets a colon as a named parameter.

Steps to Reproduce:
var q = new query(); 
q.setSQL( "SELECT '10'::int" );
q.execute();

Actual Result:
Error about missing a named parameter

Expected Result:
Query result with the integer 10

Any Workarounds:
Use CAST( '10' ) AS int instead.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4013936

External Customer Info:
External Company:  
External Customer Name: Mingo
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

that workaround should be: CAST( '10' AS int )
Comment by External U.
6871 | June 30, 2015 07:30:54 AM GMT
Hi Mingo, Please try it with QueryExecute function which we have introduced with ColdFusion 11. It addresses this issue. Documentation: https://wikidocs.adobe.com/wiki/display/coldfusionen/QueryExecute Reach out to us if you have any further concern.
Comment by Nimit S.
6872 | July 06, 2015 09:47:46 PM GMT