Create or replace procedure t_ps_trycalculate (v_date in varchar2)
As
/*
The monthly performance check determines whether the employee's performance is successful based on parameters.
Parameter: v_date performance year/month
*/
-- Define error Variables
Some_kinds_of_err exception; -- Exception to indicate an error condition
V_errorcode number; -- variable to hold the error message code
V_errortext varchar2 (2000); -- variable to hold the error message text
V_error_ SQL varchar2 (4000); -- SQL s
. servername = "CWD"Sqlca. logid = "sa"Sqlca. autocommit = falseSqlca. dbparm = ""// The following is generally not usedSqlca. userid = ""Sqlca. dbpass = ""Sqlca. Lock = ""Connect using sqlca;
Sqlca. sqlcode = 0 // database connection successful-1 // database connection Error100 // The connection is successful, but no data is retrieved (usually used in DW)
◆ Close ()This event is triggered when the user closes the application. This event has no parame
the table, other programs can also obtain the IX lock of the table for data modification. However, after the lock is upgraded, the program will upgrade the table to the S lock, other programs cannot modify the table. Will be in the lockwaiting status.The lock upgrade may fail. It is easy to understand. Next, the above lock is originally is, And the IX lock is not released yet. The lock is upgraded to the S lock, but s and IX are not compatible, in this case, the lock upgrade fails. The applicat
---- Start
Stored Procedures can call each other. How can we transmit data between them? There are three methods.
I. Data Transmission Through Input and Output Parameters
This is the simplest method, but it is worth noting that the return statement in the stored procedure has different meanings than the return statement in other programming languages. The Return Statement in the stored procedure puts back the sqlcode value.
Ii. pass data through sessi
and Oracle need to specify this parameter.
7
Logpass
String
The user password used to log on to the database server. This attribute can be set but cannot be set, but Sybase and Oracle need to specify a password.
8
Servername
String
Database Server name.
9
Autocommit
Boolean
Specifies whether to set the database to automatically submit all transactions. The default value is false. That is to say, you must manage transactions in the applicatio
of the messages? You can do that with the following two commands in a pre-extract stored procedure.Set message = offset emgsrv = OFFBut a warning: some error messages are also disabled, so if there are problems with the flow, you may need to remove these settings to diagnose them.
Rejected row messages. when the "key matching logic" option "include duplicates" is used with a relational database target, duplicate rows still can't be inserted into a table if there is a unique constraint. instead
Procedure feathures:Parameter modes:3 types of parameters: 1) in: Incoming data to Stored Procedure 2) Out: stored procedure returns data 3) inout: the part of the incoming data, overwritten by returned data during execution
Result sets:Stored Procedure uses cursor to pass the result set to the caller. The stored procedure must retain a cursor for each result set to be returned.> Use with return to caller/client to specify the objects returned by the result set. If this parameter is set to clie
are created in SQL.PB cannot dynamically create SQL triggers with variables?
Messagebox ("", ls_mysql)// After the prompt box is displayed, press ctrl + c to copy the prompt box content, and then press ctrl + v to query the analyzer to see if there is any problem.Sqlto. autocommit = trueExecute Immediate: ls_ SQL; If sqlto. sqlcode = 0 ThenMessagebox ("", "successful! ")ElseMessagebox ("", "failed! "+ Sqlto. sqlerrtext)End IfSqlto. autocommit = false
user to execute "db2stop"
2) modify the server host name (for details about how to modify the host name in various operating systems, refer to the relevant operating system documentation)
3) Run
db2set-gDB2SYSTEM=db2terminate
The above command should not cause any problems on Windows. However, if your operating system is Linux or UNIX, errors may occur at this time, for example, V8 or V9.1,
You will encounter the following error message:
$db2set–gDB2SYSTEM=pirates
DB2SETprocessin
rollback is expected to be completed within 5.04 hours.
Note: in other environments, replace KTUXEUSN with KTUXESLT = 5.
SQL statements for Oracle-defined transactions
SQL> select * from test_main; ID VALUE------------------------------2 TWO3 THREE1 ONESQL> BEGIN2 -- insert two identical data records to repeat the primary key and roll back the transaction after an error is thrown.3 insert into test_main (id, value) VALUES (4, 'four ');4 insert into test_main (id, value) VALUES (4, 'four ');5 CO
Connection character: |Value assignment: ": ="For example, l_name: = 'sky ';Determine whether the values are equal: "="For example, if 1 = 1 then...Variable binding :":"For example, if: P_NAME = 'sky' then...
ExistsNot exists does not exist
% Type matching Field type% Rowtype matching record type% Type when the table type changes, you do not need to manually modify the type called in PL/SQL blocks.Example: V_GP_ID SC _BALANCE_DAILY.Gp_Id % TYPE;
Sqlcode
:
System_variable
All
BTI [TLE]
Err [ors] [{function | procedure | package body |
Trigger | View | type body} [schema.] Name]
Lno
Parameters [parameter_name]
PNO
Rel [statement]
Repf [Ooter]
Reph [eader]
SGA
Spoo [l]
Sqlcode
TTI [TLE]
User
1). display the value of the current environment variable:
Show all
2). displays the error information of the currently created function, stored procedure, trigger, package, and other objects.
Show ERROR
When an err
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.