Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sql statement

Re: sql statement

From: Howard J. Rogers <howardjr_at_www.com>
Date: Sun, 14 Jan 2001 15:24:27 +1100
Message-ID: <3a6129eb@news.iprimus.com.au>

Did you try a semi-colon at the end? Depends what you mean by 'it just sat there', I guess. As written, your code has no terminator. Oracle needs to be told you've finished typing and its up to it now to actually go and do something. Semi-colon or back-slash would do.

Regards
HJR Eric Givler <egivler_at_flash.net> wrote in message news:uK986.4092$J%.466296_at_news.flash.net...
> Does anyone have a sqlstatement that when run would show a foreign key and
> the table it points to? (I'd like to list all columns and be ordered by
> position if there are more than one column in the key.
>
> I tried:
>
> select fk1.table_name||'.'||fkc1.column_name fk_name,
> fkc1.position,
> fk1.r_owner||'.'||pk1.table_name||'.'||pkc1.collumn_name pk_name
> from user_constraints fk1,
> user_cons_columns fkc1,
> dba_constraints pk1,
> dba_cons_Columns pkc1
> where fk1.constraint_name=upper('&constraint')
> and fk1.constraint_type='R' /* foreign key */
> and fk1.constraint_name=fkc1.constraint_name
> and fk1.table_name=fkc1.table_name
> and fk1.owner=fkc1.owner
> and fk1.r_owner = pk1.owner
> and fk1.r_constraint_name=pk1.constraint_name
> and pk1.owner = pkc1.owner
> and pk1.table_name=pkc1.table_name
> and pk1.constraint_name=pkc1.constraint_name
> order by fkc1.position
>
> But it just sat there.... Am I missing something or being just plain
> stupid?
>
>
>
Received on Sat Jan 13 2001 - 22:24:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US