1 2 3 4 5 6 > >>   Sort: Rank

Scalar Data Types Supported in PL/SQL in Oracle
How Many Scalar Data Types Are Supported in PL/SQL in Oracle? PL/SQL supports many scalar data types divided into 4 groups: Numeric Types: BINARY_DOUBLE, BINARY_FLOAT, BINARY_INTEGER, DEC, DECIMAL, DOUBLE PRECISION, FLOAT, INT, INTEGER, NATURAL, NATURALN, NUMBER, NUMERIC, PLS_INTEGER, POSITIVE, POSI...
2018-11-17, 461👍, 0💬

Convert Character Types to Numeric Types in Oracle
How To Convert Character Types to Numeric Types in Oracle? You can convert character types to numeric types in two ways: Explicitly by using TO_NUMBER() function. Implicitly by putting character data in a numeric operation. The sample script below shows you how to convert character types to numeric ...
2018-11-17, 423👍, 0💬

Categories of Data Types in PL/SQL in Oracle
How Many Categories of Data Types in Oracle? PL/SQL data types are grouped into 4 categories: Scalar Data Types: A scalar data type holds a single value. Composite Data Types: A composite data type has internal components, such as the elements of an array. LOB Data Types: A LOB data type holds a lob...
2018-11-17, 390👍, 0💬

Declare Local Variables in Oracle
How To Declare a Local Variable in Oracle? A local variable can be defined in the declaration part with a declaration statement, which is a variable name followed a data type identifier. Below are some examples of declaration statements: PROCEDURE proc_var_1 AS domain VARCHAR2(80); price REAL; is_fo...
2018-11-17, 371👍, 0💬

Types of Execution Flow Control Statements in Oracle
What Are the Execution Control Statements in Oracle? PL/SQL supports three groups of execution control statements: IF Statements - Conditionally executes a block of statements. CASE Statements - Selectively executes a block of statements. LOOP Statements - Repeatedly executes a block of statements. ...
2018-11-17, 340👍, 0💬

Create a Stored Function in Oracle
How To Create a Stored Function in Oracle? A stored function is a function with a specified name and stored into the current database. If you want to create a stored function, you can use the CREATE FUNCTION statement. The example script below creates a stored procedure: SQL> CREATE OR REPLAC...
2018-11-11, 487👍, 0💬

Create a Stored Procedure in Oracle
How To Create a Stored Procedure in Oracle? A stored procedure is a procedure with a specified name and stored into the current database. If you want to create a stored procedure, you can use the CREATE PROCEDURE statement. The example script below creates a stored procedure: SQL> CREATE PROC...
2018-11-11, 448👍, 0💬

Drop a Stored Procedure in Oracle
How To Drop a Stored Procedure in Oracle? If there is an existing stored procedure and you don't want it any more, you can remove it from the database by using the DROP PROCEDURE statement as shown in the following script example: SQL> CREATE PROCEDURE Greeting AS 2 BEGIN 3 DBMS_OUTPUT.PUT_LI...
2018-11-11, 433👍, 0💬

Pass Parameters to Procedures in Oracle
How To Pass Parameters to Procedures in Oracle? Store procedures or functions can take parameters. You need to define parameters while defining the procedure, and providing values to parameters while calling the procedure. The script below shows you how to do this: SQL> CREATE OR REPLACE PROC...
2018-11-11, 413👍, 0💬

