regarding query repository
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 228
- Joined: Tue Oct 03, 2006 7:08 pm
regarding query repository
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
anyone help me plz.
cheers;
vijay
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 228
- Joined: Tue Oct 03, 2006 7:08 pm
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.
Finding answers is simple, all you need to do is come up with the correct questions.
-
- Participant
- Posts: 228
- Joined: Tue Oct 03, 2006 7:08 pm
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
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
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.
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.
Finding answers is simple, all you need to do is come up with the correct questions.
And the OLETYPE for Jobs are 'CJobDefn'.
So if you change your query as following you can get the result.
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'
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.