The table is EVENT, the ID is Event_ID and is a VARCHAR(24) field type. When I select using the following statement I am returned records than I should. Note the values in position 20:
SELECT * FROM EVENT WHERE EVENT_ID = 200502222010100101030100
RETURNS THESE VALUES:
200502222010100101010100
200502222010100101020100
200502222010100101030100
I should only be retrieving the LAST record. Is there a limit to the length of a record ID beyond which all characters are dropped if all others are identical that preceed it?
Data Length Limit Is Select?Select of 24 char VARCHAR retrieves more
Page 1 of 1
4 Replies - 1947 Views - Last Post: 02 March 2005 - 07:54 AM
Replies To: Data Length Limit Is Select?
#2
Re: Data Length Limit Is Select?
Posted 22 February 2005 - 06:13 PM
I might be wrong, but since the fieldtype is varchar, shouldn't you put quotes around the value in the where clause?
Only numbers and dates can go without quotes I believe.
Only numbers and dates can go without quotes I believe.
#3
Re: Data Length Limit Is Select?
Posted 22 February 2005 - 07:17 PM
You are not wrong...the query is returning all due to the lack of quotes when looking for a string.
#4
Re: Data Length Limit Is Select?
Posted 02 March 2005 - 05:57 AM
just out of curiosity....what is the maximum amount of characters varchar can take?
And aren't we supposed to use varchar2 instead of varchar? I read someplace that varchar is reserved for later versions and instead we should use varchar2...is this true?
And aren't we supposed to use varchar2 instead of varchar? I read someplace that varchar is reserved for later versions and instead we should use varchar2...is this true?
#5
Re: Data Length Limit Is Select?
Posted 02 March 2005 - 07:54 AM
Your question depends on the database being used...while similar, there are many differences between db software architectures, including field length. For example, Access (not my reccomendation) does not carry a varchar type in later releases, only text type. MS SQL, however, has an 8000 character limit on it's varchar type.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|