能不能从一个存储过程返回一个值,供另一个存储过程使用?

scutcs 2006-04-08 06:40:07
我想从一张成绩单中,根据成绩高低确定等级1,2,3,4等.

然后返回这个等级供另一个存储过程来计算积点. 能不能实现?
...全文
117 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xeqtr1982 2006-04-08
  • 打赏
  • 举报
回复
set nocount on
create table t([id] int,[name] varchar(10))
insert into t select 1,'song'
insert into t select 2,'xs'
insert into t select 3,'ttw'
go

create proc tt
@name varchar(10),
@id int OUTPUT
as

select @id=id from t where [name]=@name
return
go

create proc tt1
@id int
as

print @id
go

declare @id int
exec tt 'song',@id OUTPUT
exec tt1 @id
go

drop proc tt
drop proc tt1
drop table t
xeqtr1982 2006-04-08
  • 打赏
  • 举报
回复
set nocount on
create table t([id] int,[name] varchar(10))
insert into t select 1,'song'
insert into t select 2,'xs'
insert into t select 3,'ttw'
go

create proc tt
@name varchar(10),
@id int OUTPUT
as

select @id=id from t where [name]=@name
return
go

create proc tt1
as

declare @id int
exec tt 'song',@id OUTPUT
print @id
go


exec tt1

drop proc tt
drop proc tt1
drop table t
擒兽 2006-04-08
  • 打赏
  • 举报
回复
WEB里面容易,不知道查询分析器或存储过程本身如何获取返回值,再以变量的形式exec另外一个过程
擒兽 2006-04-08
  • 打赏
  • 举报
回复
mark
scutcs 2006-04-08
  • 打赏
  • 举报
回复
谁能给我举一例:
定义两个简单的存储过程A,B
其中A返回一个变量a
然后B以这个a为参数被调用.

我就结帖.
scutcs 2006-04-08
  • 打赏
  • 举报
回复
楼上回答太简练了吧. 给我两句伪代码也好
xeqtr1982 2006-04-08
  • 打赏
  • 举报
回复
可以
内容概要:本书《Deep Reinforcement Learning with Guaranteed Performance》探讨了基于李雅普诺夫方法的深度强化学习及其在非线性系统最优控制中的应用。书中提出了一种近似最优自适应控制方法,结合泰勒展开、神经网络、估计器设计及滑模控制思想,解决了不同场景下的跟踪控制问题。该方法不仅保证了性能指标的渐近收敛,还确保了跟踪误差的渐近收敛至零。此外,书中还涉及了执行器饱和、冗余解析等问题,并提出了新的冗余解析方法,验证了所提方法的有效性和优越性。 适合人群:研究生及以上学历的研究人员,特别是从事自适应/最优控制、机器人学和动态神经网络领域的学术界和工业界研究人员。 使用场景及目标:①研究非线性系统的最优控制问题,特别是在存在输入约束和系统动力学的情况下;②解决带有参数不确定性的线性和非线性系统的跟踪控制问题;③探索基于李雅普诺夫方法的深度强化学习在非线性系统控制中的应用;④设计和验证针对冗余机械臂的新型冗余解析方法。 其他说明:本书分为七章,每章内容相对独立,便于读者理解。书中不仅提了理论分析,还通过实际应用(如欠驱动船舶、冗余机械臂)验证了所提方法的有效性。此外,作者鼓励读者通过仿真和实验进一步验证书中提出的理论和技术。

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