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 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
Forward Declarations The PL/SQL needs that you declare an identifier before using it. And hence, you should declare a subprogram before calling it. For illustration, the decla

Role of Abstraction in pl/sql: The abstraction is a high-level description or model of a real-world entity. The Abstractions keep our daily lives convenient. They help us ca

Character Types The Character types allow you to store alphanumeric data, represent words and text, and manipulate the character strings. CHAR You use the CHAR dataty

Other monadic - SQL In 2VL there are just 4 (2 2 ) monadic operators, of which negation is really the only "useful" one. When a third truth value is introduced we have 27 (3 3

Running the PL/SQL Wrapper To run the PL/SQL Wrapper, go through the wrap command at your operating system prompt by using the syntax as shown: wrap iname=input_file [oname=

Deriving Predicates from Predicates in SQL The corresponding section in the theory book describes how predicates can be derived from predicates using (a) the logical connectiv

Use Bulk Binds If SQL statements execute inside a loop using the collection elements as bind variables, context switching between the PL/SQL & SQL engines can slow down the ex

Using DELETE This process has three forms. The DELETE removes all elements from the collection. DELETE(n) removes the nth element from the nested table. When n is null, then D

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Disjunction (OR, ∨) Again we have nine rows instead of just four and again, when unknown is not involved, the rows are as for 2VL. Also, when anything is paired with true, t