1 if end if语句的function实例
create or replace function GET_PUBLICHOLIDAYTIME(fromtime in Date,totime in Date,isAvalible in number)
return number
as
--定义变量
free_day number:=0;
minDate Date;
maxDate Date;
total number:=0;
fromdate Date:=TO_DATE(to_char(fromtime,'yyyy-MM-dd'),'yyyy-MM-dd');
todate Date:=TO_DATE(to_char(totime,'yyyy-MM-dd'),'yyyy-MM-dd');
begin
if isAvalible = 1 then
select min(calendar_date),max(calendar_date),count(calendar_date),into minDate,maxdate,total from T_BI_TNT_DATE;
when calendar_date between fromDate and toDate
and IS_PUBLIC_HOLIDAY =1;
if minDate = fromDate then
total:=total - 1;free_day:= free_day + ((minDate-1-fromtime));
end if;
if maxDate = toDate then
total:=total - 1;free_day:= free_day + ((totime-maxDate));
end if;
if minDate = maxDate then
free_day:= totime-fromtime;
else
free_day:=free_day+total;
end if;
end if;
return free_day;
end GET_PUBLICHOLIDAYTIME;
分享到:
相关推荐
This poster displays the V$ views of Oracle database 10g categorized by major function. The V$(dynamic performance) views are supplement of views to the data dictionary and contain valuable real-time ...
ORACLE instance started. 2、在双机环境下 要想启动或关闭ORACLE系统必须首先切换到root用户,如下 su - root a、启动ORACLE系统 hareg -y oracle b、关闭ORACLE系统 hareg -n oracle Oracle数据库有哪几种...
<1>.creating function-based indexes sql> create index summit.item_quantity on summit.item(quantity-quantity_shipped); <2>.create a B-tree index sql> create [unique] index index_name on table_...
.instance('Config', require('./config.json')) .factory('Database', function(locator) { var config = locator.get('Config'); var database = new Database(config.db); return database; }) ....
However, if the instance fails to start, a reboot of the server supporting the instance will usually allow startup to succeed. Patches At the time of writing, patches were under development on top ...
ORACLE instance started. 2、在双机环境下 要想启动或关闭ORACLE系统必须首先切换到root用户,如下 su - root a、启动ORACLE系统 hareg -y oracle b、关闭ORACLE系统 hareg -n oracle Oracle数据库有哪几种...
伪数据生成器按照一定的数据规则,生成大量的数据,支持teradata数据导入和oracle数据导入。软件作用:为测试软件在大数据量下的性能而给数据库导入大量的数据。<?php namespace Samsui\Generator; use \...
Connection popup menu item "New Instance" added to open a new PL/SQL Developer instance for the selected connection When the read-only status of a file changes this will be propagated to a window ...
Crash recovery saved per InstanceName parameter value Shortcut key assigned to object functions could insert a character in editor SQL Window "totals" comment directive did not use "sum" as the ...
1 安装oracle,这个例子只做了oracle版本,如果需要,后期可以加上mysql版本,呵呵。 2 运行建用户及表空间的脚本。db_desc_ddl.sql. 3 执行初始化数据脚本。db_desc_dml.sql 4 导入工程,部署,打开浏览器输入 ...
You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the ...
* Full support for MySQL, Oracle, PostgreSQL and Microsoft SQL Server database management system back-end. Besides these four DBMS, sqlmap can also identify Microsoft Access, DB2, Informix and ...
Instantiation using an instance factory method ........................................... 30 4.4. Dependencies ...........................................................................................
Instantiation using an instance factory method ........................................... 30 4.4. Dependencies ...........................................................................................