100%(3)3 out of 3 people found this document helpful
This preview shows page 1 - 3 out of 17 pages.
Lemuel TakuITD 134Class #: 1509/08/2016Homework Chapter 3Review Questions1 – C2 – B3 – B 4 – A5 – C6 – B7 – C8 – A9 – A10 – A11 – A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in PL/SQL has a specific data type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory and the set of operations that can be applied to the variable.The name of a PL/SQL variable consists of a letter optionally followed by more letters, numerals, dollar signs, underscores, and number signs and should not exceed 30 characters. By default, variable names are not case-sensitive. You cannot use a reserved PL/SQL keyword as a variable name.PL/SQL programming language allows to define various types of variables like date time data types, records, collections, etc. 12 – When a select statement is issued in a PLSQL block the key word INTO is used to reference the PLSQL variable. Therefore, the INTO keyword makes the difference. A select statement is mostly introduced in the executable part in a PLSQL block.
13 – % TYPE provides the data type of a variable or a database column to that variable. if one changes the type or size of the column in the table, it will be reflected in our program unit without making any change. %Type is defined as a definition for a particular column, it is a scalar type. %TYPE can be used with the column name preceded with table name to decide the datatype and length of the variable at runtime. In this case there is no dependency on changes made to the data structure. With %Type attributewe can inherit the datatype of another variable or an attribute of table into currently declared variable. %TYPE is used to declare a variable with the same type as that of a database table column.14 - % ROWTYPE provides the record type that represents an entire row of a table or view or columns selected in the cursor. if one changes the type or size of the column in the table, it will be reflected in ourprogram unit without making any change. %ROWTYPE can be used to declare the variable having the same number of variables inside it (ROWTYPE) as number of columns there in the table. In this case columns selected with SELECT statement must match with variables inside the rowtype variable. If not, then individually refer these variables inside the ROWTYPE variables. With %rowtype attribute we can inherit the datatypes entire variable into a record variable from another record variable or from all attributes of table into currently declared record variable.