andkylee 发表于 2011-10-19 22:44

如果使用ASE15.5,则可以使用Deferred Name Resolution选项。
A new option in ASE 15.5; can be set server wide and at session level
When enabled, checking for existence of all referred tables is postponed until execution time, allowing the procedure to be created.
1> set deferred_name_resolution on
2> go
1> create proc my_proc
2> as
3> select * from #t
4> go
1> create table #t (a int)
2> insert #t values (123)
3> go
1> exec my_proc
2> go
a
-----------
      123

pinkscut 发表于 2011-10-20 08:19

多谢andkylee的指点:)

Eisen 发表于 2011-10-20 11:32

创建存储过程的时候,新存储过程中可以调用不存在的存储过程。然而,存储过程中不能引用不存在的表!
所以 ...
andkylee 发表于 2011-10-19 22:41 http://bbs.chinaunix.net/images/common/back.gif


    还是你强,一句话就给解释清楚了……

蝴蝶姐姐001 发表于 2011-10-26 15:17

同意楼上的。
页: 1 [2]
查看完整版本: 存储过程a调用存储过程b中的临时表#t