0% found this document useful (0 votes)
152 views1 page

Cursor in Oracle

This document is about the cursor concept in Oracle. The central purpose of the Oracle PL/SQL language is to make it as easy and efficient as possible to query and change the contents of tables in a database. You must, of course, use the SQL language to access tables, and each time you do so, you use a cursor to get the job done. A cursor is a pointer to a private SQL area that stores information about the processing of a SELECT or data manipulation language (DML) statement (INSERT, UPDATE, DELETE, or MERGE). Cursor management of DML statements is handled by Oracle Database, but PL/SQL offers several ways to define and manipulate cursors to execute SELECT statements. This article focuses on the most-common ways programmers execute SELECT statements in PL/SQL, namely

Uploaded by

deveshdashora123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views1 page

Cursor in Oracle

This document is about the cursor concept in Oracle. The central purpose of the Oracle PL/SQL language is to make it as easy and efficient as possible to query and change the contents of tables in a database. You must, of course, use the SQL language to access tables, and each time you do so, you use a cursor to get the job done. A cursor is a pointer to a private SQL area that stores information about the processing of a SELECT or data manipulation language (DML) statement (INSERT, UPDATE, DELETE, or MERGE). Cursor management of DML statements is handled by Oracle Database, but PL/SQL offers several ways to define and manipulate cursors to execute SELECT statements. This article focuses on the most-common ways programmers execute SELECT statements in PL/SQL, namely

Uploaded by

deveshdashora123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

create view ccc as select * from company where company_id=&cid; create cursor ddd (id in number) is products - pno,pname,categoryid,companyid

create cursor pro_info (pid in number) select pno,pname,category_name, company_name, select sum(amount) from purchase where prono=pid, select sum(amount) from sales where prono=pid, from products, categories, companies where products.companyid=companies.compid a nd products.categoryid = categories.category_id and products.pno = pid; declare cominfo company_cur%ROWTYPE; begin OPEN company_cur(101); loop while company_cur % found FETCH company_cur into cominfo; insert into othercompany values(cominfo.company_id, comi nfo.company_name, cominfo.company_city); end loop; CLOSE company_cur; end; declare cominfo company_cur%ROWTYPE; begin OPEN company_cur(101); loop FETCH company_cur into cominfo; EXIT WHEN company_cur % NOTFOUND; insert into othercompany values(cominfo.company_id, cominfo.comp any_name, cominfo.company_city); end loop; CLOSE company_cur; end;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy