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
How do we get field details of a table?
Can multiple cursors being opened at the same time?
In XIR2 if we lost the administration password .How can we regain the password?thanks in advance.
How will you identify oracle database software release?
What is a view and how is it different from a table?
What is difference between sid and service name in oracle?
How many types of tables supported by oracle?
what is dynamic SGA and static SGA
Why do we use coalesce function in oracle?
What are the data types in oracle?
How to define an oracle sub procedure?
I am using an Oracle 8i Database my data contains Clob data. I am using toad version 7.6 i am able to get the data in toad but unable to extract the data in excel.when trying to extract the data into the excel the toad error says out of memory. Can any body please help me to extract the data through the same toad version. Thanks in advance
can u plz provide me oca sql dumps please i need them
Explain rename?
Can a formula column be obtained through a select statement ?