使用oracle的javaJVM,trigger
create or replace java source named FirstClass as
public class FirstClass{
public static String greeting(String name){
return "Hello " + name + "!";
}
}
/
create or replace function firstclass_greeting (name varchar2) return varchar as
language java name 'FirstClass.greeting(java.lang.String) return java.lang.String';
/
SQL> select firstclass_greeting('Bruce') from dual;
FIRSTCLASS_GREETING('BRUCE')
--------------------------------------------------------------------------------
Hello Bruce!
========================================
Listing 4. The Source Code for create_bookstore_tables.sql
drop table books
/
drop table publisher_supply_orders
/
create table books(
book_id number primary key,
publisher_id number,
page_count number,
author_name varchar2(50),
book_title varchar2(50),
description varchar2(500),
status varchar2(10),
inventory_qty number
)
/
insert into books values(100, 200, 234, 'Bruce Hopkins', 'Bluetooth for Java', 'great book', 'IN STOCK', 10);
insert into books values(101, 200, 401, 'Sam Jones', 'Living on the East Coast', 'worth every penny', 'IN STOCK', 50);
insert into books values(102, 250, 278, 'Max Jason', 'The South of France', 'a best-seller', 'IN STOCK', 20);
create table publisher_supply_orders(
book_id number,
publisher_id number,
order_quantity number
)
/
=================
create or replace java source named "ReorderTrigger" as
import java.sql.*;
import oracle.jdbc.driver.*;
public class ReorderTrigger {
public static int REORDER_THRESHOLD = 5;
public static int REORDER_QTY = 25;
public static void reorderBooks(Integer bookID, Integer publi
相关文档:
Oracle管理员的两种认证方法
注意:重要
parameter 中remote_login_passwordfile
1、alter system set remote_login_passwordfile= none scope =spfile;
含义:非密码认证(此时仅os认证 )
2、alter system set remote_login_passwordfile= exclusive ......
1)导入oracle数据库文件.dmp时出现错误
imp PERSONNEL_MANAGE/MWQ@MIS file=C:\personnel_manage.dmp fromuser=PERSONNEL_MANAGE ignore=y commit=y grants=y;
IMP-00058: 遇到 ORACLE 错误 1017
ORA-01017: invalid username/password; logon denied用户名:
口令:
IMP-00058: 遇到 ORACLE 错误 1017
ORA-01017: in ......
/*============创建Customer表==========*/
create table Customer
(
Customer_id number(6) not null,
Customer_name varchar2(50) not null,
Password varcha ......
DECODE函数是ORACLE PL/SQL是功能强大的函数之一,目前还只有ORACLE公司的SQL提供了此函数,其他数据库厂商的SQL实现还没有此功能。DECODE有什么用途 呢? 先构造一个例子,假设我们想给智星职员加工资,其标准是:工资在8000元以下的将加20%;工资在8000元以上的加15%,通常的做法是,先选出记录 中的工资字段值? select ......
好没有碰Solaris了,手有些生了,看来真要装个solaris,平时多玩玩。
在solaris上装Oracle 10g先。
1. 检查安装依赖包
官方要求的包
SUNWarc
SUNWbtool
SUNWhea
SUNWlibm
SUNWlibms
SUNWsprot
SUNWtoo
SUNWi1of
SUNWi1cs
SUNWi15cs
SUNWxwfnt
执行命令
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SU ......