Re: problem with drop constraints
Posted in 2000
From: nayan jain <nayan.jain@tatainfotech.com>
>
>Is there any way that i can drop a constraints dynamically ?
>
>like this ?
>
>alter table sam_user
>( drop constraints ( select constrname from sysconstraints
>where tabid = (
>select tabid from systables
>where tabname = "sam_user")
>and constrtype = "R"
>and idxname = (
>select idxname from sysindexes
>where tabid = (select tabid from systables where tabname = "sam_user")
>and idxtype = "D"
>and part1 = 5)
> )
>)>
>i have to write specifically "drop constraints r1323_12272"
Why don't you write an SQL like:
SELECT "alter table sam_user( drop constraint " ||
constrname || ");"
from sysconstraints c, systables t, sysindexes i
where c.tabid = t.tabid
and tabname = "sam_user"
and constrtype = "R"
and i.tabid = t.tabid
and idxtype = "D"
and part1 = 5
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com