標籤:預存程序在小公司用的不多,但是如果業務比較複雜或者效能要求比較苛刻的時候預存程序就派上用場了,ibatis的前期的一些版本貌似不支援預存程序因此我選擇了mybatis來做實驗。1.無輸入和輸出參數的預存程序我寫了一個比較簡單的,需要注意的是Oracle無參預存程序不能寫括弧CREATE OR REPLACE Procedure cascadeoperationAsBegin Delete From teacher&nbs
標籤:create or replace procedure pr_test1 isv_case number(3) := 100;--定義變數begin-- /*判斷語句if 2>1 then dbms_output.put_line(‘條件成立‘); else dbms_output.put_line(‘條件不成立‘); end if; if 2<1 then dbms_output.put_line(‘條件成立‘);elsif 4>3 then
標籤:dual是Oracle提供的最小的工作表,只有一行一列,具有某些特殊功用。不論進行何種操作(不要刪除記錄),它都只有一條記錄——‘X‘。作用:1、select計算常量運算式、偽列等值。dual表只能返回一條資料,而使用其它表時則可能返回多條資料。2、查看目前使用者 select user from dual; select count(*) from dual;3、用作計算機 select 7*9*10-10 from
標籤:關聯查詢笛卡爾積 指做關聯操作的每個表的每一行都和其他表的每一行組合,假設兩個表的記錄條數分別為x和y,笛卡爾積將返回x*y條記錄例如:select count(*) from emp; select count(*) from dept; select emp.ename,dept.dname from emp,dept;
標籤:以啟動DB12為例子 $ sqlplus ‘/as sysdba‘SQL*Plus: Release 12.1.0.2.0 Production on Sun Nov 1 15:48:15 2015Copyright (c) 1982, 2014, Oracle. All rights reserved.Connected to an idle instance.1.nomount階段SQL> startup nomount;
標籤: 21,預存程序,簡化複雜操作,增加資料獨立性,提高安全性,提高效能與函數建立對比:create or replace function fun_01(v_01 in number) return number--必須要求有傳回值 as result number; begin result := power(v_01,2); return result; end; /Function created.select
標籤:Oracle資料庫無自增欄位設定,可以通過function的方式設定欄位自增來作為ID。1、建立表tSequence來儲存各表的next ID。2、建立function類似如下: 1 CREATE OR REPLACE FUNCTION "FUNC_NEXTID" 2 (tablename in varchar2) return number is 3 4 nextid number(12); 5 begin 6 begin 7 select nvl(max(id),-1
標籤:--數字型函數select abs (-100) from dual;--絕對值select mod (10,3) from dual;--求模select ceil (12.5) from dual;--取上限整數select floor (12.5) from dual;--取下限整數select round (12.46327,3) from dual;--四捨五入,逗號後數字表示精度select trunc (12.455,1) from dual;--截取,逗號後數字表示精度--
標籤:原文地址 Shut down the WebLogic domain, the managed servers, Admin Server and Node Manager. Set the following environment variables in the command prompt (cmd) to help you navigate easily, in my case for Windows O/S: set