How to pass a query from tJava component to tOracleRow component

One Star

How to pass a query from tJava component to tOracleRow component

Hi,
We have written a java routine.
It returns a variable which contains a oracle create table statement.
This statement needs to be executed in a Oracle DB.
So, I am trying to pass that variable from tJava component to tOracleRow component and execute it. But unable to succeed.
Please let us know how to go ahead with it.
Thanks and Regards,
Babu.
One Star

Re: How to pass a query from tJava component to tOracleRow component

Hi Babu,
We can use the variable name which stores the SQL statement in tJava component (createTableDDLStatement) in the Query section of tOracleRow.
Regards,
Abhi
One Star

Re: How to pass a query from tJava component to tOracleRow component

Hi Abhi,
It worked fine in our case. Thanks a lot.
Will this work fine if the variable has multiple statements(one create table statement and one alter table statement to add primary key for the same table)? I tried but it failed.
Example:
String DDL = "Create table Employee(Id Varchar2(20), Name varchar2(20), Age Number, JoiningDate Date); Alter table Employee add constraint Employee_pk PRIMARY KEY (Id);"
How to exeute multiple styatements as mentioned in the above scenario?
Thanks and Regards,
Babu.
One Star

Re: How to pass a query from tJava component to tOracleRow component

Hi Babu,
A tJavaFlex component can be used to achieve this. In the start code of the tJavaFlex component, we can parse the DDL statement list to create an array of DDL statements using ";" as the separator. The row1 in the job has a schema with one field by the name DDL_STATEMENT (String). Attaching screen shots.
Regards,
Abhi
One Star

Re: How to pass a query from tJava component to tOracleRow component

Hi Abhi,
We tried to follow the same steps but we are facing some issues as shown in the attached images.
Regards,
Babu
One Star

Re: How to pass a query from tJava component to tOracleRow component

Hi Abhi,
Error got resolved, I forgot to do the following change:
"The row1 in the job has a schema with one field by the name DDL_STATEMENT (String)". After editing the schema, error got resolved.
Thanks for your support.
Regards,
Babu.