relational data base
Posted in 2000
Topics: General Discussion
hello. I'm trying to build a data base, that has to relate a specific field id to another table in the data base. Something like this: tb1.name -> tb2 where tb1.name is a string equal to the tb2 data base name. how is this relation done? How can I select a determine table, depending on the name field of the tb1 table? Thanks -- "And I'm happy, because you make me feel good, about me." - Melvin Udall ----------------------------------------------------------------- Mart'n Marqu's email: martin@math.unl.edu.ar Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------
if you are thinking of keeping metadata
information about the objects themselves that hold the data
you will need more than the field name to track the object.
i.e.; you can hold the tablename in a field called table varchar(18)
but to use it you will need more, such as a primary key ,
to use it in a select clause.
for example
create table meta (
business_rule integer,
business_rule_desc lvarchar,
tablename varchar(18) ,
database varchar(18)
primary key (business_rule)
... );
create table objects
pk serial,
database varchar(18),
tablename varchar(18)
...);is this what you were talking about?
"Martin A. Marques" wrote:
> hello.
> I'm trying to build a data base, that has to relate a specific field id to
> another table in the data base.
> Something like this:
>
> tb1.name -> tb2
>
> where tb1.name is a string equal to the tb2 data base name. how is this
> relation done? How can I select a determine table, depending on the name
> field of the tb1 table?
>
> Thanks
>
> --
> "And I'm happy, because you make me feel good, about me." - Melvin Udall
> -----------------------------------------------------------------
> Martín Marqués email: martin@math.unl.edu.ar
> Santa Fe - Argentina http://math.unl.edu.ar/~martin/
> Administrador de sistemas en math.unl.edu.ar
> -----------------------------------------------------------------