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...

can a table has a column that has only view data and in
other columns we can change data?

Answer Posted / hari kanth

ya,we can create trigger on that table
like as follows
CREATE OR REPLACE TRIGGER key_gen
BEFORE INSERT ON <table_name>
FOR EACH ROW
DECLARE
v_num NUMBER(5);
BEGIN
SELECT seq.nextval INTO v_num from dual;
:new.id:=SAM||LPAD(v_num,3,0);
END;

the <table_name> structure like as follows
(id VARCHAR2(20),
name VARCHAR2(15)
)
now you can just add the records like as follows
INSERT INTO <table_name>
(
name
)
VALUES
(
'&Name'
);
then trigger will fires and automatically it will inserts
into that table with out our knowledge.

NOTE:here "seq" is forward sequence.if it start with 1 and
incremented by 1 then the output will be like as follows

select * from <table_name>

id name

SAM001 TV
SAM002 LCD

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Library Cache in Oracle?

1134


Explain the importance of .pll extension in oracle?

997


What are the different types of partitions in oracle?

964


How to declare a local variable?

1103


What is varray?

1124


There are n numbers of flatfile of exactly same format are placed in a folder.Can we load these flatfile's data one by one to a single relational table by a single session??

2022


How to use null as conditions in oracle?

1070


What is a read write transaction in oracle?

1079


Explain the use of grant option in exp command.

1054


What will be the syntax to find current date and time in format "yyyy-mm-dd"?

1007


How to set up autotrace for a user account?

1050


What is a sub query? Describe its types?

1011


How to drop an existing table in oracle?

1053


Explain the blob datatype?

1066


What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?

2057