Re: Drop Primary Key
Posted in 2000
From: Patrick Brosnan <pbrosnan@fore.com>
>
>I am trying to drop a primary key from a table (Informix 2000) with the
>procedure below. When I run it I get the message
>"Unable to find CONSTRAINT (prim_key)."
>Any thoughts ?
Sure. You can't do dynamic SQL in SPL. There is a Dynamic SPL bladelet at
http://www.iiug.org -- but even that may not support Dynamic DDL. It's your
best bet, though.
>CREATE PROCEDURE DropSpvxDestPrimKey()>
>DEFINE prim_key VARCHAR(25);
>
>select constrname into prim_key from sysconstraints where constrtype =
>'P'
>and tabid = (select tabid from systables where tabname =
>'fv_spvx_dest_2');
>
>alter table fv_spvx_dest_2 drop constraint prim_key;>
>END PROCEDURE;
>
>
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com