ERP基础档案管理模块中实现多级分类档案ID号自动编码技术(V1.0)
本存储过程实现了多级分类档案ID号自动编码技术,本版本(V1.0)现在只实现每级3位的编码,
本版本的特点是:
n 可以根据不同的数据库表产生不同的编码,达到通用化
n 调用时通过指定iIsSubNode要产生的节点编码是否是子结点还是兄弟节点来生成对应编码
进行调用本存储过程时需要注意的是需要传递节点的层次(或是叫节点的深度)
另外下一个版本(V2.0)将根据用户自定义每级长度来实现更灵活的自动编码技术。
CREATE procedure prcIDAutoGen
@vSourceID varchar(30),
@iDepth int,
@iIsSubNode int,
@Table varchar(20),
@vIncrement varchar(30) output
as
begin
declare @iLen int
declare @vTempID varchar(30)
declare @SQLString nvarchar(500)
if @iIsSubNode =1
begin
set @iDepth=@iDepth+1
set @iLen=@iDepth*3
set @SQLString=N'selec..
[阅读全文] [返回页首]
Apache上部署Pro*c常见的一个错误
在Apache上部署Pro*c,经常会出现服务器500错误.最近测试Linux上的Oracle iAS,遇到问题不少,在这里把解决500错误的过程和大家大致描述一下,希望对大家能有所帮助.
操作系统:RedHat AdvanceServer 2.1数据库: Oracle 8.1.7.4Apache: 1.3.12
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++情况1:假设我们请求的连接如下:http://192.168.0.116:7777/cgi-bin/test
浏览器得到的错误信息如下:
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, Fenng@ITPub.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
+++++++++..
[阅读全文] [返回页首]
link:
http://www.eygle.com/ha/dataguard-step-by-step.htm
1.主节点备份并生成备用数据库控制文件
设置主节点为force Logging模式(为了双向切换,建议备用节点也设置为force logging模式)ALTER DATABASE FORCE LOGGING;
设置主节点为归档模式
登陆主节点,进行数据库备份,并生成备用数据库控制文件
Last login: Mon Aug 9 16:46:47 2004 from 172.16.32.65
[root@standby root]# su - oracle
[oracle@standby oracle]$ sqlplus ''/ as sysdba''
SQL*Plus: Release 9.2.0.4.0 - Production on Mon Aug 16 10:16:18 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 135337420 bytes
Fixed Size 452044 bytes
Variable Size 109051904 bytes
Dat..
[阅读全文] [返回页首]
ERP基础档案管理模块中实现多级分类档案级联删除技术
本存储过程实现了多级分类档案级联删除技术
本存储过程的特点是:
n 可以在不同的数据库表上应用此存储过程,以达到通用化
n 同时用户也可以根据不同的表结构,选择相应版本的的存储过程,在这里共有三个版本可供用户选择,分别对应表结构中有无节点的深度字段等情况
进行调用本存储过程时只需要传递节点号及表名即可,但是用户选择相应版本进行应用时,需要针对实际情况作出选择
版本一
CREATE procedure prcDelete(@vSourceID varchar(30),@Table varchar(20), @iOK int output)
as
declare @iDepth int
declare @SQLString nvarchar(500)
set @SQLString=N'select vID from '+@Table +' where vID = '''+ltrim(rtrim(@vSourceID))+''''
exec(@SQLString)
if @@rowcount > 0
begin
set @SQLString=N'select @iDepth=iDepth from '+@table+ ' where vID = '''+ltr..
[阅读全文] [返回页首]
Fetching Across Commits: Where Is the Source of the Problem?
By Boris Milrud
Fetching across commits is a common and accepted practice in the Oracle programming world. However, it is not an ANSI-supported operation. According to the ANSI standard, a cursor is invalidated whenever a commit is performed, which means it should be closed and reopened. Hence, you should be aware of potential ORA-01555 errors and the fact that you are relying on a cursor behavior that is not to the ANSI standard.
Oracle always enforces statement-level read consistency. This guarantees that the data returned by a single query is consistent with respect to the time when the query began. Therefore, a query never sees the data changes made by the transactions that commit during the course of a query's executi..
[阅读全文] [返回页首]
Forms 6i Object-Based Features
Peter Koletzke, Quovera
Objects in Mirror are Closer Than They Appear
This warning—printed on automobile mirrors—is particularly appropriate to the development world. If you are not thinking about objects today, you surely see them looming in your rear-view mirror. Your use of object technology is closer than you think. You will use it soon as the industry trend towards object-oriented analysis, design, and programming continues.
The popularity of object orientation (OO) is due to its potential benefits. If object orientation is correctly implemented in any aspect of system development, there is a measurable gain in the areas of standards creation, use, and enforcement. Analysis and design is easier because business objects are more closely related..
[阅读全文] [返回页首]
The Anatomy of a Large-Scale Hypertextual Web Search Engine
Sergey Brin and Lawrence Page
{sergey, page}@cs.stanford.edu
Computer Science Department, Stanford University, Stanford, CA 94305
Abstract
In this paper, we present Google, a prototype of a large-scale search engine which makes heavy use of the structure present in hypertext. Google is designed to crawl and index the Web efficiently and produce much more satisfying search results than existing systems. The prototype with a full text and hyperlink database of at least 24 million pages is available at http://google.stanford.edu/ To engineer a search engine is a challenging task. Search engines index tens to hundreds of millions of web pages involving a comparable number of distinct terms. They answer tens of m..
[阅读全文] [返回页首]
ORA-01034错误的解决办法
--Oracle常见错误之一
事先说明,Oracle高手是不需要看本文的。
这是个Oracle数据库服务器比较常见的错误。有经验的用户几乎马上就能解决这个错误,再不济也能马上到Metalink(http://metalink.oracle.com)去搜索一下。
不幸的是,大多的时候,都是初级用户遇到的这样的问题(对他们提Metalink也起不到什么作用--一般都没有上面的帐号:))。所以,这个小帖子可能还有一定的作用。
问题描述=======在试图启动数据库的时候,Oracle报告下列错误:ERROR:ORA-27101 Shared memory realm does not exist ORA-01034 ORACLE not available
基本解释=======Error: ORA-27101 Text: shared memory realm does not exist -------------------------------------------Cause: Unable to locate shared memory realm Action: Verify that the realm is accessible
如何解决 =======
这个问题其实用一句话就可以说清楚:ORACLE_HOME..
[阅读全文] [返回页首]
保存点(SAVEPOINT)是事务处理过程中的一个标志,与回滚命令(ROLLBACK)结合使用,主要的用途是允许用户将某一段处理回滚而不必回滚整个事务,这在PL/SQL开发中还是很有用处的。下面的例子中,把SAVEPOINT标记在INSERT语句之前,如果这条INSERT语句试图将重复的数据保存到EMP表中的话,将触发执行预先定义的DUP_VAL_ON_INDEX例外处理,在这里面的ROLLBACK TO do_insert命令将回滚上面的那条INSERT操作,而不会影响前面的任何操作。
DECLARE emp_id emp.empno%TYPE;BEGIN UPDATE emp SET ... WHERE empno = emp_id; DELETE FROM emp WHERE ... ... SAVEPOINT do_insert; INSERT INTO emp VALUES (emp_id, ...);EXCEPTION WHEN DUP_VAL_ON_INDEX THEN ROLLBACK TO do_insert;END;
如果你定义了多个savepoint,当你指定回滚到某个savepoint时,那么回滚操作将回滚这个savepoint后面的所有操作(即使后面可能标记了N个savepoint)。例如,在..
[阅读全文] [返回页首]
8.统计列印各科成绩,各分数段人数: 课程ID,课程名称,[100-85],[85-70],[70-60],[<60]
尽管表面看上去不那么容易,其实用 CASE 可以很容易地实现:
SELECT 课程ID, 课程名称 ,SUM(CASE WHEN 成绩 BETWEEN 85 AND 100 THEN 1 ELSE 0 END) AS [100 - 85] ,SUM(CASE WHEN 成绩 BETWEEN 70 AND 85 THEN 1 ELSE 0 END) AS [85 - 70] ,SUM(CASE WHEN 成绩 BETWEEN 60 AND 70 THEN 1 ELSE 0 END) AS [70 - 60] ,SUM(CASE WHEN 成绩 < 60 THEN 1 ELSE 0 END) AS [60 -] FROM 成绩表GROUP BY 课程ID, 课程名称
注意这里的 BETWEEN,虽然字段名都是从高至低,可 BETWEEN 中还是要从低到高,这里 如果不小心,会犯一个很难发现的逻辑错误: 在数学上,当a > b 时,[a, b]是一个空集。
9.列印学生平均成绩及其名次
select count(distinct b.f) as 名次,a.学生ID,max(a.学生姓名),max(a.f) from (select distinct t...
[阅读全文] [返回页首]
SYBAES ASE 12.0 上一个横表转纵表的简单例子 千千如梦 2002年10月 /* create table ... */
create table #dest_table(
Flag char(1),
A int null,
B int null,
C int null,
D int null,
E int null
)
go
/* Flag 可以是一个或多个字段;但 Flag 须能建立 unique index */
create unique index idx_PRK on #dest_table (Flag)
go
create table #mid_table(
Flag char(1),
Item char(1),
Num int
)
go
/* Flag 可以是一个或多个字段;但 Flag 与 Item 能建立 unique index */
create unique index idx_PRK on #mid_table (Flag,Item)
go
/* init data ... */
i..
[阅读全文] [返回页首]