UseMessageTable

mazhigang

Member
My table create script just like below:
CREATE TABLE REALWAY.Province (
ProvID CHAR(2) NOT NULL,
ProvName VARCHAR2(20) NULL
);

ALTER TABLE REALWAY.Province
ADD ( CONSTRAINT XPKProvince PRIMARY KEY (ProvID) ) ;

I have created a message table and can see the primary key CONSTRAINT message, but can't see the message when the ProvID column is null.
Thanks

------------------
 
If ProvID is NULL, you will either get a message from the TDataSet component, or you will see an ORA-01400 exception message, because the NOT NULL constraint will be enforced before the primary key constraint.

What exactly did you want to accomplish?

------------------
Marco Kalter
Allround Automations
 
Thank you very much.
I have received a message from the TDataSet.
Now I want to know if the NOT NULL CONSTRAINT message can be translated through the message table.
If it can be, how should I do.
Below is part of the TOracleSession's help topic:
The TOracleDataSet component can translate error messages raised by primary key, unique key, foreign key and check constraints through a message table.
Is the NOT NULL CONSTRAINT I have created among the contraints in the help?
 
The message translation will not work for in-line constraints like the NOT NULL constraints in your example. They do not have a name, so they cannot be identified.

You can alternatively use named NOT NULL constraints of course:

alter table Province add constraint ProvID_Not_Null check(ProvID is not null);

Now you have a constraint name for the message table.

To disable immediate Required field checks for non-persistent fields, you need to disable TOracleDataSet.Dictionary.RequiredFields. For persistent fields you can manually set the Required property to False.

------------------
Marco Kalter
Allround Automations
 
Back
Top