Can someone point me in the right direction. I'm trying to do the following in uv:
UPDATE RT_LOG1111 SET TYPE = 0 WHERE @ID LIKE '//SEQUENCE.NO%';
The problem is that I can't seem to use LIKE on @ID ("DataStage/SQL: The LIKE operator may only be used with character data")
Ogmios.
comparing to @ID
Moderators: chulett, rschirm, roy
Ogmios
If you edit the dictionary item for @ID in RT_LOG then it looks like this:
>ED DICT RT_LOG @ID
6 lines long.
----: P
0001: D Default record ID for RetrieVe
0002: 0
0003:
0004: RT_LOG
0005: 10'0'R
0006: S
Bottom at line 6.
----:
Field 5 is the problem. It does not want to use a number in a "LIKE" phrase. You can create a new dictionary item called "ID" and use it or:
UPDATE RT_LOG1111 SET TYPE = 0 WHERE EVAL "@ID" LIKE '//SEQUENCE.NO%';
This works fine. I tried it. I wanted to beat Ray to the punch.
Kim.
Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
If you edit the dictionary item for @ID in RT_LOG then it looks like this:
>ED DICT RT_LOG @ID
6 lines long.
----: P
0001: D Default record ID for RetrieVe
0002: 0
0003:
0004: RT_LOG
0005: 10'0'R
0006: S
Bottom at line 6.
----:
Field 5 is the problem. It does not want to use a number in a "LIKE" phrase. You can create a new dictionary item called "ID" and use it or:
UPDATE RT_LOG1111 SET TYPE = 0 WHERE EVAL "@ID" LIKE '//SEQUENCE.NO%';
This works fine. I tried it. I wanted to beat Ray to the punch.
Kim.
Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The technically correct way in SQL is to use a CAST.
UPDATE RT_LOG1111 SET TYPE = 0 WHERE CAST (@ID AS VARCHAR) LIKE '//SEQUENCE.NO%';
You can use CHAR or VARCHAR, though with CHAR you will also need a maximum length (VARCHAR has a default maximum length of 254). The LIKE operator requires string data to compare to the pattern.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
UPDATE RT_LOG1111 SET TYPE = 0 WHERE CAST (@ID AS VARCHAR) LIKE '//SEQUENCE.NO%';
You can use CHAR or VARCHAR, though with CHAR you will also need a maximum length (VARCHAR has a default maximum length of 254). The LIKE operator requires string data to compare to the pattern.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Ray
Can't take a joke? CAST same as EVAL.
Kim.
Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
Can't take a joke? CAST same as EVAL.
Kim.
Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
More DS users are likely to be familiar with CAST (which is part of the SQL standards) than with EVAL, which isn't the same thing at all.
CAST effects a temporary data type change, EVAL generates am on-the-fly value.
Yes, I can take a joke (just see my pictures on DSXchange), but I also like to be accurate as much as possible.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
CAST effects a temporary data type change, EVAL generates am on-the-fly value.
Yes, I can take a joke (just see my pictures on DSXchange), but I also like to be accurate as much as possible.
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518