Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding a rule to a field.

Status
Not open for further replies.

Zejtuni

Programmer
Apr 26, 2004
2
MT
Hi,

I am trying to construct a rule that validates a field using a user-defined function.

is this possible ?

Regards

 
can you not use a constraint - example of :

Code:
CREATE TABLE cust_sample
    (
    cust_id                int        PRIMARY KEY,
    cust_name            char(50),
    cust_address            char(50),
    cust_credit_limit    money,
    CONSTRAINT chk_id CHECK (cust_id BETWEEN 0 and 10000 )
    )

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Do you want to validate the data prior to insert? or as the data is inserted?
If its the first, and you are using a stored proc, you can do whatever you want regarding validating.
It its the latter have a look at a trigger.

Can you give a more detailed explanation at what you want?

"I'm living so far beyond my income that we may almost be said to be living apart
 
I want to validate the data before inserting.

The new DataType is of type "##:##" and I have a user-defined function that validates this data.

I want to be able to validate this data at database level (it can be done easily through code).

The actual problem started because there is no "time" datatype in the "hh:mm" format only, or am I wrong?

What is the simplest way to have such a column?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top