Skip to main content

Using records with cursors in oracle database language plsql

RECORD is every single item in cursor (cursordaki herbir kayıt RECORD diye tanımlanır)
There is 3 way to use records (with cursor) 

1 - creating cursor and fetching it into record

You can create cursor (vc_MyCursor) and record (vr_RecEmployees) at the beginning of anonymous block and  open it in begin-end section, then can fetch it into a record by using

FETCH vc_MyCursor INTO vr_RecEmployees;
At the cursor should be closed as 
CLOSE vc_MyCursor;

2 - using record as cursor of select statement in for loop

Simple you can create a local record in for loop as
FOR rec IN (SELECT * FROM employees e WHERE department_id = 30) LOOP
...
  END LOOP;

3 - using record based on cursor in for loop!

 Another easier way to create a local record is using created cusrsor in for loop as
 FOR rec IN vc_MyCursor LOOP
...
  END LOOP;

All codes are available in GitHub here.
If you want to check some real project with all PLSQL codes please check here
Till next time!

Comments

Popular posts from this blog

Vodafone'da Sms Gönderimi için Bakiyeniz Yetersizdir Sorunu Çözüldü

Vodafone'nun sms gönderimi için bakiyeniz yetersizdir Sorunu Çözüldü!.

How to Hack WhatsApp Account Bluestack

How to hack WhatsApp account??? WhatsApp is currently one of the most secure messaging services purely because it works with a particular phone number and requires a certain code.

EXCELde Belli Satirlari ya da Sütunları Dondurmak, Sabitlemek

Excel'de önemli gördüğümüz üst satır -başlık- kısmını veya sol sutunu sabit tutmak, her sayfada görünmesini sağlamak artık çok kolay.

Simply Hacking Facebook Account with Kali Linux

Hi guys, today I will show you how to hack a Facebook account with  Kali Linux.

Polonya'da Erasmus, Szczecin'e Yol Haritasi

#Erasmus için Polonya'nın Szczecin şehrine gidecek arkadaşlar için detaylı #yol #harita sı ve Szczecin hakkında bilmeniz gerekenler... Polonya Szczecin'de Erasmus için Yol Haritasi