Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What does sharding mean?

981


How to create a table index?

1117


What is a cursor in oracle?

1160


What are the different types of failures that occur in Oracle database?

1049


What is oracle data type?

942


What is a trigger and what are its types in oracle?

1054


How to create a table interactively?

1065


What is BBED in Oracle?

1136


How to change program global area (pga) in oracle?

1070


What is the parameter mode that can be passed to a procedure?

1021


How to increment dates by 1 in oracle?

1036


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.

2245


What is the difference between the Oracle ODBC driver and a Microsoft ODBC (Open Database Connectivity) Driver?

1081


Please send me Informatica 8.1 certification dumps, my mail id mona85gupta@gmail.com

1848


What is dynamic proxy?

989