Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Execute Dynamic SQL within Stored Procedure

23 views
Skip to first unread message

shih...@gmail.com

unread,
Jan 12, 2015, 4:38:38 AM1/12/15
to
Hi,

Is it possible to execute Dynamic SQL within Stored Procedure
If it is possible how can I retrieve the output

All what I wan't to do is to access table properties, identify primary columns and write the values of the primary columns to another table.
The issue is that different tables have different number of primary keys. Is there any mechanism to acheive this ?
thank you .

Alexander McClune

unread,
Jan 15, 2015, 8:26:27 AM1/15/15
to
Hi,

Just so I understand, you want to query the database to return the primary keys of certain tables.

I would usually write a SQL Script that exports the query results to a text file, or create another database table but it really is up to you.

Are you using Windows/Linux/Unix and it is Ingres?

I would start by looking at the table iicolumns but narrow it down to the tables that matter to you:

"SELECT * FROM iicolumns WHERE table_name like = 'hb'+'%' etc.

Obviously you only need some of the columns returned and can restrict it to primary keys by adding a clause in against the key columns...

Hope it helps.
0 new messages