Use parameters in Query Text of Data Source
-
- Posts: 13
- Joined: Thu Mar 31, 2016 10:47 am
Use parameters in Query Text of Data Source
I need some help with using parameters inside Query Text of Data Source. I have tried to pass a date range from user to sql query like 'select @DB from dual' but when report rendering always I get an error Load Data error, and in the report checker i get Parse error: The name 'DB' doesn't exist in current context.
Thank you in advance
Thank you in advance
Re: Use parameters in Query Text of Data Source
Hello,
Can you please send us your report with test data which reproduces the issue for analysis.
Thank you.
Can you please send us your report with test data which reproduces the issue for analysis.
Thank you.
-
- Posts: 13
- Joined: Thu Mar 31, 2016 10:47 am
Re: Use parameters in Query Text of Data Source
Yes, of course I uploaded a test report with a signle simple select from dual sql.
Thank you
Thank you
Re: Use parameters in Query Text of Data Source
Hello,
Oracle SQL parameters are specified using ':'. Please try to use the following query:
Thank you.
Oracle SQL parameters are specified using ':'. Please try to use the following query:
Code: Select all
select :DB from dual
-
- Posts: 13
- Joined: Thu Mar 31, 2016 10:47 am
Re: Use parameters in Query Text of Data Source
Trying to make it work but I'm missing something. When trying with the declaration of parameter in screenshot I'm still getting the same error: Retrieve columns error.
Thank you
Thank you
Re: Use parameters in Query Text of Data Source
Hello.
There should not be curly braces in the Expression.
Please, remove them.
Thank you.
There should not be curly braces in the Expression.
Please, remove them.
Thank you.
Re: Use parameters in Query Text of Data Source
Hi ,
I'm also facing the same issue. I'm unable to run the following query. I'm using MySQL connection.
I'm also facing the same issue. I'm unable to run the following query. I'm using MySQL connection.
Code: Select all
SET @tables = (
SELECT GROUP_CONCAT(DISTINCT CONCAT(TABLE_SCHEMA, ".", TABLE_NAME) SEPARATOR ', ')
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE 'peripherals'
AND TABLE_SCHEMA LIKE 'tracker'
);
SET @select = (
SELECT
GROUP_CONCAT(
DISTINCT CONCAT(TABLE_SCHEMA, ".", TABLE_NAME, ".`peripherals` AS '", TABLE_SCHEMA, ".", TABLE_NAME, ".peripherals'")
SEPARATOR ', '
)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE 'peripherals'
AND TABLE_SCHEMA LIKE 'tracker'
);
SET @x := CONCAT('SELECT ', @select, ' FROM ', @tables);
PREPARE stmt FROM @x;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
Re: Use parameters in Query Text of Data Source
Hello,
Can you please send us a test data for your query. Or send us a simple query which reproduces the issue for analysis.
Thank you.
Can you please send us a test data for your query. Or send us a simple query which reproduces the issue for analysis.
Thank you.