If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Dropping a constraing in a procedure using a variable

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-18-04, 23:54
vijaya0008 vijaya0008 is offline
Registered User
 
Join Date: Aug 2004
Posts: 1
Question Dropping a constraing in a procedure using a variable

I'm very new to Informix.
There is a req. to drop a index whose name is not known. We have created a procedure and by using a query we are selecting the constraint name into a variable inside the procedure. If this variable is used in drop constraint statement its not accepting that (variable name is l_cnt)

select constrname into l_cnt from sysconstraints a, syschecks b where a.constrid = b.constrid
and b.type = 'T' and b.checktext like "(acct_cnst IN %";

drop constraint (l_cnt)

Any inputs how to execute a srop constraint statement with dynamically available constraint name.

TIA
VIJAYA
Reply With Quote
  #2 (permalink)  
Old 08-19-04, 10:41
Big Kahuna Big Kahuna is offline
Registered User
 
Join Date: Jan 2003
Posts: 30
No support for Dynamic SQL in SPL

Hi,

Stored procedure language does not support dynamic SQL.

Use ESQL/C

or write the SQL statements to create procedure to a file at runtime and create AND execute your procedure at runtime;

Good luck
Koen
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On