Hi,
I'm using below query in universe stage in a server job and facing below error in view data.
QUERY:
SELECT A.NAME AS JOB_NAME,
CASE WHEN A.JOBNO=B.OBJIDNO AND B.OLETYPE LIKE'%Stage%' AND B.NAME LIKE'Src%' THEN B.NAME END AS SRC_STAGE_NAME,
CASE WHEN A.JOBNO=B.OBJIDNO AND B.OLETYPE LIKE'%Stage%' AND B.NAME LIKE'Ds%' THEN B.NAME END AS DS_STAGE_NAME
FROM DS_JOBS A,DS_JOBOBJECTS B
WHERE A.NAME IN('<JOBNAME>')
ERROR:
SYNTAX ERROR. UNEXPECTED VERB. TOKEN WAS "SELECT".SCANNED COMMAND WAS SELECT
ERROR WHILE QUERYING FROM DS TABLES IN UNIVERSE STAGE
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 30
- Joined: Wed May 15, 2013 1:22 am
- Location: Bangalore
ERROR WHILE QUERYING FROM DS TABLES IN UNIVERSE STAGE
Cheers,
Schindler
Schindler
I don't have access to the documentation here, but I believe that the CASE isn't supported, since when I remove the two CASEs I get a valid result.
Note that the SELECT statement in UniVerse is parsed differently depending upon whether it is a Pick style SELECT or a SQL style SELECT.
Note that the SELECT statement in UniVerse is parsed differently depending upon whether it is a Pick style SELECT or a SQL style SELECT.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Arnd is correct on both counts; CASE is not supported (use EVAL and an I-type expression), and you have not created a "UniVerse" SQL statement because your statement lacks a terminating semi-colon, so you've got an invalid RetrieVe SELECT statement.
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.
-
- Participant
- Posts: 30
- Joined: Wed May 15, 2013 1:22 am
- Location: Bangalore
-
- Participant
- Posts: 30
- Joined: Wed May 15, 2013 1:22 am
- Location: Bangalore
Hi Team,
I'm using below query to get source stage and target stage,but its returning deuplicates:
QUERY:
OUTPUT:
JOB_NAME SRC_STAGE TGT_STAGE
JOBA SRC_STG TGT
JOBA SRC_STG TGT_STAGE
JOBA SRC_STG TGT_OP
JOBA SRC_STG TGT_DS
JOBA SRC_STG TGT_OUTPUT
But if i use below query ,showing datasource is empty:
Please help me with a query to get source stage and target stage.
I'm using below query to get source stage and target stage,but its returning deuplicates:
QUERY:
Code: Select all
SELECT A.NAME AS JOB_NAME,
B.NAME AS SRC_STAGE,
C.NAME AS TGT_STAGE
FROM DS_JOBS A,
DS_JOBOBJECTS B,
DS_JOBOBJECTS C
WHERE A.JOBNO=B.OBJIDNO
AND B.OLETYPE LIKE'%Stage%'
AND B.NAME LIKE'SRC%'
AND C.OLETYPE LIKE'%Stage%'
AND C.NAME LIKE'TGT%'
OUTPUT:
JOB_NAME SRC_STAGE TGT_STAGE
JOBA SRC_STG TGT
JOBA SRC_STG TGT_STAGE
JOBA SRC_STG TGT_OP
JOBA SRC_STG TGT_DS
JOBA SRC_STG TGT_OUTPUT
But if i use below query ,showing datasource is empty:
Code: Select all
SELECT A.NAME AS JOB_NAME,
B.NAME AS SRC_STAGE,
C.NAME AS TGT_STAGE
FROM DS_JOBS A,
DS_JOBOBJECTS B,
DS_JOBOBJECTS C
WHERE A.JOBNO=B.OBJIDNO
AND B.OLETYPE LIKE'%Stage%'
AND B.NAME LIKE'SRC%'
AND C.OLETYPE LIKE'%Stage%'
AND C.NAME LIKE'TGT%'
and A.JOBNO=C.OBJIDNO
Cheers,
Schindler
Schindler
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Source and target stage are not in the same DS_JOBOBJECTS record, as you've noticed. It might be a better approach to UNION two queries (one for source stages and one for target stages). The technically correct approach is to determine the link records in DS_JOBOBJECTS, on which the DSRIDs of the stages connected by the link are recorded, then retrieve those.
If you have a link naming convention (for example target-writing links have names ending in "_OUT") this would be even easier.
If you have a link naming convention (for example target-writing links have names ending in "_OUT") this would be even easier.
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.