Re: Byte data
Posted in 2004
Topics: Server Administration, Migration, Import/Export & Data Conversion, Versions, Editions & End-of-Life
After reading the manual and going through the CDI archives, I think I need
to use the LOTOFILE function
I tried the following SQL and got the error ... "674: Routine (lotofile) can
not be resolved.". I tried running as a user as well as Informix. What am I
doing wrong? Thanks!
SELECT media_id, LOTOFILE(data, 'fname', 'server')
FROM dcs_media_bin
WHERE media_id = 'm20264'
"Rajesh Kapur" <rkapur@mpr.org> wrote in message
news:41c1df07$0$80348$a1866201@visi.com...
>I have a vendor supplied application. The images (JPG format) are stored in
>a byte field within IDS 9.4 database. I need to download these images to
>individual jpg files to be served as static content. I used the unload
>command in dbaccess. The resulting file has binary data. I ftp'd the file
>to the desktop in the binary mode. The file does not open with the windows
>viewer. The error message is ... 'no preview available'. I do not have any
>experience working with byte fields. Can someone please point me in the
>right direction?.... Thanks! Rajesh
>
"Rajesh Kapur" <rkapur@mpr.org> wrote :
> After reading the manual and going through the CDI archives, I think I
need
> to use the LOTOFILE function
>
> I tried the following SQL and got the error ... "674: Routine (lotofile)
can
> not be resolved.". I tried running as a user as well as Informix. What am
I
> doing wrong? Thanks!
>
> SELECT media_id, LOTOFILE(data, 'fname', 'server')
> FROM dcs_media_bin
> WHERE media_id = 'm20264'
I don't have a complete answer for you, but I hope I might be able to help
get you in the right direction.
The LOTOFILE function expects to work with smart large objects (BLOB or
CLOB); in your first message you said that you are working with simple large
objects (BYTE). The database server does provide a cast from simple to
smart large objects. You could try something like:
SELECT media_id, LOTOFILE(data::BLOB, 'fname', 'server')...
That should get you past the 674 error. Be prepared, however, for new
errors if you do not have an sbspace defined. One other thing - the
documentation states that if you use 'server' as the file destination, the
pathname that you specify must be a full pathname. Either a full or
relative pathname could be given if you were to use 'client'.
I don't know if this is going to help with your original issue or not, but I
hope this helps as you work through the problem.
> "Rajesh Kapur" <rkapur@mpr.org> wrote in message
> news:41c1df07$0$80348$a1866201@visi.com...
> >I have a vendor supplied application. The images (JPG format) are stored
in
> >a byte field within IDS 9.4 database. I need to download these images to
> >individual jpg files to be served as static content. I used the unload
> >command in dbaccess. The resulting file has binary data. I ftp'd the file
> >to the desktop in the binary mode. The file does not open with the
windows
> >viewer. The error message is ... 'no preview available'. I do not have
any
> >experience working with byte fields. Can someone please point me in the
> >right direction?.... Thanks! Rajesh
--
June Hunt