如果你沒有在system資料表空間上建表,可以用 select * from tabs where tablespace_name!='SYSTEM' select * from user_tables就可以了,除非你把庫建在系統資料表空間SELECT OWNRE,TABLE_NAME FROM ALL_TABLES WHERE TABLESPACE_NAME <>'SYSTEM' 前提是你沒在sys
建立表create table Atable(test1 varchar2(20),test2 varchar2(20));建立預存程序create or replace procedure TestD(PARA_1 IN VARCHAR2,PARA_2 OUT VARCHAR2) ASBEGIN--SELECT INTO PARA_2 FROM Atable where test1=PARA_1;select test1 into PARA_2 from Atable where test1=
dual是一個虛擬表,用來構成select的文法規則,oracle保證dual裡面永遠只有一條記錄。我們可以用它來做很多事情,如下:1、查看目前使用者,可以在 SQL Plus中執行下面語句select user from dual;2、用來調用系統函數select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;--獲得當前系統時間select SYS_CONTEXT('USERENV','TERMINAL') from
轉載自:http://www.iteye.com/topic/82587 資料字典dict總是屬於Oracle使用者sys的。 1、使用者: select username from dba_users; 改口令 alter user spgroup identified by spgtest; 2、資料表空間: select * from dba_data_files; select * from dba_tablespaces;//資料表空間 select
現在有個每天至少300W資料的表(mt),打算以每月分區的方式建成分區表,分區時,《讓oracle跑的更快2》P21說:SQL>alter system set db_create_file_dest='F:\oradata\orclyxkj\tbs_test_t_mt_2012';SQL>create tablespace ts_mt_2012_1 datafile size 50M autoextend
oracle:文法:substr(string,a,b):a:從第幾位開始,第一位a=1,倒數第三位(即sqlserver中的right)a=-3b:取幾個字元 substr('This is a test', 6, 2) would return 'is' substr('This is a test', 6) would return 'is a test' substr('TechOnTheNet', 1, 4) would return 'Tech'
需求:如果欄位值不是數字或者數字型字串,把該欄位值update成'' 1.函數法(不能批量,捨棄):create or replace function isNumber(p_in varchar2) return boolean as i number; begin i:=to_number(p_in); return true; exception when
1.標準的(case結束是end case,但是用end也可以,2就是,可是1中不能直接用end,會報錯)if tmpmoshiid is not null then CASE WHEN (main2.allcount<=100) THEN select t_0_100 into tmpkcbili from t_cl_moshi where id=tmpmoshiid; WHEN (main2.allcount<=1000) THEN select t_
sqlserver中,返回影響行數是:If @@RowCount<1 oracle中,返回影響行數是:If sql%rowcount<1 例:sqlserver:ASBEGINUpdate T_Mt Set Stat=@Stat,OStat=@Stat,RptTime=Getdate() Where MsgId=@MsgIdIf @@RowCount<1--沒有更新成功就插入到t_Statbufinsert into t_statbuf(MsgId,Stat,RptTime)