Site icon IT Tutorial

PLSQL Programing -3

Hi, I continue to write PL / SQL. In the previous article, we have examined the simple block structure and made a small start, now we will continue with the function and procedure blocks. If you haven’t looked at my previous post, you can find it here.

PL/SQL Programing -2

The functions return a single value in the code, the code that will run in the function runs in the BEGIN-END block, I will refer to the data description later.

 

Function Block:

Syntax rule is  ,

FUNCTION function_name

RETURN data_type

IS

BEGIN

PL/SQL code

END

Procedure Block:

Unlike the function block, it can return more than one value to the result value. I will share your detailed narrative in future articles.

PROCEDURE prodecure_name

IS

BEGIN

PL/SQL code

END

PL/SQL Data Assignment :

As with any software language, we can assign specific values to variables in PL / SQL. For these operations we use certain symbols, for example in assignment operations: = with the symbol assignment process.

DECLARE

isim VARCHAR2(40);

BEGIN

isim:='MUSTAFA KEMAL ATATÜRK';

DBMS_OUTPUT.PUT_LINE(isim);

END
/

We can also use SQL statements (UPDATE-INSERT-DELETE-SELECT, etc.) in the code. Let’s continue with an example,

 

As you can see, in this way, we can add and run the inquiries into our plsql code. In the next post I’ll continue with the characters data types and variables,

 

Exit mobile version