Subject RE: [firebird-support] sql question
Author Henrik Sitter
Hi, Milan.

I tried the following at it seems to do the trick:

if (exists(select 1 TABLENAME, COLUMNNAME, cast(COLUMNVALUE as Integer)
from USED_TABLE
where ((TABLENAME = 'ARTNR_SW_TABELL') and (COLUMNNAME =
'SW_ARTNR') and (COLUMNVALUE = :IN_SW_ARTNR)) )) then
begin
.
.
end

I'm not 100% sure about the syntax I must admit...

Thx,
Henrik

-----Original Message-----
From: Milan Babuskov [mailto:albis@...]
Sent: 21. januar 2004 15:04
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] sql question

Henrik Sitter wrote:
> I have a stored procedure with some input parameters, and one is an
> integer that I would like to convert/cast from integer to varchar.
This
> casted value is used in a where clause:
>
> if (exists(select 1 from USED_TABLE where ((TABLENAME = 'tableOne')
and
> (COLUMNNAME = 'colOne') and (COLUMNVALUE = :IN_INT)) )) then begin
>
> It is the input parameter IN_INT that needs to be casted to varchar.
>
> Anyone?

Have you tried: CAST(:IN_INT as varchar(33)) ?
How does DDL from USER_TABLE look like?

--
Milan Babuskov
http://fbexport.sourceforge.net





Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/