sqlcode

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

Example of calling a stored procedure in Pb

Sqlca. autocommit = trueDeclare lup_drophiscol procedure for up_drophiscol@ Tablename =: ls_tabname,@ Checkcontent =: ls_err output;Execute lup_drophiscol;If sqlca. sqlcode =-1 thenSqlca. autocommit = falseMessageBox ('error', sqlca. sqlerrtext)ReturnEnd ifFetch lup_drophiscol into: ls_err;Close lup_drophiscol;Sqlca. autocommit = falseIf sqlca. sqlcode =-1 thenMessageBox ('error', sqlca. sqlerrtext)Elseif i

Example of oracle inserting data using a single cursor

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, te. SAL, te. COMM, te. DEPTNO); exception when NO_DATA_FOUND then null; when others then v_ErrorCode: = S

Shell script to GG

==================================================#!/bin/bashsqlplus=sqlplus64username=$1psswd=$2filedir=$3[[$ Filedir] | | Filedir= "/sandbox/edf_api_repo_dir" [[-D $filedir]] | | {echo "mkdir $filedir"; mkdir $filedir; chmod 777 $filedir;} [-D $filedir] | | {echo "Cannot create Oracle directory"; exit 1;} [[$username] | | {echo "Where is user name?"; exit 1;} [[$PSSWD] | | Psswd= $username echo "Create user $username identified by $psswd"; Sqlcode

Retrieve MD5 encrypted password and MD5 encrypted database data

', fun_get_md5 (' zhangwz ', ' 123456 ')); Sql> commit; Remove password when user logs on: Create or Replace procedure P_login (I_uname varchar2 , i_passwd varchar2) is V_ID number; V_error_text VARCHAR2 (200); 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: ' | |

SQL Step-by-Step (24) Embedding SQL

