Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get Primary key - Oracle
Message
De
17/04/2003 09:32:46
 
 
À
17/04/2003 09:12:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00778770
Message ID:
00778810
Vues:
17
You may also use the table all_constraints because dba_* views can be queried only by users with "admin" rights. If the view which primary key you want to get is in the same schema, then the table "user_constraints" will also do it.

Regards,
Vlad


>Hi Richard,
>
>you may use following query to get the name of the primary key on a table:
>
>SELECT constraint_name
> FROM dba_constraints
> WHERE table_name = 'MY_TABLE'
> AND owner = 'MY_TABLE_OWNER'
> AND constraint_type = 'P';
>
>The table name and the table owner name must be written in uppercase.
>In Oracle there is no stored procedure to get this kind of info. You will have to query the views of the Oracle data dictionary.
>
>Hope this helps,
>Vlad
>
>
>
>>Hi,
>>
>>Using SQL passthrough I need to return the primary key of an Oracle table. Against Microsoft SQL Server I can call the stored procedure or directly query the syscolumns and sysobjects tables.
>>
>>Are there equivalents in Oracle ?
>>
>>Thanks,
>>
>>Richard
Vlad-Georg
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform