Table name as parameter

Jump to: Board indexJS, Java, PHP, FlexStimulsoft Reports.PHP

Stimulsoft Reports.PHP discussion

Table name as parameter

Post Thu Jan 25, 2018 12:18 pm

Hi,
It's possible to pass the table name as a parameter?
Something like this:
SELECT f1, f2, f3 FROM
@table_name
ORDER BY f1 DESC


Thanks,
Catalin
catalin
 
Posts: 23
Joined: Sat Jan 30, 2016 10:31 am

Re: Table name as parameter

Post Fri Jan 26, 2018 10:21 am

Hello,

Please check the following sample:
https://www.stimulsoft.com/en/samples/p ... -sql-query

Thank you.
Alex K.
 
Posts: 6425
Joined: Thu Jul 29, 2010 2:37 am

Re: Table name as parameter

Post Tue Jan 30, 2018 7:58 am

Hi,
I checked the sample but I didn't saw the answer of my question. I need to pass the table name as a parameter.

Code: Select all
SELECT f1, f2, f3 FROM @table_name ORDER BY f1 DESC


or

Code: Select all
SELECT f1, f2, f3 FROM {table_name} ORDER BY f1 DESC


I try it in both ways but is not working.

Also the sample is wrong:
Code: Select all
SELECT id, name
WHERE id = {Variable1}
ORDER BY name {Variable2}
catalin
 
Posts: 23
Joined: Sat Jan 30, 2016 10:31 am

Re: Table name as parameter

Post Thu Feb 01, 2018 12:44 am

Hello,

You can use the following query:
select * from {VariableTableName}
and set value for the variable before run report.

Also, please clarify which version are you use?

Thank you.
Alex K.
 
Posts: 6425
Joined: Thu Jul 29, 2010 2:37 am


Return to Stimulsoft Reports.PHP

Who is online

Users browsing this forum: No registered users and 1 guest