Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP-FB Write Description for Table and Field using SPT
Message
From
25/11/2004 05:53:56
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
00964236
Message ID:
00964635
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Dorin
>
>If you remember I had sent you a Table Builder for VFP. I was updating just that code to do the same for FB tables via VFP, that is where this problem can from.
>
>Just got this thought for confirmation from you. Right now I can only create FB tables but when I reach the part where an existing table is requried to be updated, I can use the above IBExpert code also to retrieve the desciption for the table and fields?
>

Yes
SELECT RDB$DESCRIPTION FROM RDB$RELATION_FIELDS WHERE RDB$RELATION_NAME = :table_name ;
    AND RDB$FIELD_NAME = :field_name
>Is there any place in metadata where the fields type (INTERGER, CHAR, VARCHAR) and it's properties are store for retrieval?
>
>That should wrap up the Table Builder update for FB <g>.
>

Actually, metadata info for fields are stored in 4 system tables: RDB@RELATIONS, RDB@RELATION_FIELDS, RDB$FIELDS and RDB$TYPES

This command will gather info from all 4 system tables
SELECT a.RDB$RELATION_NAME, b.RDB$FIELD_NAME, b.RDB$FIELD_ID, d.RDB$TYPE_NAME,
       c.RDB$FIELD_LENGTH, c.RDB$FIELD_SCALE
FROM   RDB$RELATIONS a
INNER JOIN RDB$RELATION_FIELDS b
ON     a.RDB$RELATION_NAME = b.RDB$RELATION_NAME
INNER JOIN RDB$FIELDS c
ON     b.RDB$FIELD_SOURCE = c.RDB$FIELD_NAME
INNER JOIN RDB$TYPES d
ON     c.RDB$FIELD_TYPE = d.RDB$TYPE
WHERE  a.RDB$SYSTEM_FLAG = 0
  AND  d.RDB$FIELD_NAME = 'RDB$FIELD_TYPE'
ORDER BY a.RDB$RELATION_NAME, b.RDB$FIELD_ID
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform