SQL report with Comma Delimited Paramater

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SQL report with Comma Delimited Paramater

ksorbo
Is it possible to create a SQL report using a parameter with comma delimited
ids?

Specifically I would like to be able to select random, non-contiguous items.

The following sql statement works when called directly from mysql:
*select * from items where barcode in (3456,2346);*

However, when I create a sql report with the following code:
*select * from items where barcode in (<<Enter Barcodes>>)*
it works if I enter 1 barcode, but fails if I enter 2 barcodes separated by
a comma.

Is there any workaround for this?





--
Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
_______________________________________________
Koha mailing list  http://koha-community.org
[hidden email]
https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: SQL report with Comma Delimited Paramater

barton
This is not currently possible, but if you check the bywatersolutions
github page, you can find a plugin called 'koha-plugin-reports-plus', or
something similar (on mobile, or I'd link to it). That plugin will allow
you to add a parameter that lets you enter a list.

On Wed, Jun 6, 2018, 07:38 ksorbo <[hidden email]> wrote:

> Is it possible to create a SQL report using a parameter with comma
> delimited
> ids?
>
> Specifically I would like to be able to select random, non-contiguous
> items.
>
> The following sql statement works when called directly from mysql:
> *select * from items where barcode in (3456,2346);*
>
> However, when I create a sql report with the following code:
> *select * from items where barcode in (<<Enter Barcodes>>)*
> it works if I enter 1 barcode, but fails if I enter 2 barcodes separated by
> a comma.
>
> Is there any workaround for this?
>
>
>
>
>
> --
> Sent from: http://koha.1045719.n5.nabble.com/Koha-general-f3047918.html
> _______________________________________________
> Koha mailing list  http://koha-community.org
> [hidden email]
> https://lists.katipo.co.nz/mailman/listinfo/koha
>
_______________________________________________
Koha mailing list  http://koha-community.org
[hidden email]
https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: SQL report with Comma Delimited Paramater

Magnus Enger
On 6 June 2018 at 15:17, Barton Chittenden <[hidden email]> wrote:
> This is not currently possible, but if you check the bywatersolutions
> github page, you can find a plugin called 'koha-plugin-reports-plus', or
> something similar (on mobile, or I'd link to it). That plugin will allow
> you to add a parameter that lets you enter a list.

Probably this one? https://github.com/bywatersolutions/koha-plugin-reports-plus

I have added it to https://wiki.koha-community.org/wiki/Koha_plugins

Best regards,
Magnus
Libriotech
_______________________________________________
Koha mailing list  http://koha-community.org
[hidden email]
https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: SQL report with Comma Delimited Paramater

barton
Yes, that's the one. Thanks!

On Tue, Jun 12, 2018 at 7:31 AM, Magnus Enger <[hidden email]> wrote:

> On 6 June 2018 at 15:17, Barton Chittenden <[hidden email]>
> wrote:
> > This is not currently possible, but if you check the bywatersolutions
> > github page, you can find a plugin called 'koha-plugin-reports-plus', or
> > something similar (on mobile, or I'd link to it). That plugin will allow
> > you to add a parameter that lets you enter a list.
>
> Probably this one? https://github.com/bywatersolutions/koha-plugin-
> reports-plus
>
> I have added it to https://wiki.koha-community.org/wiki/Koha_plugins
>
> Best regards,
> Magnus
> Libriotech
> _______________________________________________
> Koha mailing list  http://koha-community.org
> [hidden email]
> https://lists.katipo.co.nz/mailman/listinfo/koha
>
_______________________________________________
Koha mailing list  http://koha-community.org
[hidden email]
https://lists.katipo.co.nz/mailman/listinfo/koha