Write a unique difference between a function and a stored procedure.

A function returns a value while a stored procedure doesn?t return a value. One key difference between a function and a stored procedure in PL/SQL is the return type. In PL/SQL, a function must return a value, while a stored procedure does not have a return type. Functions are designed to return a single value, … Read more

Does PL/SQL support CREATE command?

No. PL/SQL doesn’t support the data definition commands like CREATE. Yes, PL/SQL (Procedural Language/Structured Query Language) supports the CREATE command, but with a specific context. In PL/SQL, you use the CREATE command to create stored procedures, functions, triggers, packages, types, and other database objects. For example, you can use the CREATE PROCEDURE statement to define … Read more

How to write a single statement that concatenates the words ?Hello? and ?World? and assign it in a variable named Greeting?

Greeting := ‘Hello’ || ‘World’; In PL/SQL, you can concatenate two strings using the || operator. To achieve the desired result of concatenating the words “Hello” and “World” and assigning it to a variable named Greeting, you can use the following single statement: Greeting := ‘Hello’ || ‘World’; This statement uses the || operator to … Read more

What is exception? What are the types of exceptions?

Exception is an error handling part of PL/SQL. There are two type of exceptions: pre_defined exception and user_defined exception. In PL/SQL, an exception is an error or an unexpected event that occurs during the execution of a program. When such an error occurs, the normal flow of the program is disrupted, and an exception is … Read more

What is the difference between FUNCTION, PROCEDURE AND PACKAGE in PL/SQL?

Function: The main purpose of a PL/SQL function is generally to compute and return a single value. A function has a return type in its specification and must return a value specified in that type. Procedure: A procedure does not have a return type and should not return any value but it can have a … Read more