return queryExecute("
INSERT
INTO myTable
SET colName = :colValue
",
{
colValue = {
value = arguments.colValue,
sqltype = 'string'
}
}
);
Is there a way to return the generated_key value… I’ve tried adding .GENERATED_KEY at the end of the queryExecute but it just complains the
column doesn’t exist, which is fair enough… If I add a result = 'myVar'
and remove the return and then return myVar.GENERATED_KEY that works
fine… just trying to be clean and have a single call.
s = {};
WriteDump( s.insert( ‘hello’,‘there’ ).hello );
And it does on Lucee 5, but not on ACF 11, (however the structInsert()
version errors on both).
Reminds me of method chaining in jQuery. Have you ever done this elsewhere
in CFML?
Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamediaOn Mon, Feb 13, 2017 at 12:11 AM, Andrew Dixon <@Andrew_Dixon> wrote:
Hi All,
If I have a query like this in a function:
return queryExecute("
INSERT
INTO myTable
SET colName = :colValue
",
{
colValue = {
value = arguments.colValue,
sqltype = 'string'
}
}
);
Is there a way to return the generated_key value… I’ve tried adding .GENERATED_KEY at the end of the queryExecute but it just complains the
column doesn’t exist, which is fair enough… If I add a result = 'myVar'
and remove the return and then return myVar.GENERATED_KEY that works
fine… just trying to be clean and have a single call.