Subject Re: Detect all currency field in a database
Author svanderclock
ok, but in this way how to know in a select result that a field is D_Currency ? i mean from the API

the purpose is when i do

select
myfield
from
mytable

know in the query result than myfield is of type D_Currency.
For now i use the SQLDA.SQLType and SqlScale to know if it's NUMERIC(15,5) field or not ...

thanks you again
stephane


--- In firebird-support@yahoogroups.com, "Martijn Tonies" <m.tonies@...> wrote:
>
> Hello Stephane,
>
> > I want to know if it's possible to detect all currency field in a
> > database? for now i use this "trick": only currency field are
> > Numeric(15,5) but i just want to know if their is no better way to put a
> > "flag" or a comment on a field to indicate that it's store currency ?
> >
> > Also how to make a storedprocedure that will update in a database ALL
> > field that are Numeric(15,5) ?
>
> Firebird doesn't have a Currency type, the best thing you
> can do for your database is to create a domain for
> currency:
>
>
> create domain D_Currency as numeric(15, 5)
>
> and use that for tables and so on:
>
> create table mytab ( mycol D_Currency );
>
>
> That way, you know when you're actually dealing with a currency type
> as opposed to just another numeric.
>
> With regards,
>
> Martijn Tonies
> Upscene Productions
> http://www.upscene.com
>
> Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
> Anywhere, MySQL, InterBase, NexusDB and Firebird!
>
> Database questions? Check the forum:
> http://www.databasedevelopmentforum.com
>