Question
How to define a record variable to store a table row?

Answers

If you have a table, and want to define a RECORD variable to store all the data elements of a row from that table, you can use table_name%ROWTYPE to define the RECORD variable as shown in the following sample script:

CREATE TABLE student (id NUMBER(5) PRIMARY KEY,
first_name VARCHAR(80) NOT NULL,
last_name VARCHAR(80) NOT NULL);
Table created.
CREATE OR REPLACE PROCEDURE FYI_CENTER AS
best_student student%ROWTYPE;
another_student student%ROWTYPE;
class_name VARCHAR2(80);
BEGIN
class_name := 'FYI Center 2006';
best_student.first_name := 'The';
best_student.last_name := 'Best';
DBMS_OUTPUT.PUT_LINE('Best student ID = '
|| best_student.id);
DBMS_OUTPUT.PUT_LINE('Best student = ' ||
best_student.first_name || ' '
|| best_student.last_name);
END;
/
Best student ID =
Best student = The Best   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q Which day of the week is named after the Norse god of thunder?
  • Q What are the structural factors supporting Hofmann elimination products over Saytzeff elimination products? Illustrate with examples.
  • Q Explain what is the relation between rxlev [0 to 63] and rxlev [-110 to -47]?
  • Q Explain about the applications that can be used with iphone?
  • Q What is secondary list?
  • Q What are the family and order of Jewfish ?
  • Q I want to see the present working directory in UNIX from hive. Is it possible to run this command from hive?
  • Q In a class 80% have passed in english, 70% passed Hindi, 10% didn't pass either. If 144 students passed both the subjects. What is the total strength of the class?
  • Q Are changes needed to existing ejb cmp applications?
  • Q What is dynamic in iOS operating system?
  • Q Which minister of Kerala introduced the Industrial Relations Bill in 1957?