`

Oracel function instance

 
阅读更多
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;
分享到:
评论

相关推荐

    oracle views 10g

    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常用命令大全.txt

    ORACLE instance started. 2、在双机环境下 要想启动或关闭ORACLE系统必须首先切换到root用户,如下 su - root a、启动ORACLE系统 hareg -y oracle b、关闭ORACLE系统 hareg -n oracle 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_...

    service-oracle:服务定位器

    .instance('Config', require('./config.json')) .factory('Database', function(locator) { var config = locator.get('Config'); var database = new Database(config.db); return database; }) ....

    p7331323_10204_AIX5L

    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 ...

    orcale常用命令

    ORACLE instance started. 2、在双机环境下 要想启动或关闭ORACLE系统必须首先切换到root用户,如下 su - root a、启动ORACLE系统 hareg -y oracle b、关闭ORACLE系统 hareg -n oracle Oracle数据库有哪几种...

    samsui-master伪数据生成库.zip

    伪数据生成器按照一定的数据规则,生成大量的数据,支持teradata数据导入和oracle数据导入。软件作用:为测试软件在大数据量下的性能而给数据库导入大量的数据。<?php namespace Samsui\Generator; use \...

    PLSQL.Developer v11.0.0.1762 主程序+ v10中文包+keygen

    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 ...

    PLSQL.Developer v11.0.4.1774 主程序+ v11中文包+keygen

    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 ...

    基于EXT SSI的简单树实现

    1 安装oracle,这个例子只做了oracle版本,如果需要,后期可以加上mysql版本,呵呵。 2 运行建用户及表空间的脚本。db_desc_ddl.sql. 3 执行初始化数据脚本。db_desc_dml.sql 4 导入工程,部署,打开浏览器输入 ...

    php.ini-development

    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 ...

    sqlmap (懂的入)

    * 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 ...

    spring-framework-reference4.1.4

    Instantiation using an instance factory method ........................................... 30 4.4. Dependencies ...........................................................................................

    spring-framework-reference-4.1.2

    Instantiation using an instance factory method ........................................... 30 4.4. Dependencies ...........................................................................................

Global site tag (gtag.js) - Google Analytics