Could someone clarify how the passing of parameters in execute query works? I understand that you can call the parameters using “?” however you have to keep your parameters in the correct order. I have tried the “@” symbol as well.
Here is an example:
“SELECT a.col1, a.col2
FROM table a
WHERE a.col3 = @acctName”
Parameter:
Name: acctName
Direction: In
Type: String
Value: someString
where someSting = “String”
However, I either get back errors when I do this @acctName, or an empty table if I do this ‘@acctName’
Hope you have used EXECUTE QUERY and not EXECUTE NON-QUERY activity, then the below query would return a data table as output.
“select a.L_Name, a.F_Name from Employees_data a WHERE a.Id = @Id”
use the for each row to iterate through the table.
The above query i tried and worked for me .
let me know if that worked
I tried that method of running the query, but unfortunately it was not successful. The details of that were explained above. The error referenced is an ORA-00936 missing expression error.
@ashley11
I have read through these, but am not seeing a correlation. Do you see anything in the code referenced above that you think could be causing this issue?
Where you able to solve this issue. I too am facing a similr issue.
If I pass hard coded values in my filtering condition, the execute query activity provides expected number of rows in return. But if I pass the same filtering conditions through parameters, the execute query activity provides zero rows. Not sure where the issue is.
Thanks a Ton David!! Actually I was also using ‘?’ even before I saw your reply, but when playing with multiple IN arguments, you statement “adding the parameters in order that they appear in the code” solved my issue.
Regards,
Nishant
PS: I am still struggling with out paramenters, I am using For each row activity even though my SQL query output has only one cell of data. For Example.
“Select ORDERED_ITEM From OE_ORDER_LINES_ALL
Where ITEM_ID=123213;”
Do you have an idea of how can I take out ORDERED_ITEM as an OUT argument?.
you should use execute-non-query(run command), type of command: Text, and use “:” in your parameters names in sql instead “@”:
“insert into some_table (some_column) values (:param1)”
and add params in Parameters tab (params order is more important then their names)