Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
catusse
Contributor
Contributor

[resolved] Execute Script sql to Oracle from file

Hi,
I Have done a file sql (with a tMap componant) and I want to load it into Oracle.
Which component should I use?
I 've got 200 request like this:
update OG.COORDONNEES
set OG.COORDONNEES.MEL_PRO1='mail1',
OG.COORDONNEES.NUM_TELPRO1='00000',
OG.COORDONNEES.NUM_POSTPRO1='0000'
WHERE OG.COORDONNEES.COORD_ID in (
select OG.COORDONNEES.COORD_ID
from OG.COORDONNEES, rh.agtnat , OG.IDENT
where rh.agtnat.idf_agent=XXX
AND RH.AGTNAT.IDENT_ID=OG.IDENT.IDENT_ID AND
OG.IDENT.COORD_ID=OG.COORDONNEES.COORD_ID
AND RH.AGTNAT.COD_COLL ='ZZZZ'
)
Is there another way to do this without using an sql script?
Tank's for your help.
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi
Modify the end code of tJavaFlex to:
globalMap.put("sql","begin"+"\n\r"+sql+"\n\r"+"commit;"+"\n\r"+"end;"

View solution in original post

22 Replies
Anonymous
Not applicable

Hello
You can use a tFileInputFullRow to read the sql file, and then execute the sql statement on tOracleRow component. see my screenshots.
Best regards

shong
_AnonymousUser
Specialist III
Specialist III

Hello
You can use a tFileInputFullRow to read the sql file, and then execute the sql statement on tOracleRow component. see my screenshots.
Best regards

shong

Hi shong,
i've followed your steps, but when i execute job i have following error:
sql cannot be resolved
Why?
Giancarlo
_AnonymousUser
Specialist III
Specialist III

Hello
You can use a tFileInputFullRow to read the sql file, and then execute the sql statement on tOracleRow component. see my screenshots.
Best regards

shong

Hi shong,
i've followed your steps, but when i execute job i have following error on tOracleRow:
sql cannot be resolved
Why?
Giancarlo
Anonymous
Not applicable

hello, all
i followed the same steps , finaly when i execute , i got this error "sql cannot be resolved"
thanks for help
Anonymous
Not applicable

Make sure you declare the variable "sql" in the Begin section of the JavaFlex like in Shongs image.
_AnonymousUser
Specialist III
Specialist III

hello
i've got the same error "sql cannot be resolved"

i thing it's caused by tOracleRow because he doesn't see the variable "sql"
in code "sql" is declared in public void tFileInputFullRow_1Process(
but we try to use it in public void tOracleRow_1Process(
with the instruction : query_tOracleRow_1 = (String) globalMap.get("context.sql", sql);

how can i resolve this ?

thanks for your help
Anonymous
Not applicable

Hello!! Thank by the tutorial.
The solutión have an error.
-The correct option in tOracleROW is:

(String)globalMap.get(sql)
See you soon.
Anonymous
Not applicable

I was able to resolve the "sql cannot be resolved" issue with:
(String)globalMap.get("sql");
in the tOracleROW
Anonymous
Not applicable

Indeed
(String)globalMap.get("sql");
is the solution. I was able to run a query against a postgreSql database using this method (tPostgresqlRow).