f



Get all child table and key names of a parent table

select stab.tabname Parent,
       scol.colname Primary_key,
       sstab.tabname Child,
       sscol.colname Child_key
from   syscolumns scol,
       syscolumns sscol,
       sysindexes sind,
       sysindexes ssind,
       sysconstraints scon,
       sysconstraints sscon,
       systables stab,
       systables sstab,
       sysreferences sref
where  scol.tabid=sind.tabid
and    scol.colno = sind.part1
and    sind.idxname=scon.idxname
and    stab.tabid=scon.tabid
and    sstab.tabid=sscon.tabid
and    sscol.tabid = ssind.tabid
and    (sscol.colno = ssind.part1 or sscol.colno = ssind.part2)
and    sscon.idxname=ssind.idxname
and    sref.constrid=sscon.constrid
and    stab.tabid=sref.ptabid
and    stab.tabname='ParentTableName'

 above query works gr8 when single column primary key in Parent table,
but when there is two or morecolumn primary key it does not gives right
ans. plz try  to solve..

0
Kuldeep
4/11/2006 10:53:24 AM
comp.databases.informix 16083 articles. 0 followers. Post Follow

5 Replies
1020 Views

Similar Articles

[PageSpeed] 57

"Kuldeep" <kuldeepchitrakar@gmail.com> wrote in message 
news:1144752804.917120.279890@i39g2000cwa.googlegroups.com...

> select stab.tabname Parent,
>        scol.colname Primary_key,
>        sstab.tabname Child,
>        sscol.colname Child_key
> from   syscolumns scol,
>        syscolumns sscol,
>        sysindexes sind,
>        sysindexes ssind,
>        sysconstraints scon,
>        sysconstraints sscon,
>        systables stab,
>        systables sstab,
>        sysreferences sref
> where  scol.tabid=sind.tabid
> and    scol.colno = sind.part1
> and    sind.idxname=scon.idxname
> and    stab.tabid=scon.tabid
> and    sstab.tabid=sscon.tabid
> and    sscol.tabid = ssind.tabid
> and    (sscol.colno = ssind.part1 or sscol.colno = ssind.part2)
> and    sscon.idxname=ssind.idxname
> and    sref.constrid=sscon.constrid
> and    stab.tabid=sref.ptabid
> and    stab.tabname='ParentTableName'
>
> above query works gr8 when single column primary key in Parent table,
> but when there is two or morecolumn primary key it does not gives right
> ans. plz try to solve..

How about this:

    CREATE PROCEDURE index_columns(index_name VARCHAR(128))
        RETURNING VARCHAR(255);

        -- Fetch the list of columns names in an index
        -- Doug Lawry, comp.databases.informix, 11 April 2006

        DEFINE column_name VARCHAR(128);
        DEFINE column_list VARCHAR(255);

        LET column_list = '';

        FOREACH

            SELECT  colname
            INTO    column_name
            FROM    sysindexes, syscolumns
            WHERE   idxname = index_name
            AND     sysindexes.tabid = syscolumns.tabid
            AND     colno IN (
                        part1,  part2,  part3,  part4,
                        part5,  part6,  part7,  part8,
                        part9,  part10, part11, part12,
                        part13, part14, part15, part16
                    )

            LET column_list = column_list || ', ' || column_name;

        END FOREACH

        RETURN column_list[3,255];

    END PROCEDURE;

    SELECT  TAB1.tabname parent, index_columns(CON1.idxname) primary_key,
            TAB2.tabname child,  index_columns(CON2.idxname) foreign_key
    FROM    sysreferences REFS,
            sysconstraints CON1,
            sysconstraints CON2,
            systables TAB1,
            systables TAB2
    WHERE   CON1.constrid = REFS.primary
    AND     CON2.constrid = REFS.constrid
    AND     TAB1.tabid = CON1.tabid
    AND     TAB2.tabid = CON2.tabid;

-- 
Regards,
Doug Lawry
www.douglawry.webhop.org


0
Doug
4/11/2006 1:32:21 PM
I use the following select to show me all of the relationships in a
database.
I wrap it with a script to pretty up the output. I can add the shell
script if you need it.

