The below shown code works well on CF8. password can get from DB successfully. But it doesn't work on CF11. It can't retrive password from DB. Password is always empty. username and datasource can get from DB. The password stored in DB is displayed as:
I guess maybe CF11 variable can't store complex/special string? How to save it? I need get password from DB and then decrypt it.
<cfquery datasource="#XXXX#" name="GetConfig">
,IsNull(ds.column_a, '') AS DataSource
,IsNull(un.column_a, '') AS Username
,IsNull(pw.column_a, '') AS Password
FROM (SELECT column_a AS A FROM table_a WHERE column_b='xxxx1') s
LEFT JOIN table_a ds ON ds.column_b='xxxx2'
LEFT JOIN table_a un ON un.column_b='xxxx3'
LEFT JOIN table_a pw ON pw.column_b='xxxx4'
<cfset qDataSource = GetConfig.DataSource />
<cfset qUsername = GetConfig.Username />
<cfset qPassword = GetConfig.Password />
If you copy the text of that query and execute it in a query utility provided by the vendor of your database engine, does the query return a result?
Yes the query can return result successfully. I can see the password is 0-8VB>D;.<MQ95X$(5M2$>P from return result. I defined a vairable qPassword and set value as returned password. But it show nothing when I use cfoutput to print it.
Okay, if the query works exactly as portrayed in your post then immediately after the <cfquery> closing tag, add the statement <cfdump var="#GetConfig#"> and let us know what you see.