新
新来的菜鸟
Unregistered / Unconfirmed
GUEST, unregistred user!
我用oracle写了一个存储过程是返回临时表数据的,代码如下create or replace procedure sp_getResult(rst out sys_refcursor) isstr varchar2(50);tempisexist integer;begin---判断是否创建临时表 (这个表可以先创建不需要写在存储过程里)select count(*) into tempisexist from all_tables where table_name='TMP'; if tempisexist=0 thenexecute immediate 'create global temporary table TMP(id number,nameyzl varchar2(10)) on commit delete rows';execute immediate 'ALTER TABLE TMP ADD CONSTRAINT PK_id PRIMARY KEY (id)'; --设置表主键end if;---判断是否创建临时表commit; execute immediate 'insert into TMP (id,nameyzl) select id,test from test1';str:='select * from tmp';open rst for str;end sp_getResult;我用delphi 的ADOQuery1来进行连接和运行但在没关联DataSource1和DBGridEh1的时候运行时正常,但如果关联上DataSource1和DBGridEh1就会报错 ORA-08103bject no longer exists这是为何,小弟在线等待急....