Assignments in pl/sql, PL-SQL Programming

Assignments in pl/sql

The Variables and constants are initialized every time a block or subprogram is entered.
By default, the variables are initialized to NULL. Therefore, unless you expressly initialize the variable, its value is undefined, as the following illustration shows:

DECLARE
count INTEGER;
...
BEGIN
count := count + 1; -- assigns a null to count


The expression on the right side of the assignment operator yield NULL as count is null. To avoid the unpredicted results, never reference the variable before you assign it a value.

You can use assignment statements to assign the values to a variable. For illustration, the statement below assigns a new value to the variable bonus, overwriting its older value:

bonus := salary * 0.15;

The expression below the assignment operator can be randomly complex, but it must yield a datatype that is similar as or convertible to the datatype of the variable.

Posted Date: 10/3/2012 5:02:25 AM | Location : United States







Related Discussions:- Assignments in pl/sql, Assignment Help, Ask Question on Assignments in pl/sql, Get Answer, Expert's Help, Assignments in pl/sql Discussions

Write discussion on Assignments in pl/sql
Your posts are moderated
Related Questions
TTITLE and BTITLE are commands in Pl-SQL to control report headings and footers. This Ttitle & Btitle are mainly used on creating SQL*PLUS report. Ttitle is used for toptitle headi

I need SQL , WP SQL Expert Project Description: Expert required to modify WP SQL query. Skills required are MySQL, SQL, PHP, Wordpress

Cursor Attributes   The Cursors and cursor variables have 4 attributes which give you helpful information about the execution of a data manipulation statement. Syntax:

Keyword and Parameter Description: table_reference: This specifies a table or view that should be accessible when you execute the DELETE statement, and for that you must

Parameter and Keyword Description: procedure_name The user-defined procedure is declared by this construct. parameter_name: This identifies the formal parameter t

On occasion, some of Brewbean's customers mistakenly leave an item out of a basket already checked out, so they create a new basket containing the missing items. However, they requ

SSRS Report Writing Project Description: This report is part of a larger project to make a SQL Server Reporting Service (SSRS) based reporting solution. There can be more rep

Using INNER JOIN INNER JOIN is used to retrieve the data from all tables listed based on a condition of equality listed after keyword ON. If the condition is not meet, rows ar

UPDATE Command- SQL Loosely speaking, UPDATE changes some of the column values of some existing rows of its target table. Thus, although some rows disappear from the target an

set serveroutput on declare a number(5); b number(5); c number(5); begin a:=&a; b:=&b; c:=a/b; dbms_output.put_line(c); exception when zero_d