oracl 資料庫中查詢當前時間前幾天的資料

2021-06-11 07:35:46 字數 1500 閱讀 8424

create or replace procedure ecd_b2a_get_pass_data_bank(

bankid in varchar2,

beginday in number,

endday in number,

b2ano out varchar2,

accid out varchar2,

b2atype out varchar2,

b2away out varchar2,

b2aorder out varchar2,

b2aname out varchar2,

b2abank out varchar2,

b2aamount out number,

b2aremaining out number,

b2areturnurl out varchar2,

b2anotifyurl out varchar2,

b2anotify out char,

b2astate out char,

b2acheck out char,

b2adate out timestamp,

b2adatenotify out timestamp,

b2adatecheck out timestamp,

b2aoperator out varchar2,

b2aremark out varchar)is

begin

select

b2a_no, acc_id, b2a_type, b2a_way, b2a_order, b2a_name, b2a_bank, b2a_amount,b2a_remaining,

b2a_return_url, b2a_notify_url, b2a_notify, b2a_state, b2a_check,

b2a_date, b2a_date_notify, b2a_date_check, b2a_operator, b2a_remark

into

b2ano,accid,b2atype,b2away,b2aorder,b2aname,b2abank,b2aamount,b2aremaining,b2areturnurl,b2anotifyurl,

b2anotify,b2astate,b2acheck,b2adate,b2adatenotify,b2adatecheck,b2aoperator,b2aremark

from t_b2a b2a

where

b2a.b2a_bank = bankid

and b2a.b2a_date between sysdate-beginday and sysdate-endday;

exception

when no_data_found then

null;

when others then

raise;

end ecd_b2a_get_pass_data_bank;

查詢當前資料庫。。

查詢當前資料名 方法一 select name from v database 方法二 show parameter db 方法三 檢視引數檔案。查詢當前資料庫例項名 方法一 select instance name from v instance 方法二 show parameter instan...

查詢資料庫當前時間 Oracle, DB2

查詢資料庫當前時間 oracle,db2等均支援 select to char sysdate,yyyy mm dd hh24 mi ss from dual select to char sysdate,yyyy from dual 年 select to char sysdate,mm from...

oracl資料庫的常用知識

cmd的解鎖命令 sqlplus as sysdba sql alter user scott acount unlock 使其未鎖定 sql alter user scott acount identified by 密碼 修改其密碼 sql conn scott 密碼 根據新的密碼和使用者名稱連...