on 12-15-2009 5:45 PM
Hi,
I have created an command like this:
update table1 set [Param.1] = '[Param.2]' where id = [Param.3]
where:
Param.1 = COL1
Param.2 = Hello
Param.3 = 1 (the primary key I want to change).
When I run this SQL Action I get the following error message:
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification
I have double checked the values of my parameters and they are all correct. There is a column named COL1, and its type is varchar2, and there is PK = 1.
So, my question is: Is it a limitation of xMII (we can not take column names from parameters) or there is a mistake here?
Thank you in advance,
Nuno Cunha
Hi Nuno,
I see you are trying to perform Dynamic SQL execution in Oracle.
In order to execute a Dynamic SQL you need to use the following syntax
EXECUTE IMMEDIATE 'Sql Statement with any runtime params like cloumns, even table names too';
And I guess you can use an Dynamic Sql only within a PL/SQL block.
Please refer to the below link for more details
[Dynamic SQL|http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96590/adg09dyn.htm]
Hope this helps!!
Regards,
Adarsh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does the query work if you hard code it? I wonder if COL1 is an illegal name somehow. Also with oracle you may need to specify the schema ( e.g. <schema_name>.<table_name> )
Edited by: Christian Libich on Dec 15, 2009 7:36 PM
Edited by: Christian Libich on Dec 15, 2009 7:38 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeremy,
The name of the column in the example given here is COL1 but at my real work is another one (DATA_SAIDA_LOCAL_ATUAL), in portuguese (some like the "Departure date from the current location").
I have ran this command (without using parameters) in a oracle query editor and it is okay. All others parameters in this MII query that are values to put in others columns works with no problem. Just the one that I would like to use as a column name do not work.
Nuno
User | Count |
---|---|
12 | |
6 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.