Tuesday 23 June 2015

PLSQL|| Records

Records: Records is one of type PLSQL data types. It is composite data type which is combination of diffrent type of data types. And each scalar data type holds value same as row in table.

Syntax for Records:
TYPE xxrec_type IS RECORD
(
column1   datatype,
column2    datatype,
.......n
);

e.g.:
DECLARE
TYPE vendor_type IS RECORD
(
supplier_name varchar2(50),
supplier_number ap_suppliers.segment1%type,
vendor_id ap_suppliers.vendor_id%type,
supplier_alt_name varchar2(250),
currency_code ap_suppliers.invoice_currency_code%type
);
--
vendor_rec vendor_type;


we can assign value in select statement in execution block of plsql as shown below.

SELECT vendor_name,
segment1,
vendor_id,
invoice_currency_code
INTO
vendor_rec.supplier_name,
vendor_rec.supplier_number,
vendor_rec.vendor_id,
vendor_rec.currency_code
FROM ap_suppliers;

1 comment:

  1. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your.
    presales

    ReplyDelete

How to resolve issue for BIP RTF template XML tags showing value as <?ref: 0000xx?>

 How to resolve issue for BIP RTF template XML tags showing value as <?ref: 0000xx?>  Sometime these xml data tags automatically chang...