Question
Accenture Solutions Pvt Ltd
IN
Last activity: 5 Dec 2018 6:22 EST
Pega Robotics: Oracle Query Syntax
Hi,
I am trying to connect to oracle DB & execute the query from automation using oraclequery component from DB.I am able to run query select * from "tablename" & select * from tablename where columnname=1 & fetch or filter the data using execute the getTable but I would like to pass the parameter dynamically from windowsform text box & want to run query based on the user selection using query as "Select * from Tablename where column=?" this works fine for Oledbquery for access db & mssql server but not working for oracle db it throws error &am unable to see the param01 for execute method of oraclequery component.Please let me know the correct syntax for the oracle query using where & insert so that parameter should come from execute method.
Where I tried with OleDbquery for Acces & MSSQL with below syntax its working fine by providing parameter option.
INSERT INTO [Tablename] [Col1],[Col2]) VALUES (?,?)
SELECT * FROM [Tablename] WHERE COLNAME=?
when I tried the below syntax for OracleQuery component for oracle Db
SELECT * FROM [Tablename] WHERE COLNAME=@COLNAME
SELECT * FROM [Tablename] WHERE COLNAME= @(COLNAME)
SELECT * FROM [Tablename] WHERE COLNAME={COLNAME}
SELECT * FROM [Tablename] WHERE COLNAME=?(COLNAME}
SELECT * FROM [Tablename] WHERE COLNAME=?
SELECT * FROM [Tablename] WHERE COLNAME=@
Hi,
I am trying to connect to oracle DB & execute the query from automation using oraclequery component from DB.I am able to run query select * from "tablename" & select * from tablename where columnname=1 & fetch or filter the data using execute the getTable but I would like to pass the parameter dynamically from windowsform text box & want to run query based on the user selection using query as "Select * from Tablename where column=?" this works fine for Oledbquery for access db & mssql server but not working for oracle db it throws error &am unable to see the param01 for execute method of oraclequery component.Please let me know the correct syntax for the oracle query using where & insert so that parameter should come from execute method.
Where I tried with OleDbquery for Acces & MSSQL with below syntax its working fine by providing parameter option.
INSERT INTO [Tablename] [Col1],[Col2]) VALUES (?,?)
SELECT * FROM [Tablename] WHERE COLNAME=?
when I tried the below syntax for OracleQuery component for oracle Db
SELECT * FROM [Tablename] WHERE COLNAME=@COLNAME
SELECT * FROM [Tablename] WHERE COLNAME= @(COLNAME)
SELECT * FROM [Tablename] WHERE COLNAME={COLNAME}
SELECT * FROM [Tablename] WHERE COLNAME=?(COLNAME}
SELECT * FROM [Tablename] WHERE COLNAME=?
SELECT * FROM [Tablename] WHERE COLNAME=@
but none of them are working & not giving option for parameter for Execute method to specify the input from user.Please guide syntax to use for OracleQuery,OleDbquery,ODBCQuery,SqlQuery components to get param input for Execute method to use in automation.
Regards,
Pravallika.