Subject | Re: System Tables column sizes |
---|---|
Author | buppcpp |
Post date | 2005-05-30T11:44:11Z |
But when you are use ADO, ODBC, etc.. within Borland Products and
you do
something like:
if (FieldByName("rdb$relation_name")->AsString == "STORE_NO")
If fails.
This seems like an unnecessary burden, that could be easily fixed by
defining the system tables as VARCHAR instead of CHAR.
--- In firebird-support@yahoogroups.com, Thomas Steinmaurer
<ts@i...> wrote:
you do
something like:
if (FieldByName("rdb$relation_name")->AsString == "STORE_NO")
If fails.
This seems like an unnecessary burden, that could be easily fixed by
defining the system tables as VARCHAR instead of CHAR.
--- In firebird-support@yahoogroups.com, Thomas Steinmaurer
<ts@i...> wrote:
> > When querying the system table (ie. RDB$RELATIONS) and pull inthe
> > rdb$relation_name, no matter what data the field may hold, italways
> > come back with a data size of 31!data
> >
> > Example: If rdb$relation_name equals 'STORE_NO', it will have a
> > size of 31 when actually, it's 8.makes
> >
> > I know that this is because the tables are defined as CHAR types
> > instead of VARCHAR.
> >
> > But because it always comes back with the defined data size it
> > it extremely difficult to match to the data correctly.without
> >
> > Is there some way to get this data to work like VARCHAR's
> > having to TRIM everything, it's a real pain, when it doesn'thave to
> > be.
>
> The '=' operator will ignore that:
>
> select rdb$relation_name from rdb$relations
> where rdb$relation_name = 'RDB$RELATIONS';
>
> => Returns 1 record.
>
>
> Where as the LIKE operator won't ignore that:
>
> select rdb$relation_name from rdb$relations
> where rdb$relation_name LIKE 'RDB$RELATIONS'
>
> => Returns 0 records.
>
>
> The following will return 1 records again (watch the wrap):
>
> select rdb$relation_name from rdb$relations
> where rdb$relation_name like 'RDB$RELATIONS '
>
>
>
> --
> HTH,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2 (NEW!)
> Upscene Productions
> http://www.upscene.com