Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to query my PostgreSQL DB using the tDBinput component, but I am getting errors.
Following is my query in the query builder:
"select max(created_date) as max_date from \""+context.orders_table+"\";"
When I try to replace the context variable with the actual table name using the following query, it gives me appropriate results, the following is the query:
select max(created_date) as max_date from "Orders_Table";
Could you please help me write a query having a context variable so it runs fine?
@Sameer_Keluskar , you need to call the below query in tDBinput and ";" not required.
select max(created_date) as max_date from "Orders_Table"
"select max(created_date) as max_date from "\"+context.orders_table+"\""
@Sameer_Keluskar , you need to call the below query in tDBinput and ";" not required.
select max(created_date) as max_date from "Orders_Table"
"select max(created_date) as max_date from "\"+context.orders_table+"\""
Hi Sameer,
Try the following:
"select max(created_date) as max_date from " + context.orders_table
You don't need the semicolon at the end.
Roland
Hi Sameer,
Try the following:
"select max(created_date) as max_date from " + context.orders_table
You don't need the semicolon at the end.
Roland
First of all, what kind of errors you get?
I guess you get the error about missing table?
In this case please change your query this way:
"select max(created_date) as max_date from "+context.orders_table
If you put tables in double quotas this means the table name must exists exactly this way (case sensitive!!) in the database. Mostly this is not the case. I bet your table is shown as order_table in your database browser.
The other problem is the ; at the end of your query. This ; is NOT part of a statement, many tools use this to separate between statements or it is used within code blocks of functions. Oracle e.g. do not accept statements ending with ;
First of all, what kind of errors you get?
I guess you get the error about missing table?
In this case please change your query this way:
"select max(created_date) as max_date from "+context.orders_table
If you put tables in double quotas this means the table name must exists exactly this way (case sensitive!!) in the database. Mostly this is not the case. I bet your table is shown as order_table in your database browser.
The other problem is the ; at the end of your query. This ; is NOT part of a statement, many tools use this to separate between statements or it is used within code blocks of functions. Oracle e.g. do not accept statements ending with ;