Execute a Stored Procedure in Oracle
How To Execute a Stored Procedure in Oracle? If you want to execute a stored procedure, you can use the EXECUTE statement. The example script below shows how to executes a stored procedure: SQL> set serveroutput on; SQL> CREATE PROCEDURE Greeting AS 2 BEGIN 3 DBMS_OUTPUT.PUT_LINE('Welc...
2018-11-11, 382👍, 0💬

Types of PL/SQL Code Blocks in Oracle
What Are the Types PL/SQL Code Blocks in Oracle? There are 3 types of PL/SQL code blocks: Anonymous Block - A block of codes with no name. It may contain a declaration part, an execution part, and exception handlers. Stored Program Unit - A block of codes with a name. It is similar to an anonymous b...
2018-10-30, 478👍, 0💬

How Many Anonymous Blocks Can Be Defined in Oracle
How Many Anonymous Blocks Can Be Defined in Oracle? An anonymous block is stored in the user's current session without any name. So you can only define one anonymous block at any time. If you define another anonymous block, the new block will replace the previously defined block, as shown in the fol...
2018-10-30, 460👍, 0💬

What Is PL/SQL in Oracle
What Is PL/SQL in Oracle? PL/SQL is a modern, block-structured programming language. It provides several features that make developing powerful database applications very convenient. For example, PL/SQL provides procedural constructs, such as loops and conditional statements, that are not available ...
2018-10-30, 437👍, 0💬

Define an Anonymous Block in Oracle
How To Define an Anonymous Block in Oracle? An anonymous block must have an execution part, which is a group of other PL/SQL statements enclosed in the BEGIN ... END statement. Here is a script on how to define a simple anonymous block with SQL*Plus: SQL> set serveroutput on; SQL> begi...
2018-10-30, 415👍, 0💬

Run the Anonymous Block Again in Oracle
How To Run the Anonymous Block Again in Oracle? If you have an anonymous block defined in your session, you can run it any time by using the "/" command as shown in the following script: SQL> set serveroutput on; SQL> begin 2 dbms_output.put_line('This is a PL/SQL FAQ.'); 3 end; 4 / Th...
2018-10-30, 412👍, 0💬

Call a Stored Function in Oracle
How To Call a Stored Function in Oracle? A stored function can be called as part of expression in any PL/SQL statement. One simplest way to call a stored function is to a dummy SELECT statement as shown in the following tutorial script using SQL*Plus: SQL> CREATE OR REPLACE FUNCTION GET_SITE ...
2018-10-26, 481👍, 0💬

Define a Sub Procedure in Oracle
How To Define a Sub Procedure in Oracle? A sub procedure is a named procedure defined and used inside another procedure or function. You need to define a sub procedure in the declaration part of the enclosing procedure or function. Sub procedure definition starts with the PROCEDURE key word. Here is...
2018-10-26, 468👍, 0💬

Call a Stored Functoin with Parameters in Oracle
How To Call a Stored Function with Parameters in Oracle? You can define a function that takes parameters, provide values to those parameters when calling the function. Here is a good example of a function with a parameter: SQL> CREATE OR REPLACE FUNCTION GET_DOUBLE(X NUMBER) 2 RETURN NUMBER A...
2018-10-26, 437👍, 0💬

Drop a Stored Function in Oracle
How To Drop a Stored Function in Oracle? If there is an existing stored function and you don't want it any more, you can remove it from the database by using the DROP FUNCTION statement as shown in the following script example: SQL> CREATE OR REPLACE FUNCTION GET_SITE 2 RETURN VARCHAR2 AS 3 B...
2018-10-26, 395👍, 0💬

Call a Sub Procedure in Oracle
How To Call a Sub Procedure in Oracle? To call a sub procedure, just use the sub procedure name as a statement. Here is another example of calling a sub procedure: SQL> CREATE OR REPLACE PROCEDURE WELCOME AS 2 PROCEDURE WELCOME_PRINT(S CHAR) AS 3 BEGIN 4 DBMS_OUTPUT.PUT_LINE('Welcome to ' || ...
2018-10-26, 375👍, 0💬

Use "OUT" Parameters in Oracle
How To Use "OUT" Parameter Properly in Oracle? Here are the rules about OUT parameters: A formal OUT parameter acts like an un-initialized variable. It must be assigned with new values before the end of the procedure or function. An actual OUT parameter must be a variable. An actual OUT parameter wi...
2018-10-19, 489👍, 0💬

Parameter Modes Supported by PL/SQL in Oracle
What Are the Parameter Modes Supported by PL/SQL in Oracle? PL/SQL supports 3 parameter modes on procedure/function parameters: IN: This is the default mode. IN parameters allow the calling code to pass values into the procedure or function. OUT: OUT parameters allow the procedure or function to pas...
2018-10-19, 484👍, 0💬

Define Default Values for Formal Parameters in Oracle
How To Define Default Values for Formal Parameters in Oracle? If you have an IN parameter, you can make it as an optional parameter for the calling statement by defining the formal parameter with the DEFAULT clause. This gives you the freedom of not providing the actual parameter when calling this p...
2018-10-19, 478👍, 0💬

Use "IN OUT" Parameters in Oracle
How To Use "IN OUT" Parameter Properly in Oracle? Here are the rules about IN OUT parameters: A formal IN OUT parameter acts like an initialized variable. An actual IN OUT parameter must be a variable. An actual IN OUT parameter passes a copy of its value to the formal parameter when entering the pr...
2018-10-19, 453👍, 0💬

1 2 3 4 5 6 > >>   Sort: Rank