view road'; To define a character variable, the programmer normally appends the variable type VARCHAR2 to the name definition. There follows in brackets the maximum number of characters the variable can store. Other datatypes for character variables include: varchar, char, long, raw, long raw, nchar, nchar2, clob, blob, and bfile. Date variables variable_name date := to_date('01-01-2005 14:20:23', 'DD-MM-YYYY hh24:mi:ss'); Date variables can contain date and time. The time may be left out, but there is no way to define a variable that only contains the time. There is no DATETIME type. And there is a TIME type. But there is no TIMESTAMP type that can contain fine-grained timestamp up to millisecond or nanosecond. The TO_DATE function can be used to convert strings to date values. The function converts the first quoted string into a date, using as a definition the second quoted string, for example: to_date('31-12-2004', 'dd-mm-yyyy') or to_date ('31-Dec-2004', 'dd-mon-yyyy', 'NLS_DATE_LANGUAGE = American') To convert the dates to strings one uses the function TO_CHAR (date_string, format_string). PL/SQL also supports the use of ANSI date and interval literals. The following clause gives an 18-month range: WHERE dateField BETWEEN DATE '2004-12-30' - INTERVAL '1-6' YEAR TO MONTH AND DATE '2004-12-30' Exceptions Exceptions—errors during code execution—are of two types: user-defined and predefined. User-defined exceptions are always raised explicitly by the programmers, using the RAISE or RAISE_APPLICATION_ERROR commands, in any situation where they determine it is impossible for normal execution to continue. The RAISE command has the syntax: RAISE <exception name>; Oracle Corporation has predefined several exceptions like NO_DATA_FOUND, TOO_MANY_ROWS, etc. Each exception has an SQL error number and SQL error message associated with it. Programmers can access these by using the SQLCODE and SQLERRM functions. Datatypes for specific columns Variable_name Table_name.Column_name%type; This syntax defines a variable of the type of the referenced column on the referenced tables. Programmers specify user-defined datatypes with the syntax: type data_type is record (field_1 type_1 := xyz, field_2 type_2 := xyz, ..., field_n type_n := xyz); For example: declare type t_address is record ( name address.name%type, street address.street%type, street_number address.street_number%type, postcode address.postcode%type); v_address t_address; begin select name, street, street_number, postcode into v_address from address where rownum = 1; end; This sample program defines its own datatype, called t_address, which contains the fields name, street, street_number and postcode. So according to the example, we are able to copy the data from the database to the fields in the