February 16, 2005 at 5:29 am
Hi gurus,
I have a table with Image field which suppose to store the wav files. I want to list the records only the records which has a wav file.
it should like
Select * from Tablename Where ImageField <> ''
My Blog:
February 16, 2005 at 8:34 am
have you tried:
Select * from Tablename Where Substring(ImageField ,8,4) ='WAVE'
HTH
* Noel
February 16, 2005 at 9:42 am
Well, can u to a substring function for a image field? I doubt.
My Blog:
February 16, 2005 at 10:01 am
Well, You shouldn't
create table mytable ( i int, dta image)
insert into myTable (i , dta) values( 1 , 'TESTING IMAGE')
select i, dta , cast(substring(dta,1,4) as char(4)) Str
from mytable
Results:
i dta Str
----------- ----------------------------- ----
1 0x54455354494E4720494D414745 TEST
(1 row(s) affected)
by the way you will have to cast the substring in my previous post
HTH
* Noel
February 16, 2005 at 7:52 pm
thankx it works!!!
My Blog:
February 17, 2005 at 5:20 am
Why not store the content type in a separate field? That way you are not casting on an image field. Seems faster and clearer if done that way.
Mike
February 17, 2005 at 7:20 am
Do you store content other than WAV files in this field? If not, isn't the field NULL if there's no WAV file? If so then
Select * from tablename where imagefield is null
would seem to be the best way...
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply