I have created my TEST_TABLE
table using below query in oracle
CREATE TABLE "PK"."TEST_TABLE"
( "MYNAME" VARCHAR2(50),
"MYVAL1" NUMBER(12,0),
"MYVAL2" NUMBER(12,0),
"MYVAL3" NUMBER(12,0) NOT NULL,
CHECK ("MYVAL1" IS NOT NULL) DEFERRABLE ENABLE NOVALIDATE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
After this, I want to drop the check constraints applied on column MYVAL1.
For this, first I need to fetch the check constraint name on column MYVAL1. The I can run the alter command to drop that constraint.
So how can I fetch the exact system generated check constraint name on column MYVAL1
.
i tried to fetch the data using below query but as search condition is long data type column, it was trowing below error
select * from user_constraints where TABLE_NAME = 'TEST_TABLE'; WHERE TABLE_NAME='TEST_TABLE' AND TO_LOB(search_condition) LIKE '%"MYVAL1" IS NOT NULL%'
ERROR:
ORA-00932: inconsistent datatypes: expected - got LONG
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
Error at Line: 23 Column: 6
Any clue?