select
  pt.tabname, dt.tabname,
  pc1.colname,
  pc2.colname,
  pc3.colname,
  pc4.colname,
  pc5.colname,
  pc6.colname,
  pc7.colname,
  pc8.colname,
  pc9.colname,
  pc10.colname,
  pc11.colname,
  pc12.colname,
  pc13.colname,
  pc14.colname,
  pc15.colname,
  pc16.colname,
  dc1.colname,
  dc2.colname,
  dc3.colname,
  dc4.colname,
  dc5.colname,
  dc6.colname,
  dc7.colname,
  dc8.colname,
  dc9.colname,
  dc10.colname,
  dc11.colname,
  dc12.colname,
  dc13.colname,
  dc14.colname,
  dc15.colname,
  dc16.colname,
  case drefs.delrule
    when 'C' then 'D'
    else drefs.delrule
  end
from
  sysconstraints dcons, sysconstraints pcons,
  systables pt, systables dt,
  outer syscolumns pc1, outer syscolumns pc2, outer syscolumns pc3,
outer syscolumns pc4,
  outer syscolumns pc5, outer syscolumns pc6, outer syscolumns pc7,
outer syscolumns pc8,
  outer syscolumns pc9, outer syscolumns pc10, outer syscolumns pc11,
outer syscolumns pc12,
  outer syscolumns pc13, outer syscolumns pc14, outer syscolumns pc15,
outer syscolumns pc16,

  outer syscolumns dc1, outer syscolumns dc2, outer syscolumns dc3,
outer syscolumns dc4,
  outer syscolumns dc5, outer syscolumns dc6, outer syscolumns dc7,
outer syscolumns dc8,
  outer syscolumns dc9, outer syscolumns dc10, outer syscolumns dc11,
outer syscolumns dc12,
  outer syscolumns dc13, outer syscolumns dc14, outer syscolumns dc15,
outer syscolumns dc16,

  sysindexes pidx, sysindexes didx,
  sysreferences drefs
where
  dcons.constrtype = "R" and
  dcons.idxname = didx.idxname and
  dcons.constrid = drefs.constrid and
  pcons.constrid = drefs.primary and
  pcons.idxname = pidx.idxname and
  drefs.ptabid = pt.tabid and -- primary table and fields
  pt.tabid = pc1.tabid and pt.tabid = pc2.tabid and pt.tabid =
pc3.tabid and pt.tabid = pc4.tabid and
  pt.tabid = pc5.tabid and pt.tabid = pc6.tabid and pt.tabid =
pc7.tabid and pt.tabid = pc8.tabid and
  pt.tabid = pc9.tabid and pt.tabid = pc10.tabid and pt.tabid =
pc11.tabid and pt.tabid = pc12.tabid and
  pt.tabid = pc13.tabid and pt.tabid = pc14.tabid and pt.tabid =
pc15.tabid and pt.tabid = pc16.tabid and

  pidx.part1 = pc1.colno and pidx.part2 = pc2.colno and pidx.part3 =
pc3.colno and pidx.part4 = pc4.colno and
  pidx.part5 = pc5.colno and pidx.part6 = pc6.colno and pidx.part7 =
pc7.colno and pidx.part8 = pc8.colno and
  pidx.part9 = pc9.colno and pidx.part10 = pc10.colno and pidx.part11 =
pc11.colno and pidx.part12 = pc12.colno and
  pidx.part13 = pc13.colno and pidx.part14 = pc14.colno and pidx.part15
= pc15.colno and pidx.part16 = pc16.colno and

  dcons.tabid = dt.tabid and -- dependent table and fields
  dt.tabid = dc1.tabid and dt.tabid = dc2.tabid and dt.tabid =
dc3.tabid and dt.tabid = dc4.tabid and
  dt.tabid = dc5.tabid and dt.tabid = dc6.tabid and dt.tabid =
dc7.tabid and dt.tabid = dc8.tabid and
  dt.tabid = dc9.tabid and dt.tabid = dc10.tabid and dt.tabid =
