sqlcode

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

PL/SQL Exception Handling Method

BEGIN 5 insert into orders ments (department_id, department_name) VALUES (280, n ull ); 6 EXCEPTION 7 WHEN e_insert_excep THEN 8 DBMS_OUTPUT.PUT_LINE ('insert OPERATION failed'); 9 DBMS_OUTPUT.PUT_LINE (SQLERRM); 10 END; 11/insert operation failed ORA-01400: NULL cannot be inserted ("HR ". "DEPA RTMENTS "." DEPARTMENT_NAME ") the PL/SQL process has been completed successfully. Define an e_insert_excep Exception name, call the EXCEPTION_INIT function to bind the Exception name, and output an err

Retrieve the MD5 encrypted password and data in the MD5 encrypted database

(sys.dbms_obfuscation_toolkit.md5(input_string => '123456'));v_n := length(v_string);dbms_output.put_line(v_string || '--' || v_n);end; You can also write a function and call it to implement MD5 encryption: create or replace function fun_get_md5(i_username in varchar2, i_password in varchar2)return varchar2 isbeginreturn utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5(input_string => (i_username||i_password)));end fun_get_md5;sql> select fun_get_md5('zhangwz','123456') from dual;fun_get_md5('zh

Problems with Oracle Max function usage

When writing another stored procedure, the following SQL statement is used:Copy codeThe Code is as follows:Select max (RE_DATE) INTO V_RE_DATEFROM T_RECORDINGWhere id = '000000' It is reasonable to say that the query result based on this condition should be sqlcode = 1403, But the strange thing is that the following SQL exception is not captured:Copy codeThe Code is as follows:EXCEPTIONWHEN NO_DATA_FOUND THENNULL;WHEN OTHERS THENERR_CODE: =-2000;ERR_M

List common DB2 errors and solutions for cracking

and the memory is insufficient, it is useless to increase the dbheap. SQL2009C. There is not enough memory to run this utility. Cause: DB2 UTIL_HEAP_SZ is not set high enough for backup utilities. Solution: db2 update db cfg for dbname using UTIL_HEAP_SZ the memory used for the specific digital db2 backup is UTIL_HEAP_SZ. Use the preceding command to adjust the memory ). DB2 common error 7. When using JDBC to insert data into tables in batches. Error 23502 is reported. For example: Error for ba

Stored Procedure & Function

leave to exit the current stored procedures. return cannot be used.MySQL method can exit the current method using return. 6 Exception Handling in stored procedures is different ExceptionWhen others thenRollback;Ov_rtn_msg: = c_sp_name | '(' | li_debug_pos | '):' |To_char (sqlcode) | ':' | substr (sqlerrm, 1,100 ); Declare exit handler for sqlexceptionBeginRollback;Set ov_rtn_msg = Concat (c_sp_name, '(', li_debug_pos ,'):',To_char (

Several ways to implement Concurrency Control in database applications

select-statement for update [of column-list]. Update cursors implicitly lock the current record when browsing and modifying data. Note that update cursors are only valid for updatable views. To improve the concurrency, you often need to use the scroll cursor together. The definition method of the scroll cursor is declare cursorname scroll cursor [with hold] For selectstatement. However, the scroll cursor does not lock the current record.The following code completes the customer's browsing and m

Use dynamic SQL statements (Using dynamic SQL), SQLSA, and SQLDA

User-Defined cursor.2. Application InstanceRead and process all the records with the code field "01" in the base table.STRING lsSQL, lsCode, lsName, lsFilterLsFilter = "01"LsSQL = "SELECT code, name FROM base WHERE substring (code, 3, 2) = ?"DECLARE cursor_base dynamic cursor for sqlsa;Prepare sqlsa from: lsSQL;Open dynamic cursor_base USING: lsFilter;FETCH cursor_base INTO: lsCode,: lsName;Do while sqlca. SQLCODE = 0.Records that meet the conditions

[PB] PB programming

BSCMC, XQH, and xqmc) D) Save It To The xls file Dw_rep.saveas ('', Excel5 !, True) E) read/write: Write w_netrep_cell.dw_rep.object.tchpzzs [I] = Read a = w_netrep_cell.dw_rep.object.tchpzzs [I] 2. Establish a connection with the database 1) Definition Transaction localdb 2) settings Mytrans. DBMS = "" Mytrans. Database = "SDA" Mytrans. logpass = "def" Mytrans. servername = "DBO" Mytrans. logid = "ABC" Mytrans. dbparm = "" Mytrans. Lock = "" Mytrans. userid = "ABC" Mytrans. autocommit = tr

Development: Issues related to table creation in DB2 due to abnormal collection

: SQLCODE =-104, SQLSTATE = 42601, SQLERRMC = INTEGER; R (50 ), Because I couldn't find the desired answer on the internet, I directly looked at the problem and found that the prompt SQLERRMC = INTEGER; R (50) is removed from the INTEGER length, and I changed INTEGER (32) to INTEGER. Problem Solving Second exception: DB2 SQL Error: SQLCODE =-542, SQLSTATE = 42831, SQLERRMC = SERIAL_NO, DRIVER = 4.15.82 Th

Comparison of concurrency control (LOCK) between DB2 and Oracle

.• Although the lock upgrade will reduce the concurrent performance of the OLTP application, the lock upgrade will release the lock to occupy the memory and increase the memory space of the available lock.Lock upgrades may fail. For example, an application now has an IX lock on a table, and some rows in the table have an X lock, another application requests the IS lock on the table and the S lock on many rows, which causes the lock upgrade due to the number of applied locks. The database manager

How to quickly locate lock wait statements in DB2

