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.

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,

 

Deniz Parlak

Hi, I'm a Computer Engineering student in Dumlupınar University.I will graduate next year. I did an internship TurkNet Telecominication Company in 2018 June- 2018 September. I had experience Linux/Unix system, SQL Server Management , SSRS, Mysql Database Management,Troubleshooting performance issues in Linux. I also interested Oracle database and technologies. I want to work as Oracle DBA after my University. I am practicing Unix, Exadata, Orace Cloud, Oracle RAC, Dataguard, EBS, Oracle BI and etc and i hope the articles will be helpful. Any questions, or support please write email deniz.parlak@yahoo.com