🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
2 messages
2 total messages Started by Stefan Thu, 19 Jun 2008 14:21
Assignment compatibility between Blob and Varchar
#247
Author: Stefan
Date: Thu, 19 Jun 2008 14:21
47 lines
2071 bytes
In some posting to the Interbase NGs I have read that it should be 
possible to make assignments in Interbase 2007 from Blob fields to 
Varchar fields (at least that is was what I understood).

I couldn't find any further information on this in the Interbase 
documentation set and so I tried with a simple procedure:

SET TERM ^ ;

CREATE PROCEDURE PRUEBAS
RETURNS (
     S_MEMO BLOB SUB_TYPE 1 SEGMENT SIZE 80,
     S_VARCHAR VARCHAR(1024))
AS
BEGIN
   S_VARCHAR = 'TEST';
   S_MEMO = S_VARCHAR;
   SUSPEND;
   S_MEMO = '2ND TEST';
   S_VARCHAR = S_MEMO;
   SUSPEND;
END^

SET TERM ; ^

When executing this procedure I get an internal error in the
line
S_VARCHAR = S_MEMO;

Without that line it seems to work.

Can anyone explain to me what assignments are possible in Interbase 2007 
between Blob and Varchar? Or point me to some source of information?

For example, would it be possible to do something like this:

SELECT BLOB_FIELD, VARCHAR_FIELD FROM MYTABLE
INTO M_VARCHAR_VARIABLE, M_BLOB_VARIABLE;

Thanks for any help.


-- 
Stefan Sinne

Email: _DT_ = .
        _AT_ = @
Re: Assignment compatibility between Blob and Varchar
#248
Author: Wayne Niddery (TeamB)
Date: Thu, 19 Jun 2008 14:54
14 lines
1819 bytes
"Stefan" <stefan_DT_sinne_AT_gmx_DT_de> wrote in message 
news:485a6b82@newsgroups.borland.com...
>
> Can anyone explain to me what assignments are possible in Interbase 2007 
> between Blob and Varchar? Or point me to some source of information?

You are safe assigning a varchar to a blob, but going the other way always 
presents a potential problem since a blob can easily exceed the size limit 
of a varchar. So while it might work in limited circumstances, I would avoid 
assigning blobs to anything else.

-- 
Wayne Niddery - TeamB (www.teamb.com)
Winwright, Inc. (www.winwright.ca) 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads