During development, a cursor containing a table that does not have fields may be declared to solve special problems. This article will introduce such problems in detail. For more information, see
During development, a cursor containing a table that does not have fields may be declared to solve special problems. This article will introduce such problems in detail. For more information, see
During development, a cursor containing a table that does not have fields may be declared to solve special problems. This article will introduce such problems in detail. For more information, see
Data. * is a table, and then the fields in other tables are added to the sal_data cursor.
SQL code
The Code is as follows:
Cursor sal_data (cp_center_temp_id varchar2) is
Select data .*,
Post. id emp_post_id,
Doc. Salary_Tax_Bd sa_tax_bd,
Batch. bill_year_month,
Batch. id batch_id,
Post. emp_id employee_id
From sa_salary_data data
Left join sa_salary_batch batch
On data. sa_batch_id = batch. id
Left join sa_salary_document doc
On data. sa_doc_id = doc. id
Left join pb_emp_post post
On doc. emp_post_id = post. id
Left join pb_send send
On post. send_id = send. id
Where send. cost_center_id = cp_center_temp_id;
Use this cursor:
Declare a variable of this cursor type:
SQL code
The Code is as follows:
Salary_data_temp sal_data % rowtype;
Then compile the cursor
SQL code
The Code is as follows:
Open sal_data (center_temp.id );
Loop
Fetch sal_data
Into salary_data_temp;
Exit when sal_data % notfound;
-- TODO
End loop;
Colse sal_data;