dc11.tabid and dt.tabid = dc12.tabid and
  dt.tabid = dc13.tabid and dt.tabid = dc14.tabid and dt.tabid =
dc15.tabid and dt.tabid = dc16.tabid and

  didx.part1 = dc1.colno and didx.part2 = dc2.colno and didx.part3 =
dc3.colno and didx.part4 = dc4.colno and
  didx.part5 = dc5.colno and didx.part6 = dc6.colno and didx.part7 =
dc7.colno and didx.part8 = dc8.colno and
  didx.part9 = dc9.colno and didx.part10 = dc10.colno and didx.part11 =
dc11.colno and didx.part12 = dc12.colno and
  didx.part13 = dc13.colno and didx.part14 = dc14.colno and didx.part15
= dc15.colno and didx.part16 = dc16.colno
  $whereComp
order by
  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
  19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34
;

0
bozon
4/12/2006 3:27:44 PM
I have such a query, but it works not very fast...

Select pt.tabname Parent,
replace(replace(substr(
multiset(select item c.colname from syscolumns c where pt.tabid=c.tabid
and (c.colno in (select part1 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part2 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part3 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part4 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part5 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part6 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part7 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part8 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part9 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part10 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part11 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part12 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part13 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part14 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part15 from sysindexes pi where
pc.idxname=pi.idxname)
 or  c.colno in (select part16 from sysindexes pi where
pc.idxname=pi.idxname))
)::LVARCHAR,11), ''''), '}') Primary_key,
t.tabname Child,
replace(replace(substr(
multiset(select item c.colname from syscolumns c where t.tabid=c.tabid
and (c.colno in (select part1 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part2 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part3 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part4 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part5 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part6 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part7 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part8 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part9 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part10 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part11 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part12 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part13 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part14 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part15 from sysindexes fi where
a.idxname=fi.idxname)
 or  c.colno in (select part16 from sysindexes fi where
a.idxname=fi.idxname))
)::LVARCHAR,11), ''''), '}') Child_key
>From systables pt, sysreferences r, sysconstraints pc,
     sysconstraints a, systables t
Where pt.tabid=r.ptabid and r.primary=pc.constrid
  and r.constrid=a.constrid and a.tabid=t.tabid


Kuldeep wrote:
> select stab.tabname Parent,
>        scol.colname Primary_key,
>        sstab.tabname Child,
>        sscol.colname Child_key
> from   syscolumns scol,
>        syscolumns sscol,
>        sysindexes sind,
>        sysindexes ssind,
>        sysconstraints scon,
>        sysconstraints sscon,
>        systables stab,
>        systables sstab,
>        sysreferences sref
> where  scol.tabid=sind.tabid
> and    scol.colno = sind.part1
> and    sind.idxname=scon.idxname
> and    stab.tabid=scon.tabid
> and    sstab.tabid=sscon.tabid
> and    sscol.tabid = ssind.tabid
> and    (sscol.colno = ssind.part1 or sscol.colno = ssind.part2)
> and    sscon.idxname=ssind.idxname
> and    sref.constrid=sscon.constrid
> and    stab.tabid=sref.ptabid
> and    stab.tabname='ParentTableName'
>
>  above query works gr8 when single column primary key in Parent table,
> but when there is two or morecolumn primary key it does not gives right
> ans. plz try  to solve..

0
SaltTan
4/13/2006 5:50:56 AM
My query is reasonably fast. So you are welcome to try it. I wrap it
with a shell script below to pretty up the output:

#!/usr/bin/ksh

trap "cleanup ; exit" 0 1 2 15

function usage {
   printf "\n\n Usage: %s <database> [table] \n\n" "`basename $0`" 1>&2
   exit 1
}


function errorMsg {
   printf "\n\n ERROR: %s \n\n" "$eMsg" 1>&2
   usage
}


function cleanup {
  rm -f /tmp/scons_$$.out
}


if [ $# -lt 1 -o $# -gt 2 ] ; then
   usage
fi

if [ $# -eq 2 ] ; then
  whereComp="and ( pt.tabname = \"$2\" or dt.tabname = \"$2\" )"
else
  whereComp=""
fi

if [ `sdb | grep $1 | wc -l` -eq 0 ] ; then
  eMsg="Database: $1 not Found"
  errorMsg
fi

dbaccess -e $1 <<EOF 1>/dev/null 2>/dev/null
set isolation to dirty read;
unload to /tmp/scons_$$.out
select
  pt.tabname, dt.tabname,
  pc1.colname,
  pc2.colname,
  pc3.colname,
  pc4.colname,
  pc5.colname,
  pc6.colname,
  pc7.colname,
  pc8.colname,
  pc9.colname,
  pc10.colname,
  pc11.colname,
  pc12.colname,
  pc13.colname,
  pc14.colname,
  pc15.colname,
  pc16.colname,
  dc1.colname,
  dc2.colname,
  dc3.colname,
  dc4.colname,
  dc5.colname,
  dc6.colname,
  dc7.colname,
  dc8.colname,
  dc9.colname,
  dc10.colname,
  dc11.colname,
  dc12.colname,
  dc13.colname,
  dc14.colname,
  dc15.colname,
  dc16.colname,
  case drefs.delrule
    when 'C' then 'D'
    else drefs.delrule
  end
from
  sysconstraints dcons, sysconstraints pcons,
  systables pt, systables dt,
  outer syscolumns pc1, outer syscolumns pc2, outer syscolumns pc3,
outer syscolumns pc4,
  outer syscolumns pc5, outer syscolumns pc6, outer syscolumns pc7,
outer syscolumns pc8,
  outer syscolumns pc9, outer syscolumns pc10, outer syscolumns pc11,
outer syscolumns pc12,
  outer syscolumns pc13, outer syscolumns pc14, outer syscolumns pc15,
outer syscolumns pc16,

  outer syscolumns dc1, outer syscolumns dc2, outer syscolumns dc3,
outer syscolumns dc4,
  outer syscolumns dc5, outer syscolumns dc6, outer syscolumns dc7,
outer syscolumns dc8,
  outer syscolumns dc9, outer syscolumns dc10, outer syscolumns dc11,
outer syscolumns dc12,
  outer syscolumns dc13, outer syscolumns dc14, outer syscolumns dc15,
outer syscolumns dc16,

  sysindexes pidx, sysindexes didx,
  sysreferences drefs
where
  dcons.constrtype = "R" and
  dcons.idxname = didx.idxname and
  dcons.constrid = drefs.constrid and
  pcons.constrid = drefs.primary and
  pcons.idxname = pidx.idxname and
  drefs.ptabid = pt.tabid and -- primary table and fields
  pt.tabid = pc1.tabid and pt.tabid = pc2.tabid and pt.tabid =
pc3.tabid and pt.tabid = pc4.tabid and
  pt.tabid = pc5.tabid and pt.tabid = pc6.tabid and pt.tabid =
pc7.tabid and pt.tabid = pc8.tabid and
  pt.tabid = pc9.tabid and pt.tabid = pc10.tabid and pt.tabid =
pc11.tabid and pt.tabid = pc12.tabid and
  pt.tabid = pc13.tabid and pt.tabid = pc14.tabid and pt.tabid =
pc15.tabid and pt.tabid = pc16.tabid and

  pidx.part1 = pc1.colno and pidx.part2 = pc2.colno and pidx.part3 =
pc3.colno and pidx.part4 = pc4.colno and
  pidx.part5 = pc5.colno and pidx.part6 = pc6.colno and pidx.part7 =
pc7.colno and pidx.part8 = pc8.colno and
  pidx.part9 = pc9.colno and pidx.part10 = pc10.colno and pidx.part11 =
pc11.colno and pidx.part12 = pc12.colno and
  pidx.part13 = pc13.colno and pidx.part14 = pc14.colno and pidx.part15
= pc15.colno and pidx.part16 = pc16.colno and

  dcons.tabid = dt.tabid and -- dependent table and fields
  dt.tabid = dc1.tabid and dt.tabid = dc2.tabid and dt.tabid =
dc3.tabid and dt.tabid = dc4.tabid and
  dt.tabid = dc5.tabid and dt.tabid = dc6.tabid and dt.tabid =
dc7.tabid and dt.tabid = dc8.tabid and
  dt.tabid = dc9.tabid and dt.tabid = dc10.tabid and dt.tabid =
dc11.tabid and dt.tabid = dc12.tabid and
  dt.tabid = dc13.tabid and dt.tabid = dc14.tabid and dt.tabid =
dc15.tabid and dt.tabid = dc16.tabid and

  didx.part1 = dc1.colno and didx.part2 = dc2.colno and didx.part3 =
dc3.colno and didx.part4 = dc4.colno and
  didx.part5 = dc5.colno and didx.part6 = dc6.colno and didx.part7 =
dc7.colno and didx.part8 = dc8.colno and
  didx.part9 = dc9.colno and didx.part10 = dc10.colno and didx.part11 =
dc11.colno and didx.part12 = dc12.colno and
  didx.part13 = dc13.colno and didx.part14 = dc14.colno and didx.part15
= dc15.colno and didx.part16 = dc16.colno
  $whereComp
order by
  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
  19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34
;
EOF

nawk -F"|" '{
  printf("%s: ", $1 )
  for(i=3;i<=18;++i) {
    if ($i == "") {
      break
    }
    printf("%s ", $i)
  }
  printf(" <--[%s] %s: ", $(NF - 1), $2 )
  for(i=19;i<= NF - 2 ; ++i) {
    if ($i == "") {
      break
    }
    printf("%s ", $i)
  }
  printf("\n")
}' /tmp/scons_$$.out

0
bozon
4/13/2006 11:48:34 AM
Kuldeep wrote:

Have you tried:

myschema -d <mydatabase> -t <ParentTableName> -F

Myschema is a replacement for dbschema which adds significant value 
(including the -F [follow references] option) and is included in the package 
utils2_ak downloadable from the IIUG Software Repository.

Art S. Kagel

> select stab.tabname Parent,
>        scol.colname Primary_key,
>        sstab.tabname Child,
>        sscol.colname Child_key
> from   syscolumns scol,
>        syscolumns sscol,
>        sysindexes sind,
>        sysindexes ssind,
>        sysconstraints scon,
>        sysconstraints sscon,
>        systables stab,
>        systables sstab,
>        sysreferences sref
> where  scol.tabid=sind.tabid
> and    scol.colno = sind.part1
> and    sind.idxname=scon.idxname
> and    stab.tabid=scon.tabid
> and    sstab.tabid=sscon.tabid
> and    sscol.tabid = ssind.tabid
> and    (sscol.colno = ssind.part1 or sscol.colno = ssind.part2)
> and    sscon.idxname=ssind.idxname
> and    sref.constrid=sscon.constrid
> and    stab.tabid=sref.ptabid
> and    stab.tabname='ParentTableName'
> 
>  above query works gr8 when single column primary key in Parent table,
> but when there is two or morecolumn primary key it does not gives right
> ans. plz try  to solve..
> 
0
Art
4/26/2006 6:41:36 PM
Reply:

Similar Artilces:

TABLES TABLES TABLES
How would you best describe to a retiscent SAS student that the concept of TABLES isn't limited to SQL? This came up during a discussion on table lookup methods - and lookup tables in particular (I mean, lookup tables pre- date SQL). Even SAS data sets are referred to as tables. This made the student apoplectic. Words of wisdom most welcome!!! Thanks, Howard sasbum@AOL.COM wrote: >How would you best describe to a retiscent SAS student that the concept of >TABLES isn't limited to SQL? This came up during a discussion on table >lookup methods - and lookup tables in partic...

how to get the complete list of child tables and their child tables and so on...
Suppose I have the following scheam (parent->child) : A->B->C->D, E->F Can someone help me with the sql query in db2 which will give me the complete chain once i give it the parent table. eg. for input A, i should get B, C, D and for input E it should give me F. Thanks amitabh.mehra@gmail.com wrote: > Suppose I have the following scheam (parent->child) : > A->B->C->D, E->F > > Can someone help me with the sql query in db2 which will give me the > complete chain once i give it the parent table. eg. for input A, i > should get...

adding a constraint to child table that references a column of the parent table that is not part of the primary key
Hello, Oracle 10.2.0.3 on Linux here. I have two tables, P (parent table) and D (data table): hr@> create table p ( pid integer primary key, ptype varchar2(1) not null, pname varchar2(80) not null ) ; Table created. hr@> create table d ( pid integer not null, ddate date not null, dstuff varchar2(80), primary key (pid,ddate), foreign key (pid) references p ) ; Table created. I would like to add a constraint that prevents to insert two parents of the same type in the same date. For example: hr@> insert into p values (1,'A','1A'); 1 row created...

Child Table With Two Parent Tables
I have a database with two tables of entities. Both tables will have a child address table, as follows: Table1: PK: T1_ID Table1_Addresses: PK: T1Ad_ID FK: T1_ID Table 2: PK: T2_ID Table2_Addresses: PK: T2Ad_ID FK: T2_ID The client I'm doing it for, though, would like one address table, shared by both tables. That would require something like this: Addresses: PK: Ad_ID FK: T1_ID FK: T2_ID with Table1 and Table2 joined, alternatively, to the two FKs. That configuration seems non-normalized to me, though it seems it would work. ...

Problem getting the GUI to import and save a table to a specific name so that my program can call the same name for any imported table
Hi everyone, I have a problem about loading a table that the user has picked. Basically, my GUI has an option to input a table of data to be used in my program. I initially thought that I could get the user to enter the address of the table and then I would use the following code in my program: > tabaddress = get(handle.tabaddress,'String') > table = importdata(tabaddress) I don't know why this wont work? because I have made sure that tabaddress is stored by the user, to start and end with an inverted comma. I then thought perhaps it would be better to just have a uiimpor...

How can I find the name of the parent table from a table cell?
I have something like this: <table name="test" id="test"> <tr> <td><input type="button" onClick="showMeParentTableName();"></td> </tr> </table> How can I have my input button show me the table of it's parent table? (eg. "test" in this case) All form elements, Inputs too, have a parent of Form, and form has other parents and such, instead, use a link in the TD, ..parentElement.parentElement.parentElement of a link on the TD will be the table, if you use an input, you'd have t...

Re: TABLES TABLES TABLES
sasbum@AOL.COM wrote: >How would you best describe to a retiscent SAS student that the concept of >TABLES isn't limited to SQL? This came up during a discussion on table >lookup methods - and lookup tables in particular (I mean, lookup tables >pre- >date SQL). Even SAS data sets are referred to as tables. This made the >student apoplectic. I find a visual works well here. If you show a grid with rows and columns, then you can show a picture of a SAS data set and a SQL table and a lookup table, and show that (regardless of terminology and buzzwords) they're all pr...

Table of tables
Given t = {{{-1, -1, -2+2I}, {-1, -1, 3-I}}, {{-1, -1, 4+I}, {-1, -1, -5-5I}}}; how can I extract the imaginary part of the complex elements to obtain {{{-1, -1, 2}, {-1, -1, -1}}, {{-1, -1, 1}, {-1, -1, -5}}}; thank you. Luiz Melo -- On Oct 20, 1:07 am, Luiz Melo <luiz.m...@polymtl.ca> wrote: > Given > > t = {{{-1, -1, -2+2I}, {-1, -1, 3-I}}, {{-1, -1, 4+I}, {-1, -1, -5-5I}}}; > > how can I extract the imaginary part of the complex elements to obtain > > {{{-1, -1, 2}, {-1, -1, -1}}, {{-1, -1, 1}, {-1, -1, -5}}}; > > thank yo...

update records in child table based on value in parent table
hello i have 2 tables linked by a common id. The first table has records with a specific field with numeric values. eg 3 or 6 or 10 etc. What i want to happen is when i create a data entry form, i can scroll thru each record and when a value such as 6 comes along, the second/child table allows for 6 records to be created based on the same unique id using a data entry form eg table 1 id 6 value 6 table 2 id 6 "data entry" id 6 "data entry" id 6 "data entry" id 6 "data entry" id 6 "data entry" id 6 "data entry" How can i do this thank...

Get the primary key name of a table
Hello there! Which SELECT statement do I need to execute to get the primary key name of a certain table? Robert Robert Wehofer wrote: > Hello there! > > Which SELECT statement do I need to execute to get the primary key name of a > certain table? > > Robert Goto http://tahiti.oracle.com and lookup description for user_constraints, all_constraints and dba_constraints. Regards /Rauf On Wed, 16 Mar 2005 16:09:52 +0000, Robert Wehofer wrote: > Hello there! > > Which SELECT statement do I need to execute to get the primary key name ...

Mysql fetch_field gets table alias, not real table name
After a SQL 'select .... from tablename alias' the mysql_fetch_field function returns a value $result=>table which will contain the alias, not the actual table name. Is there a way to get the actual table name ? I am running mysql 4.1 and php 4.4 ...

From table to table....
I want to create a new table containing only the results from a select statement of another table. How is that done? select a, b, c into destTable from sourceTable where a='x' or a='y' or a='z'; Does one have to create the destTable or is it created for you with the correct structure? Can the rows of one table be used in the select of another table? eg: The above select statement has three choices. could those 'choices' have been rows of a column of a table? On Wed, 1 Feb 2012 10:29:45 -0800 (PST), SpreadTooThin wrote: > I want to create a new table co...

Getting the database name of a given table?
Hi All. If I have a piece of SQL like:- SELECT some_cols FROM DB1:atable UNION SELECT some_cols FROM DB2:atable UNION SELECT some_cols FROM DB3:atable How can I also return as a column the database the row matches so I can differentiate between DB1, DB2 and DB3 in the above example? I've tried a few things but no success so far. Any inspiration appreciated! TIA. David ...

delete child table rows based on predicates in a parent table
I have two tables that are related by keys. For instance, Table employee { last_name char(40) not null, first_name char(40) not null, department_name char(40) not null, age int not null, ... } Employee table has a primary key (combination of last_name and first_name). Table address { last_name char(40) not null, first_name char(40) not null, street char(200) not null, city char(100) not null, ... } Address table has a primary key (combination of last_name, first_name and street in which (last_name, first_name) reference (last_name, f...

Web resources about - Get all child table and key names of a parent table - comp.databases.informix

Parent - Wikipedia, the free encyclopedia
A parent is a caretaker of the offspring in their own species. In humans, a parent is of a child (where "child" refers to offspring, not necessarily ...

Are You Interested Parent Snap Interactive Is Very Interested In Facebook Mobile App Install Ads
... by Cupid’s arrow and began what it hopes will be a long, healthy relationship with the social network’s mobile app install ads , as AYI parent ...

Google-parent Alphabet's moonshots lost $3.6 billion in 2015
Moonshots are not cheap. Google parent-company Alphabet lost $3.6 billion on moonshot projects in 2015. The so-called "Other Bets," which includes ...

Google parent may soon top Apple's market value
As the digital advertising market booms and demand for smartphones wanes, technology companies could trade rankings

Google parent Alphabet jumps 5% as earnings beat
The recently restructured technology giant reported earnings of $8.67 per share on $21.33 billion in revenue as it rolled out a new reporting ...

Security Flaw In Fisher Price “Smart Toys” Could Have Left Info For Children, Parents Vulnerable
... ages, birthdates, genders, and other data, from children. The vulnerabilities were tied to software that managed how an app used by parents ...

States Are Getting More Honest With Parents About Crummy Test Scores
States Are Getting More Honest With Parents About Crummy Test Scores

EXCLUSIVE: Jacob Tremblay Jokes About His Parents' Newfound Fame
EXCLUSIVE: Jacob Tremblay Jokes About His Parents' Newfound Fame

3 Quick Ways Stay-At-Home Parents Can Kick Off Their Job Search
Here are three quick and effective ways stay-at-home parents can kick off their job search to reenter the workforce in one day.

Google parent company Alphabet now valued higher than Apple after beating Q4 earnings expectations
Google parent company Alphabet beat analyst expectations for its Q4 earnings report as its stock was up nearly 9 percent in after-hours trading. ...

Resources last updated: 2/2/2016 10:21:50 PM