sqlcode

Want to know sqlcode? we have a huge selection of sqlcode information on alibabacloud.com

Oracle uses a single cursor to insert data. For example, oracle cursor

describes how to use cursor to query a single data record and insert a single data record. Create or replace procedure PD_CESHI IS v_ErrorCode NUMBER; -- error code v_ErrorText VARCHAR2 (4000); -- error message cursor c1 isSELECT. EMPNO,. ENAME,. JOB,. MGR,. HIREDATE,. SAL,. COMM,. deptno from emp a, EMP_2 B where. empno = B. empno; BEGIN For te in c1 loop begin insert into EMP_3 (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values (te. EMPNO, te. ENAME, te. JOB, te. MGR, te. HIREDATE,

Oracle Stored Procedure record exception, Oracle Stored Procedure record

Oracle Stored Procedure record exception, Oracle Stored Procedure record For Oracle stored procedures, an exception can be thrown to the code or recorded in a table. If your system application has many nodes, such as our 40 nodes, if an error is thrown into the code, the error cannot be found at all. It is best to use a table to record the error. This function should be common. -- Create an error log table Create table PUB_PROC_ERR_LOG(LOG_ID NUMBER,MODULE_NAME VARCHAR2 (100 ),PROC_NAME VARCHAR2

Oracle PL/SQL Composite data types

: = c_row.name;Dbms_output.put_line ('record: '| var_record.id |' --- '| var_record.name );Dbms_output.put_line ('cursor: '| c_row.id |' --- '| c_row.name );End loop;Exception when others thenDbms_output.put_line (sqlcode | sqlerrm );End;/ Output result:1st cyclesRecord: 1 --- aaaCursor: 1 --- aaa2nd cyclesRecord: 2 --- bbbCursor: 2 --- bbb3rd cyclesRecord: 3 --- cccCursor: 3 --- ccc4th cyclesRecord: 4 --- dddCursor: 4 --- ddd5th cyclesRecord: 5 --- e

Repeat tabulation records in sqlserver and copy the report

message", "Are you sure you want to copy '" + ls_old_accept_no + "' this report? ", Question !, Yesno !, 1) Declare emp_proc procedure for DBO. copy_reports@ Old_accept_no =: ls_old_accept_no,@ New_accept_no =: ls_new_accept_no outputUsing sqlca;Execute emp_proc;Fetch emp_proc into: ls_new_accept_no;Close emp_proc; If sqlca. sqlcode = 100 or sqlca. sqlcode = 0 thenCommit using sqlca;MessageBox ("Copy repo

Oracle Array type Simple example introduction

Cur_test%rowtype;BeginFor row_test in Cur_test (' 333 ') loopT_record1.id: = row_test.id;T_RECORD1.MC: = ROW_TEST.MC;T_record2.id: = row_test.id;T_RECORD2.MC: = row_test.id;Dbms_output.put_line (' t_record1: ' | | t_record1.id| | ' ---'|| T_RECORD1.MC);Dbms_output.put_line (' T_record2: ' | | t_record2.id| | ' ---'|| T_RECORD2.MC);Dbms_output.put_line (' row_test: ' | | row_test.id| | ' ---'|| ROW_TEST.MC);Dbms_output.put_line (' ================loop ' | | Cur_test%rowcount| | "times.");End Loo

Oracle Exception Rollup ____oracle

... * * V_sqlcode: = Sqlcode; V_SQLERRM: = SQLERRM; Dbms_output.put_line (' This unusual code: ' | | v_sqlcode | | | chr (10) | | ' This unusual message: ' | | V_SQLERRM); Exception when others then rollback; V_sqlcode: = Sqlcode; V_SQLERRM: = SQLERRM; Dbms_output.put_line (' This unusual code: ' | | v_sqlcode | | | chr (10) | | ' This unusual message: ' | | V_SQLERRM)

Exception Handling for Oracle series

tb_employee.pk_employee_id%type; V_ename tb_employee.ename%type; Emp_id_minval tb_employee.pk_employee_id%type; Emp_id_maxval tb_employee.pk_employee_id%type;beginEmp_id_minval:=emp_id_minval; Emp_id_maxval:=Emp_id_maxval; foremp_idinchEmp_id_minval. Emp_id_maxval Loopbegin SelectEname intoV_ename fromTb_employeewherepk_employee_id=emp_id; Dbms_output.put_line ('ename:'||v_ename); Exception whenNo_data_found ThenDbms_output.put_line ('Not exists such empolyee'); End; EndLoop;End; /Write a sampl

A SQL script that generates large amounts of data in batches

= 111100009020000000030 ';LoopFetch Cur_productInto V_servicetype, V_serviceindex, V_serviceid, V_productindex, V_productid, V_status, V_cpid, V_cpindex;Sp_get_next_seq (' Slp_order_prdindex ', v_subscriptionindex);Exit when Cur_product%notfound;INSERT INTO Zxdbm_500.s500_user_subscription(Subscriptionindex,SubscriptionId,ServiceType,Serviceindex,Serviceid,Productindex,ProductIDCorpindex,Corpid,Subscriber,Usercode,Payuser,StatusMsisdntype,Cpid,Cpindex)Values(V_subscriptionindex,v_newcode| | V_s

Database FAQs (i)

Tags: update definition sql pos COM open err Drive exceProblem: Error bgjob_2]com.kingdee.bos.dao.ormapping.sqlaccessexception:update data error. The Error for batch element #1: The value of a host variable in the EXECUTE or OPEN statement are out of range for its CORRESPO Nding use: sqlcode=-302, sqlstate=22001, driver=3.68.61caused exception message Is:datalimitcaused exception message is:error for batch element #1: The value of a host variable in t

Oracle Sql-remove A user ' s all objects

DECLARETYPE cst_table_list is Table of VARCHAR2 (40); TYPE Cst_list is TABLE of VARCHAR2 (40);TYPE Name_list is TABLE of VARCHAR2 (40); TYPE Type_list is TABLE of VARCHAR2 (20);Cst_tab_name cst_table_list:=cst_table_list (); Cst_name cst_list:=cst_list ();Tab_name name_list:=name_list (); Tab_type type_list:=type_list ();Sql_str VARCHAR2 (500);V_err_code number; V_err_msg VARCHAR2 (200);Begin-Drop all reference constraints begin SQL_STR: = ' Select Table_name,constraint_name from user_constraint

"Go" oralce PL/SQL stack information tracking

Tags: database focus compiler support Val User obj cat OtherSummarized as follows: dbms_utility. Format_call_stack -This was introduced in Oracle7, dbms_utility. Format_call_stack this built-in function returns a formatted string that shows the execution call stack: The sequence of calls to all procedures or functions at the call point of this function. In other words, the function answers the question: "How did I get here?" ” dbms_utility. Format_error_stack -This was introduced in Oracle7, dbm

Retrieve MD5 encrypted password and MD5 data in encrypted database

into Sys_user values (1001, ' Zhangwz ', fun_get_md5 (' zhangwz ', ' 123456 ')); Sql> commit; Remove password when user logs in: Create or Replace procedure P_login (i_uname varchar2 , i_passwd varchar2) is v_id number; V_error_text varchar2 ($); Begin Select ID into v_id from sys_user where username = i_uname and password = FUN_GET_MD5 (i_uname , i_passwd); Exception when others then v_error_text: = ' username or password is incorrect! ' | | ', Sqlcode

Oracle exception Handling and functions

-defined exception handlingFor the processing of pre-defined exception cases, simply reference the corresponding exception case name directly in the exception handling section of the PL/SQL block and complete the corresponding exception error handling.Example: DECLAREV_empno Emp.empno%type:=empno;V_sal Emp.sal%type;BEGINSELECT sal into v_sal from emp WHERE empno=v_empno;IF v_salUPDATE emp SET sal=sal+100 WHERE empno=v_empno;Dbms_output. Put_Line (' encoded as ' | | v_empno| | ' Employee pay has

Exceptions in database (pre-defined, non-predefined, user-defined)

exception -- raise trigger END IF; EXCEPTION when No_result then-- When an exception is triggered dbms_output. Put_Line (' Your data UPDATE statement failed! '); When OTHERS Then-- can be understood as exception packets, which receive exception dbms_output beyond the definition exception . Put_Line (SQLCODE| | ' ---' | |SQLERRM); END; -----------------------------------------------------------------------------------------------

PL/SQL exception handling for Oracle database

on the Error_code is added to the top of the stack. Specifies false,pl/sql to replace the Error_code error stack with the default value of FALSE. Example 1: DECLAREempno employees.employee_id%TYPE; No_such_row EXCEPTION; BEGINempno:= empno; UPDATEEmployeesSETSalary=Salary+ - WHEREId=empno; IFSql%NOTFOUND ThenRAISE No_such_row; END IF; EXCEPTION whenNo_such_row ThenRaise_application_error (-20001,'no rows to modify'); END; Example 2: BEGIN UPDATEEmpSETDeptno= the WHEREEmpno=1111; IFSql%NOTFOU

PL/SQL Exception error handling

directly ');--Handling exceptionsWhen Too_high_sal and then Dbms_output.put_line (' pay too much ');End⑥ using sqlcode in PL/SQL, SQLERRMSQLCODE return error code numberSQLERRM returns an error message.EXCEPTIONWhen OTHERS ThenDbms_output. Put_Line (sqlcode| | ' ---' | | SQLERRM);⑦ Exception Program:1. By select ... into ... Query a person's salary, if not, output "no data found"Declare--Define a variableV

Oracle PL/SQL composite data type

: = c_row.id; Var_record.name: = C_row.name; Dbms_output.put_line (' record: ' | | var_record.id| | ' ---' | | Var_record.name); Dbms_output.put_line (' cursor: ' | | c_row.id| | ' ---' | | C_row.name); end Loop; exception When others then Dbms_output.put_line (sqlcode| | SQLERRM); End; / Output Result:1th CycleEntries: 1---AAACursors: 1---AAA2nd cycleEntries: 2---BBBCursors: 2---BBB3rd CycleEntries: 3---CCCCursors: 3---CCC4th cycl

Unix shell_oracle ERP and other systems interface data transfer via Shell control (case) (schema)

,v_file_name,0,0,0, ' n ', $ORA _request_id, $ORA _user_id, ' $ORA _login_ NAME ', sysdate);">> $SQL _path/Bxjinterface.sql - Echo "End If;">> $SQL _path/Bxjinterface.sqlWuyi Echo "commit;">> $SQL _path/Bxjinterface.sql the Echo "dbms_output.put_line (' excuted sucessfully. ');">> $SQL _path/Bxjinterface.sql - Echo "exception when others then">> $SQL _path/Bxjinterface.sql Wu Echo "rollback;">> $SQL _path/Bxjinterface.sql - Echo "dbms_output.put_line (' Executed Failed ');">> $SQL _path/Bxjinter

PL/SQL Exception handling method

variables: SQLCODE error code Sqler Rm Error content When an exception is thrown, the two variables are automatically populated, and you can get both values to determine the error: 3: User-defined exception: First look at three examples to explain: Ex1: [sql] sql> declare 2 V_DEPTNO number: = 500; 3 v_name varchar2 (:= ' testing '); 4 e_invalid_department EXCEPTION; 5 begin 6 UPDATE departments SET department_na

Oracle streams How to create a tables-level replication environment

------------------------------ ------------------------------ ------------------------------ SYS mydt_source/data/oradata/jssweb/dmp The above query determines that the script is located in the operating system:/data/oradata/jssweb/dmp directory, directly to the directory to view the generated script file, execute: [Oracle@yans1 ~]$ More/data/oradata/jssweb/dmp/configure_rep.sql The script is longer, not all posted here, you can browse in detail in your test environment, if you need to mod

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.