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
How do I know if oracle client is installed on windows?
How to revoke create session privilege from a user in oracle?
Explain the use of indexes option in imp command.
How to use "out" parameter properly?
What is oracle join syntax?
What happens if recursive calls get out of control?
while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511
How to create id with auto_increment on oracle?
Can a parameter be passed to a cursor?
What is meant by recursive hints in oracle?
What is the minimum client footprint required to connect c# to an oracle database?
What is Segment Advisor in Oracle?
How to connect to oracle using service name instead of sid?
What are the different types of modules in oracle forms?
can u send the sql dumps to sivakumarr1987@gmail.com plz help me