queryExecute params with integer and list="true"

Should this work in Lucee?

      sql="SELECT myid FROM mytable WHERE myid IN (:myids)",
      params={myids={value="49406,49407", cfsqltype="cf_sql_integer", list="true"}},
      options={datasource="mydsn"}
    );```


This throws "cannot cast [49406,49407] string to a number value"

Regards,
Adam

I would think it would work, but apparently the list attribute isn’t being recognized when passing the params as a struct. The following variation, using the addParam() method, does work:

qry = new query();
qry.addParam(name=“myids”,value=“49406,49407”,cfsqltype=“cf_sql_integer”,list=“true”);
q=qry.execute(sql=“SELECT myid FROM mytable WHERE myid IN (:myids)”);

    writeDump(var=q.getResult());
    abort;

You might want to submit a bug report on this one.On July 26, 2015 at 8:10:55 PM, Adam Chapman (@Adam_Chapman) wrote:

Should this work in Lucee?

      sql="SELECT myid FROM mytable WHERE myid IN (:myids)",
      params={myids={value="49406,49407", cfsqltype="cf_sql_integer", list="true"}},
      options={datasource="mydsn"}
    );```

This throws "cannot cast [49406,49407] string to a number value"

Regards,
Adam
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I’ll throw more things at Micha and see if I can get my pull request into 4
:slight_smile: The fact this one doesn’t work annoys me a lot as it means having to
use other query syntaxes for lists!On Monday, 27 July 2015 06:12:18 UTC+1, Adam Chapman wrote:

Thanks for the replies,

There is already a bug report for this one…

https://luceeserver.atlassian.net/browse/LDEV-224

On Monday, July 27, 2015 at 11:21:28 AM UTC+10, Jon Clausen wrote:

I would think it would work, but apparently the list attribute isn’t
being recognized when passing the params as a struct. The following
variation, using the addParam() method, does work:

qry = new query();
qry.addParam(name=“myids”,value=“49406,49407”,cfsqltype=“cf_sql_integer”,list=“true”);
q=qry.execute(sql=“SELECT myid FROM mytable WHERE myid IN (:myids)”);

    writeDump(var=q.getResult());
    abort;

You might want to submit a bug report on this one.

On July 26, 2015 at 8:10:55 PM, Adam Chapman (adam.p....@gmail.com) wrote:

Should this work in Lucee?

      sql="SELECT myid FROM mytable WHERE myid IN (:myids)",
      params={myids={value="49406,49407", cfsqltype="cf_sql_integer", list="true"}},
      options={datasource="mydsn"}
    );```


 This throws "cannot cast [49406,49407] string to a number value"
 
 Regards,
 Adam
 --
You received this message because you are subscribed to the Google Groups 
"Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com 
<https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

Thanks for the replies,

There is already a bug report for this one…

https://luceeserver.atlassian.net/browse/LDEV-224On Monday, July 27, 2015 at 11:21:28 AM UTC+10, Jon Clausen wrote:

I would think it would work, but apparently the list attribute isn’t being
recognized when passing the params as a struct. The following variation,
using the addParam() method, does work:

qry = new query();
qry.addParam(name=“myids”,value=“49406,49407”,cfsqltype=“cf_sql_integer”,list=“true”);
q=qry.execute(sql=“SELECT myid FROM mytable WHERE myid IN (:myids)”);

    writeDump(var=q.getResult());
    abort;

You might want to submit a bug report on this one.

On July 26, 2015 at 8:10:55 PM, Adam Chapman (adam.p....@gmail.com <javascript:>) wrote:

Should this work in Lucee?

      sql="SELECT myid FROM mytable WHERE myid IN (:myids)",
      params={myids={value="49406,49407", cfsqltype="cf_sql_integer", list="true"}},
      options={datasource="mydsn"}
    );```


 This throws "cannot cast [49406,49407] string to a number value"
 
 Regards,
 Adam
 --
You received this message because you are subscribed to the Google Groups 
"Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com 
<https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

try with spaces around :myids

sql=“SELECT myid FROM mytable WHERE myid IN ( :myids )”,

This worked for me for something similar; may work here tooOn 27 July 2015 at 08:10, Adam Chapman <@Adam_Chapman> wrote:

Should this work in Lucee?

      sql="SELECT myid FROM mytable WHERE myid IN (:myids)",
      params={myids={value="49406,49407", cfsqltype="cf_sql_integer", list="true"}},
      options={datasource="mydsn"}
    );```


This throws "cannot cast [49406,49407] string to a number value"

Regards,
Adam

--
You received this message because you are subscribed to the Google Groups
"Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com
<https://groups.google.com/d/msgid/lucee/5227e748-1d34-4549-a645-4e44ceb337a8%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

AJ Mercer
<webonix:net strength=“Industrial” /> http://webonix.net | <webonix:org
community=“Open” /> http://webonix.org
http://twitter.com/webonix