Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfquery name="tableElements" datasource="TestSQLServer">
- SELECT * FROM tableElements
- </cfquery>
- <cfdump var="#tableElements#" /> <!--- Shows object having "SQL" property --->
- <cfoutput>SQL: #tableElements.SQL#</cfoutput> <!--- Error: Element SQL is undefined in TABLEELEMENTS. --->
- <cfquery name="tableElements" datasource="TestSQLServer" result="r">
- SELECT * FROM tableElements
- </cfquery>
- <cfdump var="#tableElements#" /> <!--- Shows object having "SQL" property --->
- <cfoutput>SQL: #r.SQL#</cfoutput>
- <cffunction name="getRealSQL" returntype="string">
- <cfargument name="qryResult" type="any">
- <cfset realSQL = arguments.qryResult.sql>
- <cfloop array="#arguments.qryResult.sqlParameters#" index="a">
- <cfscript>
- if (NOT isNumeric(a)) a = "'#a#'";
- realSQL = Replace(realSQL, "?", a);
- </cfscript>
- </cfloop>
- <cfreturn realSQL>
- </cffunction>
- <cfset stx={}>
- <cfquery name="stx.q" datasource="myDataSource">
- select emp_id from employees where 1=2
- </cfquery>
- <cfdump var="#stx.q#">
- <cfdump var="#stx.q#" metainfo="yes">
Add Comment
Please, Sign In to add comment