SQLCA variable, which can be used for error checking * * EXEC SQL INCLUDE SQLCA; Main () { /* The following connection database * * EXEC SQL CONNECT Userid/password; /* The following is a connection to the database and check for errors generated t/if (Sqlca.sqlcode) { printf (Printer, "Error Connecting to Database server.\n"); Exit (); } printf ("Connected to Database server.\n"); /* Declare a "Cursor" below. It will be used when the query results are more than one line. EXEC SQL DECLARE itemcu

Problems in the use of Oracle max functions _oracle

When you write a stored procedure, you use the following SQL statement Copy Code code as follows: SELECT MAX (re_date) into v_re_date From t_recording WHERE ID = ' 100010010102 ' Logically, the result of a query based on this condition should be sqlcode=1403, but strangely, the following SQL exception is not captured: Copy Code code as follows: EXCEPTION When No_data_found THEN NULL; When others THEN Err_code: =-2000; E

Oracle stored procedures Detailed (II)

); Begin Select COUNT (*) into vn_ctn from User_all_tables a WHERE a.table_name = Upper (tablename); If vn_ctn > 0 Then --execute Immediate compiles or executes execute immediate ' drop table ', regardless of whether the table is in or out TableName; End If; EXCEPTION when others THEN dbms_output.put_line (SQLCODE | | '::'|| SUBSTR (SQLERRM, 1)); End drop_table; Delete a sequence Create or Replace procedure dro

Retrieve MD5 encrypted password and MD5 encrypted database data __ Database

); dbms_output.put_line (v_string | | '--' || V_n); End; You can also write a function and call 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 (' zhangwz ', ' 123456 ')-------------------------------------------------

JDBC calls stored procedures and functions

How to invoke a stored procedure in 1.JAVA CallableStatement: interfaces for executing SQL stored procedures and functions Simple steps: A. Write your own stored procedures (of course, you'd better pass the test first) B. Written Java invocation classes C. Get the desired output A: Declaring stored procedures: CREATE OR REPLACE PROCEDURE pro_query_dept ( P_deptno in DEPT. Deptno%type, P_dname out DEPT. Dname%type ) As BEGIN SELECT dname into P_dname from DEPT WHERE DEPTNO = P_deptno; Dbms_output

DB2 Programming Skills (vi) _DB2

The DB2 tutorial being looked at is: DB2 programming skills (VI). 2.2 SQL statements as much as possible to write complex SQL By using large, complex SQL statements, you can improve performance by combining multiple, simple statements into large SQL statements. DB2 's SQL Engieer has a stronger ability to optimize complex statements, and basically does not have to be careful about the performance of statements. Oracle, on the contrary, recommends simplifying complex statements, and SQL Engieer o

Sql0973n There is not enough memory available to process the statement in the < heap name > heap

Label:Sql0973n There is not enough memory available in the Explain:All available memory for this heap has been used. The statement cannot be processed.User response:Terminates the application after receiving this message (SQLCODE). Modify "Configure the parameters to increase the heap size.For example, to update the database configuration parameters, issue the following command:DB2 Update DB CFGFor "Using "To view a list of the database configuration

Horse Soldier Big Brother Database Tutorial 2 stage

reverse 1..10 loop; end Loop;end; --The reverse output loop is completed. of which 1.. 10 represents 1 to 10, enhanced for loop.Error Handling: Exception when error 1 then; When others then; Common 2 kinds: too_many_rows no_data_found//Check ManualComplete Example:--Create a errorlog table: create tables errorlog ( id Number primary key, errcode number, errmsg varchar2 (1024x768), Errdate date); create sequence seq_errorlog_id start with 1 increment by 1; declare v_depno dept.depn

PL/SQL Exception error handling

rows in the output is too many ');When Delete_mgr_excep then Dbms_output.put_line (' manager cannot be deleted 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 Progr

The best way to record errors in Oracle stored procedures

When your application has called the stored procedure, and the node has dozens of or hundreds, the wrong is not a very troublesome thing, this time, I suggest to write to the database, below is a demo I do.1. Create an error log record tabledrop table Pub_proc_err_log Purge;CREATE TABLE Pub_proc_err_log(LOG_ID number,Module_name VARCHAR2 (100),Proc_name VARCHAR2 (100),Err_time DATE,Sql_code VARCHAR2 (50),SQL_ERRM VARCHAR2 (100),Err_content VARCHAR2 (500));Comment on column pub_proc_err_log. LOG_

Oracle.PL.SQL. Programming note DAY01

_editor =/usr/local/bin/vimREM Format misc Columns commonly retrieved from data dictionaryCOLUMN segment_name FORMAT A30 word_wrapCOLUMN object_name FORMAT A30 word_wrapREM Set the prompt (works in Sql*plus from Oracle9i Database or Later0SET sqlprompt "_user" @ ' _connect_identifier > 'Error handling in 2.3.7 Sql*plus when you run a script, you want to stop running when you encounter an error. Use the following command to achieve the purpose. Sql>whenever SQLERROR EXIT SQL.

Oracle exception-handling content, implicit cursors

Exception handlingCreate or Replace procedurePr_test3 (V_BHinch varchar2, v_xx out T_hq_ryxx%RowType isbegin Select * intoV_xx fromT_hq_ryxxwhereBianh=V_bh;ifSql%Found ThenDbms_output.put_line ('find the data.');ElseDbms_output.put_line ('No data found');End if; exception whenNo_data_found Then --dbms_output.put_line (' No data found ');Dbms_output.put_line ('SQLCODE =' ||SQLCODE);--Error codeDbms_output

Oracle exception handling, dynamic cursors

, Visittime, CountType)Values(Seq_cn_visitcountid.nextval,v_cityname, V_visitcount, V_visittime, V_counttype); EndLoop; --back up the daily phone number Delete fromCn_visitmobilewhereVisittime=t_date; Insert intoCn_visitmobileSelectSeq_cn_visitmobileid.nextval,mobile,cityid,visittime from ( SelectMobile,cityid,to_number (To_char (Visittime,'YYYYMMDD')) Visittime fromcn_visitanalysiswhereTo_number (To_char (Visittime,'YYYYMMDD'))=t_date and(Cityid= the orCityid= About) Group byCity

PL/SQL Exception handlers

');When Delete_mgr_excep then Dbms_output.put_line (' manager cannot be deleted 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 ... Qu

MySQL inserts the data queried in Table a into Table B.

MySQL inserts the data queried in Table a into Table B if Table B has 1codeclasssqlcodeclasssqlcodeclasssqlinsertintobselect * froma; codecodecode if Table B does not have 1 partition MySQL inserts the data queried in Table a into Table B. If table B has 1 code class = sqlcode class = sqlinsert into B select * from; /code if Table B does not exist 1 code class = sqlcode class = sqlc MySQL inserts the dat

Common RMAN problems in 11GR2

; select count (*) into: dbstate from v $ parameter where lower (name) = '_ dummy_instance' and upper (value) = 'true'DBGSQL: sqlcode = 1008RMAN-00571: ========================================================== ========================RMAN-00569: ============== error message stack follows ======================RMAN-00571: ========================================================== ========================ORA-01008: not all variables boundOrRMAN-00571:

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