In daily DB2 O M, we often encounter slow execution of Several SQL statements, but the cpu and memory usage of the database server is not high, similar problems are basically caused by locks, sorting, and other reasons. Next we will analyze how to quickly locate the lock wait problem from an instance and lock the table. I. Lock information in logs When you find a large amount of sqlcode reports 911 information in the database LOG DB2DIAG. LOG, there

PL/SQL Exception error handling and plsql error handling

exceptions in PL/SQL blocks. [User-defined exception]Declare V_sal employees. salary % type;-- Declare an exceptionDelete_mgr_excep exception;-- Associate custom exceptions with oracle errorsPRAGMA EXCEPTION_INIT (delete_mgr_excep,-2292 );-- Declare an exceptionToo_high_sal exception;Begin Select salary into v_salFrom employeesWhere employee_id = 100;If v_sal> 1000 thenRaise too_high_sal;End if;Delete from employeesWhere employee_id = 100; Dbms_output.put_line (v_sal ); ExceptionWhen Too_many_r

DB2 error code note

Profit Return shopping http://www.bbuy8.com Shopping rebates are justified, but the rebates are not high. (1)SQL State: 42831 [Error Code:-542, SQL State: 42831] DB2 SQL Error: SQLCODE =-542, SQLSTATE = 42831, SQLERRMC = BATCH_NO, DRIVER = 3.57.82 Column: Create table T_USER_IMPORT_BATCH (BATCH_NO char (15) not null primary key,STATUS Char (1) not null,CREATE_TIME char (14) not null,CREATER varchar (30) not null,AUDIT_TIME char (14 ),AUDITER Varchar

Exception definition, throw, and handling

of the exception handling unit.▲Exception handling handle: each independent when... then... is a handle.An exception handling unit can have multiple handling handles, for example:Exception/* Handle 1 */When no_data_foundThen.../* Handle 2 */When payment_overdueThen.../* Handle 3 */When othersThen...End;The when statement can only capture exceptions based on the Exception name, but cannot catch exceptions based on the error number.The when others statement is optional and must be the last proces

The simplest Pro * C program in history

# Include # Include # Include Exec SQL include sqlca; Exec Oracle option (release_cursor = yes ); Exec SQL begin declare section; Varchar username [20]; Varchar password [20]; Exec SQL end declare section; Void SQL _error (){Exec SQL whenever sqlerror continue;Printf ("/n Oracle error detected:/N ");Printf ("/n %. 70 s/n", sqlca. sqlerrm. sqlerrmc );Exec SQL rollback release;Exit (1 );} Main (){Strcpy (username. Arr, "gdnum_true ");Strcpy (password. Arr, "gdnumtrue_10 ");Username. Len = strlen

A suspected bug in powershield

In the analysis of powershield protectedCodeThe following error occurs at a very low probability: Get bool_true // note the following: Get bool_false If logic_flase then jump to the correct address // match the second bool_false, the jump is correct. If logic_flase then jump to the correct address // actually cannot be executed here In addition, multiple rows of sqlca. sqlcode Get bool_true // note the following: Get bool_false If

Problems with Oracle Max function usage

When writing another stored procedure, the following SQL statement is used: Copy codeThe Code is as follows: select max (RE_DATE) INTO V_RE_DATE FROM T_RECORDING Where id = '000000' It is reasonable to say that the query result based on this condition should be sqlcode = 1403, But the strange thing is that the following SQL exception is not captured:Copy codeThe Code is as follows: EXCEPTIONWHEN NO_DATA_FOUND THENNULL;WHEN OTHERS THENERR_CODE: =-2

PL/SQL Exception error handling

explicitly using the RAISE statement. When an EXCEPTION error is thrown, the control switches to the EXCEPTION part of the EXCEPTION block and runs the error handling code.To handle such exceptions, follow these steps:1. Define exceptions in the definition section of PL/SQL blocks: 2. RAISE 3. handle exceptions in PL/SQL blocks. [User-defined exception]Declare V_sal employees. salary % type;-- Declare an exceptionDelete_mgr_excep exception;-- Associate custom exceptions with oracle errorsPRAGM

Common Oracle System packages and common methods

directory source to ods_es; Grant read, write on directory target to ods_es; DECLARE v_getfile UTL_FILE.FILE_TYPE; V_sou_dir VARCHAR2 (40): = 'source '; V_sou_file VARCHAR2 (30): = 'source.csv '; V_tar_dir VARCHAR2 (40): = 'source '; V_tar_file VARCHAR2 (30): = 'target.csv '; V_eachline VARCHAR2 (400 ); V_count INTEGER: = 0; BEGIN UTL_FILE.FCOPY (v_sou_dir, v_sou_file, v_tar_dir, v_tar_file ); V_getfile: = UTL_FILE.FOPEN (v_tar_dir, v_tar_file, 'w '); DBMS_OUTPUT.PUT_LINE ('Copy file content

"Insufficient permissions" issue in call to execute immediate in stored procedures

When creating a table dynamically using Plsql, the user needs to have the Create any table permissionFor example:Create or replace procedure Create_table_test istmpstr varchar2 ( -); V_cursor number;j Number;begin forIinch Ten.. -Loop begin TMPSTR:='CREATE TABLE Dpc_test'|| I | |'As select * from Dpc_test WHERE 1=2'; Dbms_output.put_line (TMPSTR); --v_cursor: =Dbms_sql.open_cursor; --Dbms_sql.parse (v_cursor,tmpstr,dbms_sql.native); --j:=Dbms_sql.execute (v_cursor); Execute immediate tmpstr; E

Total Pages: 15 1 .... 8 9 10 11 12 .... 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.