Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 458

SQL query result 'url' object not string?

$
0
0

Should I open a lucce JIRA ?

I would expect a query to return strings or numbers , not the java object that it does when a column is named “url”

I’m porting legacy CF11 to lucee , one application has an Oracle query that SELECTs a column “url” , in the CF11 result set “url” type is a string. Later in the code, we interpolate the url string. In Lucee, the “url” type is a lucee.runtime.type.scope.URLImpl. When we try to interpolate it, an exception is thrown to the effect that you can’t interoplate a complex struct

CODE:

<cfquery name="url_as_object" datasource="admin_console">
        SELECT url FROM content WHERE ROWNUM <= 1
</cfquery>
<cfset my_str="a string">
<cfloop query="url_as_object">
<cfoutput>
<pre>
        expected data for url:     #getMetadata(my_str)#
        actual meta data for url: #getMetadata(url)#
</pre>
</cfoutput>
</cfloop>

OUTPUT:

	expected data for url:     class java.lang.String 
	actual meta data for url: class lucee.runtime.type.scope.URLImpl

OS: ubuntu 22.04n
Java Version: OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
Tomcat Version: 9.0.58-1ubuntu0.1
Lucee Version: 5.4.4.38

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 458

Trending Articles