Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004

    Question Unanswered: 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.


  2. #2
    Join Date
    Jan 2003

    No support for Dynamic SQL in SPL


    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts