Using default-declarations in sql, PL-SQL Programming

Assignment Help:

Using DEFAULT

You can use the keyword DEFAULT rather than that of the assignment operator to initialize the variables. For e.g. the declaration
blood_type CHAR := ’O’;

it can be rewrite as follows:

blood_type CHAR DEFAULT ’O’;

Use DEFAULT for the variables that have a typical value. Use the assignment operator for the variables (like counters & accumulators) which have no typical value. Some of the examples are shown below:

hours_worked INTEGER DEFAULT 40;
employee_count INTEGER := 0;

You can also use DEFAULT to initialize the cursor parameters, subprogram parameters,  and fields in a user-defined record.


Related Discussions:- Using default-declarations in sql

Execute privilege, EXECUTE Privilege To call an invoker-rights routine ...

EXECUTE Privilege To call an invoker-rights routine straightforwardly, the users should have the EXECUTE privilege on that routine. By yielding the privilege, you permit a user

Keyword & parameter description - expressions, Keyword & Parameter Descript...

Keyword & Parameter Description: boolean_expression: This is an expression which yields the Boolean value that is TRUE, FALSE, & NULL. character_expression: This

Using extend - collection method, Using EXTEND To enlarge the size of ...

Using EXTEND To enlarge the size of a collection, use EXTEND. This process has 3 forms. The EXTEND appends one null element to a collection. And the EXTEND(n) appends n null e

Parameter and keyword description - records, Parameter and Keyword Descript...

Parameter and Keyword Description: record_type_name: This identifies the user-defined type specifier that is used in the subsequent declarations of the records. NOT N

How pl/sql resolves the calls? , How Calls Are Resolved? The figure sho...

How Calls Are Resolved? The figure shows that how the PL/SQL compiler resolves the subprogram calls. When the compiler encounters the procedure or function call, it tries to di

Projection in sql - correct version, Projection in SQL - correct version ...

Projection in SQL - correct version Student StudentId is enrolled on some course. SELECT DISTINCT StudentId FROM IS_ENROLLED_ON In more complicated examples it is someti

S, Question 1. Update stock levels when the order is cancelled At times, c...

Question 1. Update stock levels when the order is cancelled At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a

%rowtype - cursors, %ROWTYPE: This attribute gives a record type which ...

%ROWTYPE: This attribute gives a record type which represents a row in the database table or a row fetched from a formerly declared cursor. The Fields in the record and corresp

Exception handling, set serveroutput on declare a number(5); b n...

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

PROCEDURE, Create a procedure named DDPROJ_SP that retrieves project inform...

Create a procedure named DDPROJ_SP that retrieves project information for a specific project based on a project ID. The procedure should have two parameters: one to accept a projec

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd