qb icon indicating copy to clipboard operation
qb copied to clipboard

Invalid keys detected in your query param struct:

Open Adrian-Sanchez opened this issue 7 months ago • 2 comments

Error: Invalid keys detected in your query param struct: [NAME]. Usually this happens when you meant to serialize the struct to JSON first.

I understand the error has has to do with the attributes not matching up with the queryparam tag.

However, "name" is not a queryparam tag BUT name is the key used for named parameters.

.whereRaw(" someColumnName = :formval or someOtherColumnName = :formval",[ {name:'formval',value : rc.formval } ])

Adrian-Sanchez avatar May 20 '25 22:05 Adrian-Sanchez

This has been fixed in 12.1.1.

I’m very curious how you are using names parameters in qb. It’s not really set up for that.

-- Eric Peterson

On May 20, 2025 at 4:27:57 PM, Adrian-Sanchez @.***) wrote:

Adrian-Sanchez created an issue (coldbox-modules/qb#293) https://github.com/coldbox-modules/qb/issues/293

Error: Invalid keys detected in your query param struct: [NAME]. Usually this happens when you meant to serialize the struct to JSON first.

I understand the error has has to do with the attributes not matching up with the queryparam tag.

However, "name" is not a queryparam tag BUT name is the key used for named parameters.

.whereRaw(" someColumnName = :formval or someOtherColumnName = :formval",[ {name:'formval',value : rc.formval } ])

— Reply to this email directly, view it on GitHub https://github.com/coldbox-modules/qb/issues/293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATWYXVGMAVEGMDCS6IWJ6T27OT63AVCNFSM6AAAAAB5RVM3IOVHI2DSMVQWIX3LMV43ASLTON2WKOZTGA3TQMZWGQ3DCNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

elpete avatar May 21 '25 22:05 elpete

@elpete I'm not sure what to say....somewhere in the past, i thought it was documented. I've got a report for example that has as much as 13 outer apply's but we only have to use a 3 named parameters. We use a lot of .selectRaw().fromRaw().whereRaw() methods so that we can easily copy them over back into SSMS quickly for tuning and optimizing.

.fromRaw("sometable s
	outer apply dbo.fn1(s.id, :Year,:Id) e
       ... 
	outer apply dbo.fn13(s.id, :Year,:Id) e

Adrian-Sanchez avatar May 21 '25 22:05 Adrian-Sanchez