Link to home
Start Free TrialLog in
Avatar of srikotesh
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.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>or an INSTEAD OF trigger

You cannot create an instead of trigger on a table.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srikotesh

ASKER

thanks