Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is there a way to check constrainte before an INSERT?
[This followup was posted to comp.databases.oracle.server
and a copy was sent to patrik.filipsson_at_ctp.com at
patrik.filipsson_at_ctp.com.]
In article <6usvje$um6$1_at_nnrp1.dejanews.com>, patrik.filipsson_at_ctp.com
says...
> Hi!
>
> I am currently trying do develop a database administration application in
> Powerbuilder. I'd like to know if there's a way to use Oracle's table
> constraints to make sure a user enters valid values. I'd like to not have to
> execute the INSERT before I can tell that the data was invalid. Is it
> possible to write a stored procedure or something that can look up what
> constraints there are and thereafter check the data before I even try to
> INSERT? I've found that there's a data dictionary that I could use. But,
> since not all functions in Oracle are supported in Powerbuilder it would mean
> a lot of work to try to figure out how each CHECK constraint should be tested
> in Powerbuilder. If you have any information, comments or suggestions, they
> would be greatly appreciated.
>
Patrik,
You can use the ALL_CONSTRAINTS, DBA_CONSTRAINT, or USER_CONSTRAINTS views to examine constraint values. Of course, you will need to do a little parsing of the search_condition column to determine the actual valid values.
Regards,
Bob
Received on Wed Sep 30 1998 - 09:20:21 CDT