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
Using Subqueries A subquery is a query (typically enclosed by parentheses) that appears within another SQL data manipulation statement. If evaluated, the subquery gives a va

a. Create a table odetails_new. It has all the attributes of odetails and an additional column called cost, whose values are the product of the quantity and price of the part bein

Using TRIM This process has two forms. The TRIM removes an element from the end of the collection. The TRIM(n) removes the n elements from the end of the collection. For e.g.

COMMIT Statement The COMMIT statement explicitly makes everlasting changes to the database during the present transaction. The Changes made to the database are not considered e

SQL Functions The PL/SQL uses all the SQL functions involving the following aggregate functions that summarize the whole columns of the Oracle data: GROUPING, AVG, COUNT, STDDE

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

Example of NOT EXISTS Operator - SQL Example is a translation into SQL of the corresponding example, which is included there merely to show that for any scalar comparison the

Functions   The function is a subprogram that calculates a value. The Functions and procedures are structured similar, except that the functions have a RETURN clause. You can

Explicitly specifying the join condition - SQL SELECT * FROM IS_CALLED JOIN IS_ENROLLED_ON ON ( IS_CALLED.StudentId = IS_ENROLLED_ON.StudentId ) Now, the key word JO

Advantages of Exceptions Using the exceptions for the error handling has many benefits. Without an exception handling, every time you issue a command, you should ensure for th