Oracle Commit用法
第一个bug fix 用到 Oracle的Update语句
update Table1 set Web=-1 where ProgID=N‘123’
CodeReview 时
Do we need a COMMIT; in the Oracle version?
上网查了一下Oracle COMMIT用法
COMMIT
Purpose
Use the COMMIT statement to end your current transaction and make permanent all changes performed in the transaction. A transaction is a sequence of SQL statements that Oracle Database treats as a single unit. This statement also erases all savepoints in the transaction and releases transaction locks.
Until you commit a transaction:
You can see any changes you have made during the transaction by querying the modified tables, but other users cannot see the changes. After you commit the transaction, the changes are visible to other users' statements that execute after the commit.
You can roll back (undo) any changes made during the transaction with the ROLLBACK statement (see ROLLBACK.
Oracle Database issues an implicit COMMIT before and after any data definition language (DDL) statement.
You can also use this statement to
Commit an in-doubt distributed transaction manually
Terminate a read-only transaction begun by a SET TRANSACTION statement
Oracle recommends that you explicitly end every transaction in your application programs with a COMMIT or ROLLBACK statement, including the last transaction, before disconnecting from Oracle Database. If you do not explicitly commit the transaction and the program terminates abnormally, then the last uncommitted transaction is automatically rolled back.
A normal exit from most Oracle utilities and tools causes the current transaction to be committed. A normal exit from an Oracle precompiler program does not commit the transaction and relies on Oracle Database to roll back the current transaction.
相关文档:
select bid from t_branch c start with c.upbid ='11000000' connect by prior c.bid=c.upbid
说明:
1、统计某个机构下所有的子孙机构。如统计北京机构下的子孙机构,包括:朝阳区机构、海淀营销机构、、、青龙桥乡机构、、、、一直到最底层的机构。
2、upbid是指上级机构的ID。海淀区机构ID(bid)的上级机 ......
最近,ORACLE系统基本调试通过,是时候设置ORACLE随RHEL自动启动与关闭服务的时候了,之所以把这个任务放在最后来做,是因为我觉得这个应该不会很难,但真正实施起来,还是遇到了个不小的障碍
写好脚本,注册好服务之后,经测试,ORACLE可以随RHEL启动而启动,但不能随系统关闭而关闭。在网上找答案,发现几乎所有的设置过 ......
在Oracle中,如果在sql中出现'&'符号,会被自动转义;
而被要求输入在&符号后跟随的字符串的值,例如:
update tablename set columnName='http://www.g.cn/cv2.jsp?spid=222&cid=333';
执行这个操作时,Oracle会提示
Enter value for cid:
原因是在Oracle中 & 符号是作为转义字符使用的。
解决方法 ......
1、使用oracle用户登录,连接数据库
[oracle@wuzj ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Feb 26 12:06:29 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
//查看用户
SQL> select username,password from dba_users;
......
一、 常用日期数据格式
1.Y或YY或YYY 年的最后一位,两位或三位
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_char(sysdate,'YYY') from ......