Variable declaration - sql, PL-SQL Programming

Variable Declaration - SQL

SQL's support for variables is very similar to Tutorial D's, except that the syntax for creating persistent  variables-base tables-is quite different from that used to declare local variables. Example is SQL's counterpart of that example in the theory book but, as you know, CREATE TABLE is used for base tables.

Example: A Variable Declaration

DECLARE SN SID DEFAULT SID ('S1');

DECLARE in place of VAR and DEFAULT in place of INIT. The effect is exactly the same apart from the fact that, as already noted, SQL's type SID (here assumed to be a distinct type). The key word DEFAULT is perhaps a strange choice as that word normally suggests action to be taken by the system when no specific action is explicitly demanded by the user. Here it is used to state explicitly an immediate assignment to the variable being declared.

Posted Date: 1/18/2013 2:42:10 AM | Location : United States







Related Discussions:- Variable declaration - sql, Assignment Help, Ask Question on Variable declaration - sql, Get Answer, Expert's Help, Variable declaration - sql Discussions

Write discussion on Variable declaration - sql
Your posts are moderated
Related Questions
CURRVAL and NEXTVAL The series is a schema object which generates the sequential numbers. Whenever you form a sequence, you can specify its primary value and an increment. T

THEO R Y OF PANSPERMIA - Arrhenius (1908) postulated the cosmic panspermia theory that claims that organisms existed throughout the universe, and their spores, etc., could

I need to write one function and one procedure to query a Oracle 10.1 DB using PL SQL. I have the schema and exact queries...along with work Ive started and a template to put the a

Data Types in SQL SQL's concept does not differ significantly from that defined in the theory book, apart from that business concerning NULL. However, the theory book equates

Semijoin and Composition - SQL For semijoin, the dyadic relational operator MATCHING, defined thus: r1 MATCHING r2, where r1 and r2 are relations such that r1 JOIN r2 is de

Expressions   An expression is a randomly complex combination of the constants, variables, literals, operators, & function calls. The simplest expression is the single variabl

Parameter and Keyword Description: cursor_name: This identifies an explicit cursor formerly declared within the present scope. cursor_variable_name: These identif

Example of DELETE - SQL As with UPDATE, a FOR PORTION OF clause can be specified if the target table has a defined period name, as illustrated in Example. Example: Deleting

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

DELETE Statement The DELETE statement eliminates whole rows of data from the specified table or view. Syntax: