This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with tab | |
as (select 'aa' as p1, 'bb' as p2 from dual union all | |
select 'cc' as p1, 'dd' as p2 from dual union all | |
select 'ee' as p1, 'ff' as p2 from dual union all | |
select 'gg' as p1, 'hh' as p2 from dual) | |
select max(case when rownum = 1 then p1 || p2 end) as r1, | |
max(case when rownum = 2 then p1 || p2 end) as r2, | |
max(case when rownum = 3 then p1 || p2 end) as r3, | |
max(case when rownum = 4 then p1 || p2 end) as r4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace procedure api(p1 out number, | |
p2 out number, | |
p3 out number) | |
as | |
begin | |
p1 := 1; | |
p2 := 2; | |
p3 := 3; | |
end api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
l_number_i_am_interested_in number; | |
l_p2_dummy number; | |
l_p3_dummy number; | |
begin | |
api(p1 => l_number_i_am_interested_in, | |
p2 => l_p2_dummy, | |
p3 => l_p3_dummy); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
l_number_i_am_interested_in number; | |
l_dummy number; | |
begin | |
api(p1 => l_number_i_am_interested_in, | |
p2 => l_dummy, | |
p3 => l_dummy); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
l_number_i_am_interested_in number; | |
l_dummy number; | |
begin | |
api(p1 => l_number_i_am_interested_in, | |
p2 => l_dummy, | |
p3 => l_dummy); | |
dbms_output.put_line(l_dummy); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace procedure api(p1 out number, | |
p2 out number, | |
p3 out number, | |
p4 out number, | |
p5 out number, | |
p6 out number, | |
p7 out number, | |
p8 out number, | |
p9 out number) | |
as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
l_number_i_am_interested_in number; | |
l_dummy number; | |
begin | |
api(p1 => l_number_i_am_interested_in, | |
p2 => l_dummy, | |
p3 => l_dummy, | |
p7 => l_dummy, | |
p8 => l_dummy, | |
p9 => l_dummy, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Try it out. It works! | |
x = [[1,2], [3,4], [5,6]] | |
x = [x for x in x for x in x] | |
# x = [1, 2, 3, 4, 5, 6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [[1, 2], [3, 4], [5, 6]] | |
b = [x for l in a for x in l] | |
# b = [1, 2, 3, 4, 5, 6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
def foo(): | |
x = [1, 2, 3] | |
print(traceback.extract_stack()) | |
if __name__ == '__main__': | |
foo() |
OlderNewer