Declare a record for the cursor with %ROWTYPE attribute.
Automatically takes on structure of SELECT column list.
Don’t have to declare individual variables and you only reference the ones you use.
Reference with dot notation.
Use Cursor Records to minimize typing and defer addressing details, such as the particular fields needed to perform computations.
1
DECLARE
2
CURSOR company_cur IS
;
3
company_rec company_cur%ROWTYPE;
4
BEGIN
5
OPEN company_cur;
6
FETCH company_cur INTO company_rec;
7
IF company_rec.short_nm = 'ACME'
8
THEN
9

10
END IF;
11
DECLARE2
CURSOR company_cur IS
;3
company_rec company_cur%ROWTYPE;4
BEGIN5
OPEN company_cur;6
FETCH company_cur INTO company_rec;7
IF company_rec.short_nm = 'ACME'8
THEN9

10
END IF;11


浙公网安备 33010602011771号