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
Next revision
Previous 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:10]
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_last date;
 +  v_date date;
 +BEGIN
 +  v_date := to_date(p_year||lpad(p_month,​ 2, 0)||'​01',​ '​yyyymmdd'​);​
 +  ​
 +  v_date_last := last_day(v_date);​
 +  while v_date <= v_date_last loop
 +  --  v_date := v_date + 1;    ​
 +    pipe row(v_date);​
 +    v_date := v_date + to_dsinterval('​1 00:​00:​00'​);​
 +  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