views:

26

answers:

1

I am using the report writing functionality within an application to generate barcode product labels.

The report writing system allows me to use a MySQL SELECT statement to get the information I need from our database and present it to a Jasper Reports JRXML file that formats the report.

This works fine if I want to produce one barcode label for each product returned from the database by my SELECT statement. However I want to produce fifty copies of each product label.

Easy enough if I had access to the code, but all I can change is the SQL statement.

Can anyone suggest a way in which I can get a MySQL SELECT statement to return 50 identical results for each record it finds in the products table?

Thanks for any help.

A: 

I just have an ugly solution, assuming you can modify the schema: create a dummy table containing 50 records and join it in your sql queries like this: select * from products, dummyWith50Records

I'm almost shameful to write something like that, but it should work ... Hopefully someone has a better solution.

Damien
I don't have access to the application, but creating a dummy table is possible. There is a mechanism to pass parameters to the SQL statement so I had hoped to be able to specify the number of labels and embed it in the SQL statement. However the dummy table will work so I'll go with that unless someone has any other ideas. Thank you for your help.
Charlie