If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Help - SQL Keyword Error (SQLCODE -199)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-31-03, 12:49
Jukie Jukie is offline
Registered User
 
Join Date: Dec 2003
Location: Kansas City
Posts: 1
Post Help - SQL Keyword Error (SQLCODE -199)

I continue to receive an error (SQLCODE -199) on a statement that works in other sql programs. I have looked and looked at it, it looks fine to me. Can someone please look at the following code and tell me if you see any reason for the error? Object XSROLOTV1 in library GPSMODS not found. The error I receive is below.
Any help is appreciated. Thank you.

ERROR -
Object XSROLOTV1 in GPSMODS type *FILE not found.
Object XSROLOTV1 in QTEMP type *QMQRY deleted.
IMPORT source record length exceeds 79 characters.
Warnings issued on IMPORT QUERY command.
IMPORT operation completed successfully.
Warning returned by query management.
Keyword FROM not expected. Valid tokens: ) ,.
RUN QUERY command failed with SQLCODE -199.
RUN QUERY command ended due to error.
STRQMQRY command failed.
Function check. QWM2701 unmonitored by RUNGPSSQL at statement 13200,


SQL -

(INT(YEAR(DATE((DAYS(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 TO 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) - INT(LTDDAT/10000)*100))/100) FROM 2 FOR 2) || '-' || SUBSTR(CHAR(DEC(LTDDAT - INT(LTDDAT/100)*100)/100) FROM 2 FOR 2) ))) - (DAYOFWEEK(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 FOR 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) - INT(LTDDAT/10000)*100))/100)) FROM 2 FOR 2) || '-' || SUBSTR(CHAR(DEC(LTDDAT - INT(LTDDAT/100)*100)/100) FROM 2 FOR 2)))) + 1))) *100)

+

INT(WEEK(DATE((DAYS(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 FOR 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) -INT(LTDDAT/10000)*100))/100) FROM 2 FOR 2 || '-' || SUBSTR(CHAR(DEC(LTDDAT - UBT(LTDDAT/100)*100)/100) FROM 2 FOR 2)))) (DAYOFWEEK(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 FOR 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) - INT(LTDDAT/10000)*100))/100) FROM 2 FOR 2 || '-' || SUBSTR(CHAR(DEC(LTDDAT -INT(LTDDAT/100)*100)/100) FROM 2 FOR 2)))) + 1))) AS LTDDATYW
Reply With Quote
  #2 (permalink)  
Old 01-08-04, 14:44
markrem markrem is offline
Registered User
 
Join Date: Sep 2003
Location: Virginia, USA
Posts: 246
You can't pass the keyword FROM as a column alias within a SUBSTR function.

... SUBSTR(CHAR(DEC(LTDDAT-INT(LTDDAT/100)*100)/100) FROM 2 FOR 2)

Isn't the syntax supposed to be SUBSTR(string, start, length). The parenthesis after 2 FOR 2 ends the SUBSTR function.

Find the integer value, multiply by 100, subtract fro LTDDAT, convert to decimal, divide by 100, convert to character, then find a Substring within that resulting character string.

Maybe you only need to replace FROM with a comma, and replace FOR with a comma. the rest looks good.
__________________
MarkRem
Author, Oracle Database 10g: From Nuts to Soup
http://www.remidata.com/book_nuts2soup.htm
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On