User Defined Functions in PLSQL | Oracle PL/SQL Tutorial Videos | Mr.Vijay Kumar

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Your all video is so awesome that any one can be good in PL/SQL Programming .. A salute to you sir :)

swati
Автор

Question 1:
Create a procedure that accepts 3 parameters, the first two are of mode IN with number as
their datatype and the third one is of mode OUT in form of Varchar2. The procedure will
compare the first two numbers and output the result as EQUAL, or DIFFERENT.
Create a second procedure called L8Q1 that accepts the two sides of a rectangle. The
procedure will calculate the area and the perimeter of the rectangle. Use the procedure
created previously to display if the shape is a square or a rectangle. The following are the
example on how we execute the procedure and the expected output.
SQL > exec L4Q1(2, 2)
The area of a square size 2 by 2 is 4. It`s perimeter is 8.
SQL > exec L4Q1(2, 3)
The area of a rectangle size 2 by 3 is 6. It`s perimeter is 10.

jaspreetkathuria
Автор

Create a function named 'find_stadium_count' which takes k_city_id as
input and returns the stadium_count, i.e., it returns the number of
stadiums in the city which its corresponding id as k_city_id.

 

Use the skeleton file, to create the function.

Function name: find_stadium_count

Input parameter : k_city_id with data type as int.

Output parameter : stadium_count with data type as int.

Table used : k_venue.

when i tried i am getting compilation error plz help me out sir...!
 please write a function for the given specifications sir?

bhavesh
Автор

Am only see your videos when reading Oracle and purchased your text book from naresh it sir .

appustorage
Автор

Can you help me in this


Create a pseudo function called pseudo_fun that accepts 2 parameters represented the
height and width of a rectangle. The pseudo function should return the area and the
perimeter of the rectangle.
Create a second procedure called L4Q2 that accepts the two sides of a rectangle. The
procedure will use the pseudo function to display the shape, the area and the perimeter.
SQL > exec L4Q2(2, 2)
The area of a square size 2 by 2 is 4. It`s perimeter is 8.
SQL > exec L4Q2(2, 3)
The area of a rectangle size 2 by 3 is 6. It`s perimeter is 10.

jaspreetkathuria
Автор

sir, i need for answer with 2 examples....

shivapotnuru
Автор

can we call functions inside the procedure and can we call procedure inside the function in sql? plz tell me need for 2 examples regarding above problems

shivapotnuru
Автор

How to create Function in pgsql that
if id=0
then insertion operation will be done
elsif id>0 and is_active=1 then
updation operation must be done
elsid id>0 and is_active=0
then update
only
is_active=0

junaidbinabduljabbar
Автор

Sir we must use capitals in' creating or replace function' line

sharmilakondakamarla
Автор

What is "from dual" in the end of example function ?

AyazurRahman
Автор

SYNTAX FOR SQL * PLUS (other_way round)

1 SQL> CREATE OR REPLACE
2 FUNCTION CALC ( a IN number, b IN number, op IN varchar)RETURN number
3 is
4 RESULT NUMBER(10);
5 begin
6 if op ='+' then
7 result:= (a+b);
8 elsif op ='-'then
9 result :=(a-b);
10 elsif op ='*' then
11 result:= (a*b);
12 else
13 result :=(a/b);
14 end if;
15 RETURN result;
16 end;
17 /

omkarbhalerao