Created
October 28, 2025 07:39
-
-
Save ArtDu/30e6ce4eaf1b07e3320605dcc95a9c8b to your computer and use it in GitHub Desktop.
select pk from oracle database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT acc.column_name | |
| FROM all_constraints ac | |
| JOIN all_cons_columns acc | |
| ON ac.owner = acc.owner | |
| AND ac.constraint_name = acc.constraint_name | |
| WHERE ac.table_name = 'YOUR_TABLE_NAME' | |
| AND ac.constraint_type = 'P' | |
| AND ac.owner = 'YOUR_SCHEMA_NAME'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment