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

Answers were Sorted based on User's Feedback



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

Answer / thiru

Yes. We can build a sequence generator value to a column in
a table then next columns can be handled with SQL queries.

Is This Answer Correct ?    1 Yes 2 No

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

Answer / 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

More Oracle General Interview Questions

Give SQL Query to find the number words in a sentence ? ex: 'ram charan singh' then ans:3 Answer:select length(trim('ram charan singh')) - length (replace (trim ( 'ram charan singh'),' ','')) +1 from dual The above query working properly when space between the words is only one &similar But ,If the space between the words is nonuniform. Ex:'ram charan singh is good' ans:5 i am not getting this answer using above query.

3 Answers  


What is an Index Segment ?

2 Answers  


HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

0 Answers  


I have some query regarding Report generation from Oracle Apps "PO module". I have to generate a report where table columns are as below: Vendor_name Invoice No PO Number Item_Quantity Value of Goods Date of Shipping Name_of_the_transport Date_of_receipt_issued. Now my questions is :from which table/column I can get the information of "Name_of_the_transport" column. Thanks in advance.

0 Answers  


What is system global area (sga) in oracle?

0 Answers  






How can we find out the duplicate values in an oracle table?

0 Answers  


How to join two tables in a single query using oracle?

0 Answers  


How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

0 Answers  


Select all the employees who were hired in last 2 years and who works in dept where max managers are working.

0 Answers   ESS,


How to upsert (update or insert into a table)?

0 Answers  


Difference between join and a subquery?

8 Answers   Base Automation, NMDC,


What is a Private Synonyms ?

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)