1.invalid number:本身是字串格式還要轉換成字串格式 2.a non-numeric charactor was found where a numeric was expected :本身是日期格式還轉成日期格式 3.column ambiguously defind:欄位含糊不清,幾個表中都有,得指定是哪個表的欄位 4.Character to numeric conversion error本來是三位元,要轉換成兩位元,比如273.4轉換to_char(273.4,'99.9
Oracle方面 1.建立Oracle過程儲存 create or replace procedure proce_test(paramin in varchar2,paramout out varchar2,paraminout in out varchar2) as varparam varchar2(28); begin varparam:=paramin; paramout:=varparam|| paraminout;
oracle的預存程序返回記錄集,找到兩個ORACLE段都一樣,只是C#部份有點區別,都放上來,個人偏向使用用第一個。 C#調用ORACLE預存程序返回結果集及函數 ORACLE段: 首先在ORACLE建立PACKAGE和PACKAGE BODY,將在這裡面定義函數和預存程序返回結果集。 1:建立PACKAGE: CREATE OR REPLACE package SCOTT.pk_wt is type mytype is ref cursor; procedure p_wt(mycs out
一、在PLSQL中建立表:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->create table HWQY.TEST(CARNO VARCHAR2(30),CARINFOID NUMBER) 二、在PLSQL中建立預存程序:Code highlighting produced by Actipro CodeHighlighter
隱式遊標beginupdate try set 成績=60 where 課程編號='C008' and 成績<60;if SQL%notfound then dbms_output.put_line('There is no score below 60!');end if;end;/-- 遊標變數的使用declaretype cursor_type is ref cursor;stu_cursor cursor_type;v_stu 學生基本資料%rowtype;notfound
一、建立一個預存程序create or replace procedure MY_Procedureis --這裡用到了遊標 cursor cur is select * from users where length(name) > 10 ;begin for user in cur loop insert into users_temp values(user
格式:(非package裡)create or replace function function_name ( argu1 [mode1] datatype1, argu2 [mode2] datatype2, ........ ) return datatype is Result varchar2(50); begin return Result ; end; 調用: var v1 varchar2(100) exec
在Oracle中,只有DML才會開啟一個事務。也就是說Insert,Update,Delete這些都會開啟一個事務,並且該事務在commit/rollback/ddl命令時會自動結束。1.擷取特定資料的前幾位select substr(recordid,1,2) from syscode where rownum < 5;2.擷取指定條數的資料select recordid from syscode where rownum < 5;3.擷取指定格式的ID
create or replace view ov_applicant of ob_applicant with object oid (applicantid) as select * from applicant;--ov_applicant完全等同applicant insert into ov_applicant values