t1
col1 col2
nishi 5000
lucky 6700
akash 7000
i want that a query that when i insert 7000 it will show me data already present and data will not insert. if data is not present it will insert.
Answer Posted / ravi gali
hi u can use DUP_VAL_ON_INDEX exception
SQL> create table test(id number primary key);
Table created.
SQL> set serverout on
SQL>
begin
insert into test values(1);
exception
when DUP_VAL_ON_INDEX then
raise_application_error('duplicate value entered on the row ');
when others then
dbms_output.put_line('if u entered wrong data');
end;
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What does sharding mean?
How to create a table index?
What is a cursor in oracle?
What are the different types of failures that occur in Oracle database?
What is oracle data type?
What is a trigger and what are its types in oracle?
How to create a table interactively?
What is BBED in Oracle?
How to change program global area (pga) in oracle?
What is the parameter mode that can be passed to a procedure?
How to increment dates by 1 in oracle?
hello friends Im doing my final year engineering in B.Tech.. one of uncle said he can provide job in his company if im good in database management. but i have only basic knowledge about database, so like to join database management course in good intuition. so friends kindly help me to get good intuition because its my future.
What is the difference between the Oracle ODBC driver and a Microsoft ODBC (Open Database Connectivity) Driver?
Please send me Informatica 8.1 certification dumps, my mail id mona85gupta@gmail.com
What is dynamic proxy?