WM_CONCAT
select WMSYS.WM_CONCAT(last_name) into v from employees
where department_id=:DEPARTMENT_ID;
declare
cursor c1 is select last_name from employees where department_id=:p_department_id;
v_name varchar2(1000):='Department id :';
begin
for rec in c1 loop
v_name:=v_name||' , '||rec.last_name;
end loop;
return (v_name);
end;
WHERE CURRENT OF
select WMSYS.WM_CONCAT(last_name) into v from employees
where department_id=:DEPARTMENT_ID;
declare
cursor c1 is select last_name from employees where department_id=:p_department_id;
v_name varchar2(1000):='Department id :';
begin
for rec in c1 loop
v_name:=v_name||' , '||rec.last_name;
end loop;
return (v_name);
end;
WHERE CURRENT OF
DECLARE
CURSOR trip_cursor IS
SELECT
bt_id_pk,
bt_duration
FROM
business_trips
WHERE
bt_id_pk = 23
FOR UPDATE OF bt_id_pk, bt_duration;
BEGIN
FOR trip_record IN trip_cursor LOOP
UPDATE business_trips
SET bt_duration = 5
WHERE CURRENT OF trip_cursor;
END LOOP;
COMMIT;
END;
DECLARE
CURSOR C1 IS
SELECT ACCOUNT_HEAD_ID_TMP, PARENT_ACCOUNT_HEAD_ID_TMP FROM AFD_CHART_OF_ACCOUNTS A, GBDML.FF_DEALER_SETUP B
WHERE A.ACCOUNT_HEAD_ID=B.ACCOUNT_HEAD_ID
AND A.COMPANY_ID='000004'
FOR UPDATE OF B.ACCOUNT_HEAD_ID;
BEGIN
FOR REC IN C1 LOOP
UPDATE GBDML.FF_DEALER_SETUP
SET ACCOUNT_HEAD_ID=REC.ACCOUNT_HEAD_ID_TMP
WHERE CURRENT OF C1;
END LOOP;
COMMIT;
END;
/
DECLARE
CURSOR C1 IS
SELECT a.salary FROM alamin A, alamin2 B
WHERE A.ID=B.ID
FOR UPDATE OF B.salary;
BEGIN
FOR REC IN C1 LOOP
UPDATE alamin2
SET salary=REC.salary
WHERE CURRENT OF C1;
END LOOP;
END;
SIGN OPERATOR
select decode(sign(x.sal1-y.sal2),1,'A',0,'B',-1,'C') Value
from
(select sum(salary) sal1
from employees
where department_id = 20) x,
(select sum(salary) sal2
from employees
where department_id = 30) y
DECLARE
CURSOR C1 IS
SELECT ACCOUNT_HEAD_ID_TMP, PARENT_ACCOUNT_HEAD_ID_TMP FROM AFD_CHART_OF_ACCOUNTS A, GBDML.FF_DEALER_SETUP B
WHERE A.ACCOUNT_HEAD_ID=B.ACCOUNT_HEAD_ID
AND A.COMPANY_ID='000004'
FOR UPDATE OF B.ACCOUNT_HEAD_ID;
BEGIN
FOR REC IN C1 LOOP
UPDATE GBDML.FF_DEALER_SETUP
SET ACCOUNT_HEAD_ID=REC.ACCOUNT_HEAD_ID_TMP
WHERE CURRENT OF C1;
END LOOP;
COMMIT;
END;
/
DECLARE
CURSOR C1 IS
SELECT a.salary FROM alamin A, alamin2 B
WHERE A.ID=B.ID
FOR UPDATE OF B.salary;
BEGIN
FOR REC IN C1 LOOP
UPDATE alamin2
SET salary=REC.salary
WHERE CURRENT OF C1;
END LOOP;
END;
SIGN OPERATOR
select decode(sign(x.sal1-y.sal2),1,'A',0,'B',-1,'C') Value
from
(select sum(salary) sal1
from employees
where department_id = 20) x,
(select sum(salary) sal2
from employees
where department_id = 30) y
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন