srikotesh
asked on
create table syntax should allow even if i pass data which is greater than length of the column
Hi Experts,
CREATE TABLE customers
( customer_id number(10) NOT NULL,
customer_name varchar2(50) NOT NULL,
city varchar2(50)
);
I have created table customers.
when i try to insert with data which is greater than of column data type length.
i mean customerid number(10)
if i try to insert with 11 numbers is there any way to insert data with out throwing an error
it should insert customer id with 10 digits even if i pass 11 digits.
CREATE TABLE customers
( customer_id number(10) NOT NULL,
customer_name varchar2(50) NOT NULL,
city varchar2(50)
);
I have created table customers.
when i try to insert with data which is greater than of column data type length.
i mean customerid number(10)
if i try to insert with 11 numbers is there any way to insert data with out throwing an error
it should insert customer id with 10 digits even if i pass 11 digits.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use a stored procedure or an INSTEAD OF trigger. But you should log such a data truncation and inform the user about, when it happens.
>>or an INSTEAD OF trigger
You cannot create an instead of trigger on a table.
You cannot create an instead of trigger on a table.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks