Monday 26 March 2018

Function Queries(Return More Than one Rows)

                                           Function Queries(Return More Than one Rows)



1.In table ABC i have columns like
name gender sal
------ ------- -----
a M 1000
b F 
c F 2000
d M 
e F 3000
I want to change gender from 'M' to 'F' and 'F' to 'M
where ever salary is null.How its possible??


create or replace type xxorc_fb as object
(gender varchar2(20));

create or replace type xxorc_fb_ta as table of xxorc_fb;

CREATE OR REPLACE function XXHRS_FB3 
RETURN xxorc_fb_ta
as
p_gen1 xxorc_fb_ta;
p_gen xxorc_fb_ta;
begin
--select xxorc_fb(GENDER)bulk collect into p_gen FROM XXHRS_FB2 WHERE id is null;
SELECT xxorc_fb( CASE GENDER WHEN 'M' THEN 'F'
WHEN 'F' THEN 'M'
ELSE 'G' END )bulk collect into p_gen1
FROM XXHRS_FB2 WHERE id is null;
return p_gen1;
end;


select XXHRS_FB3 from dual

                                         Any Queries Mail Me vivekexpertize@gmail.com

No comments:

Post a Comment

Calling Different Language Layout Based On Conditions :

API For Calling Layout : 1.fnd_request.add_layout CREATE OR REPLACE procedure APPSLSPO_Calling_Templates1(ERRBUFF OUT VARCHAR,RETCODE O...