I'm was sitting forever on a Coldfusion8 INSERT into MySQL (5.0.88)
The data came from a query named "q" like so:
[Record # 1]
ILN_KAEUFER: 9900000002985
ILN_VERKAEUFER: 9900000003005
Then I want to make an INSERT like so:
<cfloop query="q">
<cfquery datasource="db">
INSERT INTO table_a (
iln_kaeufer,
iln_verkaeufer
)
VALUES(
"#iln_kaeufer#",
"#iln_verkaeufer#"
)
</cfquery>
</cfloop>
This is the only way I can make it work. I first tried to scope both values like so:
"#q.iln_kaeufer#",
"#q.iln_verkaeufer#"
And before that I was using cfqueryparam aswell like so:
<cfqueryparam value="#q.iln_kaeufer#" cfsqltype="cf_sql_varchar" maxlength="13">
<cfqueryparam value="#q.iln_verkaeufer#" cfsqltype="cf_sql_varchar" maxlength="13">
Both just produced an error.
I guess this has been asked before, but I did not find a good explanation on when I can/should use CFQUERYPARAM and when not and when to SCOPE and when not.
I always try to param&scope everything and this was the last thing I was looking for as being a mistake.
Thanks for shedding some insights!