触发条件:Insert\Update\Delete在触发器中执行的动作:将对当前表所做的Insert\Update\Delete的完整SQL语句记入文本文件。请教该如何实现?请给出示例。
解决方案 »
- oracle中字符串更新到blob字段中
- 找表中最后更新的一行
- SQL*PLUS创建表空间文件
- 菜鸟提问:数据和表的分析过程或分析后用不用重启服务,在分析过程中要注意什么问题,用停掉应用吗?
- 怎么用SQL语句判断字符串????
- 妹妹求助,这条SQL能不能修改的高效一点?这样一条,竟然花了我2.985秒时间。
- 求一个自动插入的触发器!?
- sqlnet.ora中这个参数是做什么用的呢?为什么可以解决包写入程序失败的错误?
- sql serrver 的存储过程向oracle存储过程转化问题
- oracle登陆错误:ORA-12638,凭证检索失败。
- Oracle优化后,数据不更新了.(运行了SYS.DBMS_STATS.GENERATE_STATS)
- 请教一个数据导入的问题
-- 环境 windows 2000 server + oracle 8.1.7
-- 先在 init.ora中的参数utl_file_dir
-- 例: utl_file_dir=(d:\test,e:\\,e:\share)
-- set serveroutput on size 1000000 format wrapped create or replace procedure write_txtfile( -- 写一个字符串到指定文本文件中
path in varchar2,
name in varchar2,
pstr in varchar2
)
as
l_output utl_file.file_type;
str varchar2(1000);
begin
l_output:=utl_file.fopen(path,name,'a',2000); -- 每行最大字节数最多为32K bytes
--l_output:=utl_file.fopen(path,name,'a'); -- 每行最大字节数最多为1023 bytes
utl_file.put_line(l_output,pstr);
utl_file.fclose(l_output);
exception
when utl_file.invalid_path then
raise_application_error(-20001,'INVALID_PATH!');
when utl_file.invalid_mode then
raise_application_error(-20002,'INVALID_MODE!');
when utl_file.invalid_filehandle then
raise_application_error(-20003,'INVALID_FILEHANDLE!');
when utl_file.invalid_operation then
raise_application_error(-20004,'INVALID_OPERATION!');
when utl_file.read_error then
raise_application_error(-20005,'READ_ERROR!');
when utl_file.write_error then
raise_application_error(-20006,'WRITE_ERROR!');
when utl_file.internal_error then
raise_application_error(-20007,'INTERNAL_ERROR!');
when others then
str:=sqlerrm(sqlcode);
dbms_output.put_line(str);
执行SQL:Insert into T_User(ID,Name) values('1','tom');
系统会激活触发器TriggerTest;
我希望在TriggerTest中取得SQL(即Insert into T_User(ID,Name) values('1','tom'))。