How to pass Query from file to ODBC stage
Moderators: chulett, rschirm, roy
How to pass Query from file to ODBC stage
Hi all,
I want to pass the query to odbc stage in paralell job, that quey is generated in datastage job its in stored in file from that file i want to pass the genrated query in OODBC stage.
thanks
BMSK.
I want to pass the query to odbc stage in paralell job, that quey is generated in datastage job its in stored in file from that file i want to pass the genrated query in OODBC stage.
thanks
BMSK.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not possible.
Why do you think you want to do it that way?
There is a way, but you have to generate the query externally to the job (perhaps in a prior job) then pass the query into this job as a parameter value.
Why do you think you want to do it that way?
There is a way, but you have to generate the query externally to the job (perhaps in a prior job) then pass the query into this job as a parameter value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
In my first job i will be generated query and store in file. In the second job and in ODBC stage i want to read the query from that file and th pull the data.
flow
first job seq->transform->seq
this is the query i generated
SELECT A.CONT_ID, B.CONT_ID AS SUSPECT_CONT_ID FROM DB2ADMIN.MDX_DATA_SRC A,DB2ADMIN.MDX_DATA_SRC B WHERE (A.DEPT= B.DEPT AND A.sat= B.sat ) AND A.CONT_ID<>B.CONT_ID
second job odbcstage-> seq
In ODBC stage how this query will be call it.
thanks
bmsk.
flow
first job seq->transform->seq
this is the query i generated
SELECT A.CONT_ID, B.CONT_ID AS SUSPECT_CONT_ID FROM DB2ADMIN.MDX_DATA_SRC A,DB2ADMIN.MDX_DATA_SRC B WHERE (A.DEPT= B.DEPT AND A.sat= B.sat ) AND A.CONT_ID<>B.CONT_ID
second job odbcstage-> seq
In ODBC stage how this query will be call it.
thanks
bmsk.
This can't be done from the same sequence. Because the value of the parameter will be initialized when the sequence start .If it is changed in the sequence, it will not reflect.Gurus, correct me if i am wrong
datisaq wrote:This you can do at a job sequence level.
Main sequence:-
Job1----->ExecCommand---->job2
In ExecCommand Stage read that file and assign it to a Job parameter say "pQuery".
Then use that parameter "pQuery" in ODBC stage of your job2
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
because in one of our job , we have the following sequenceray.wurlod wrote:Welcome aboard.
You're wrong. It can be done in the one sequence, precisely as datisaq outlined. ...
shell script to update the <param1> --> job that use <param1>
but the job was using the old value (i.e. the value before the sequence has started)
Hi
i did the job in the flow J1--> Execute command activity --->J2
I facing the error
Call_sequence..JobControl (@EXE_CAT_SQL): Executed: head C:\Satish\sf_query.txt
Reply=0
Output from command ====>
SELECT A.CONT_ID, B.CONT_ID AS SUSPECT_CONT_ID FROM DB2ADMIN.MDX_DATA_SRC as A,DB2ADMIN.MDX_DATA_SRC as B WHERE (A.'LAST_NAME' is not recognized as an internal or external command,operable program or batch file.= B.'LAST_NAME' is not recognized as an inte
regards
bmsk
i did the job in the flow J1--> Execute command activity --->J2
I facing the error
Call_sequence..JobControl (@EXE_CAT_SQL): Executed: head C:\Satish\sf_query.txt
Reply=0
Output from command ====>
SELECT A.CONT_ID, B.CONT_ID AS SUSPECT_CONT_ID FROM DB2ADMIN.MDX_DATA_SRC as A,DB2ADMIN.MDX_DATA_SRC as B WHERE (A.'LAST_NAME' is not recognized as an internal or external command,operable program or batch file.= B.'LAST_NAME' is not recognized as an inte
regards
bmsk