User Tools

Site Tools


kurs:pipelined_function_mit_oracle_data_type

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
kurs:pipelined_function_mit_oracle_data_type [2014/09/10 21:22]
127.0.0.1 external edit
kurs:pipelined_function_mit_oracle_data_type [2015/04/23 13:02]
mh
Line 1: Line 1:
 +<​code>​
 +CREATE OR REPLACE TYPE T_DATE ​
 +AS TABLE OF date;
 +
 +CREATE OR REPLACE FUNCTION ​
 +GET_DAYS_OF_MONTH (p_year number, p_month number) ​
 +  RETURN t_date pipelined AS 
 +  v_date_start date;
 +  v_date date;
 +BEGIN
 +  v_date := to_date(p_year||lpad(p_month,​ 2, 0)||'​01',​ '​yyyymmdd'​);​
 +    ​
 +  while v_date < last_day(v_date) loop
 +  --  v_date := v_date + 1;
 +    v_date := v_date + to_dsinterval('​1 00:​00:​00'​);​
 +    pipe row(v_date);​
 +  end loop;
 +  ​
 +  return;
 +  ​
 +END GET_DAYS_OF_MONTH;​
 +</​code>​
 +
 <​code>​ <​code>​
 FUNCTION get_emp_per_dep FUNCTION get_emp_per_dep
kurs/pipelined_function_mit_oracle_data_type.txt ยท Last modified: 2015/04/23 13:10 by mh