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 > Database Server Software > DB2 > SQL0104 - Token * not valid

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-06-09, 08:52
jacven jacven is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
SQL0104 - Token * not valid

Hello I am trying to extract data from DB2 using this query

SELECT T2.CIADNH, T2.DPTDNH, T2.FICDNH, T1.APEFI1, T1.NOMFI1, T2.CTODNH, T3.DESCTO, T2.CANDNH, T2.MONDNH, T2.PRDDNH, T2.AÑODNH
FROM SPIDATA.NMPP060 T1, SPIDATA.NMPP099 T2, SPIDATA.NMPP027 T3
WHERE (T2.CTODNH In (011.071.072))

but I get the following msg

SQL0104 - Token .072 was not valid. Valid tokens: ,.

If I take out the .072 from the query it does work

Can anyone please help me?
Thanks in advanced.
Reply With Quote
  #2 (permalink)  
Old 05-06-09, 09:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What data type is T2.CTODNH?

If it is numeric, then 011.071.072 is nat a valid numeric expression.
If it is character the it is not a valid character expression.


Andy
Reply With Quote
  #3 (permalink)  
Old 05-06-09, 10:07
jacven jacven is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
Quote:
Originally Posted by ARWinner
What data type is T2.CTODNH?

If it is numeric, then 011.071.072 is nat a valid numeric expression.
If it is character the it is not a valid character expression.


Andy
Hello ARWinner in both cases what should be the correct format?
I did a query for T2.CTODNH and result data was
10
96
103

I think it is numeric
Thank you
Reply With Quote
  #4 (permalink)  
Old 05-06-09, 10:10
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
run
describe table SPIDATA.NMPP099

and post it here
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #5 (permalink)  
Old 05-06-09, 10:11
jacven jacven is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
Quote:
Originally Posted by Cougar8000
run
describe table SPIDATA.NMPP099

and post it here
Cougar8000 unfortunately I am the in control of that information I only have access to extract data from the DB2 server

What other choice do I have?
Thank you.
Reply With Quote
  #6 (permalink)  
Old 05-06-09, 10:18
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Well assuming it is numeric, then the list would look like this:

(T2.CTODNH In (11,71,72))

Andy
Reply With Quote
  #7 (permalink)  
Old 05-06-09, 10:21
jacven jacven is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
Quote:
Originally Posted by ARWinner
Well assuming it is numeric, then the list would look like this:

(T2.CTODNH In (11,71,72))

Andy
I tried but I am getting the following error:

SQL0104 - Token .072 was not valid. Valid tokens: ,.

This way, it works

WHERE (T2.CTODNH In (011,071))

This way, it doesn't

WHERE (T2.CTODNH In (011,071,072))

Thx.
Reply With Quote
  #8 (permalink)  
Old 05-06-09, 10:26
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Quote:
Originally Posted by jacven
SQL0104 - Token .072 was not valid. Valid tokens: ,.
This error indicates you are still using the period (.) instead of the comma (,) for separating the numbers.

Andy
Reply With Quote
  #9 (permalink)  
Old 05-06-09, 10:30
jacven jacven is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
Quote:
Originally Posted by ARWinner
This error indicates you are still using the period (.) instead of the comma (,) for separating the numbers.

Andy
Sorry Andy but I don't get it if I am using this

WHERE (T2.CTODNH In (011,071))

I am not using (.) to separate the numbers what could be wrong?

Thx again.
Reply With Quote
  #10 (permalink)  
Old 05-06-09, 10:33
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
If it is numeric, try removing the leading zeros from the numbers.

Andy
Reply With Quote
  #11 (permalink)  
Old 05-06-09, 13:27
jacven jacven is offline
Registered User
 
Join Date: Oct 2007
Posts: 13
Hello Andy sorry to bother you again, nothing yet friend, still getting the same error, I tried what you mentioned. I am trying to extract the data from MS Query the option in Excel 2007, in the SQL statement I build my query there, does this have anything to do? thanks.
Reply With Quote
  #12 (permalink)  
Old 05-06-09, 13:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Can you try the query using the CLP instead of Access?

Andy
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