regarding query repository

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

regarding query repository

Post by vijaykumar »

from the command line interface iam giving command select @ID,NAME where @ID like '%ROOT%' from DS_JOBOBJECTS, iam getting error unexpected verb token was taken was "SELECT" scanned was select.
anyone help me plz.

cheers;
vijay
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Which command line?

What precisely is the error message?

Did you make any typing errors when entering the query? It may be that the query environment has not been advised that the backspace key is also the erase key.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

Hi Gurus;
plz help me

iam tying from the command interface.

select @ID,NAME "JOB_NAME" where @id like '%ROOT' from DS_JOBOBJECTS.

why is my select statement not working, is that the syntax error.iam getting below error

ERROR:illegal use of verb select.

cheers;
vijay
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Try

Code: Select all

select @ID,NAME "JOB_NAME" from DS_JOBOBJECTS where @ID like '%ROOT';
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

So its simple 'FROM' 'WHERE' statement misplace.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

hi,
Thanks very much, i didn't get any error but the query is not displaying o/p, it doesn't comeup with errors but doesnot give any o/p.

i have tried the other query also, i have given.

select @ID,NAME "JOB_NAME",OBJID,OBJTYPE,OBJNAME,OBJIDNO FROM DS_JOBOBJECTS where @ID like '%ROOT' and OLETYPE like '%DEFN' and OBJTYPE = 'J' orderby OBJIDNO.

the problem is iam not getting any error but the query doesn't write any o/p.it doesn't display any o/p.

plz coorect me if i have done any syntax mistakes.

cheers;
abhi
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

A slight syntax problem. It is order by and not orderby
Other than that the syntax is ok.
You are not getting any results because you might not have any results matching your query criteria. Check your where clause to match your requirement.

Code: Select all

select @ID,NAME "JOB_NAME",OBJID,OBJTYPE,OBJNAME,OBJIDNO FROM DS_JOBOBJECTS where @ID like '%ROOT' and OLETYPE like '%DEFN' and OBJTYPE = 'J' order by OBJIDNO;
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

And the OLETYPE for Jobs are 'CJobDefn'.
So if you change your query as following you can get the result.

Code: Select all

select @ID,NAME "JOB_NAME",OBJID,OBJTYPE,OBJNAME,OBJIDNO FROM DS_JOBOBJECTS where @ID like '%ROOT' and OLETYPE like '%Defn' and  OBJTYPE = 'J' order by OBJIDNO
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The point made by narasimha is that data values are case sensitive. This is true in all databases.

This is why "DEFN" did not return any rows; the correct partial value is "Defn".

Beware also that OBJIDNO is not a numeric data type, so sorting by it will give "numbers" sorted alphabetically 1, 10, 100, 101, 11, 110, 111, 2, ...

If you do want to sort, ORDER BY is two words, not one. This is true in all forms of SQL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply