怎样在sybase sql anywhere 5.0中加入自定义变量?

fyxchh 2002-09-17 04:49:18
用以下语句出错,为什么?
sp_droptype u001
go
sp_addtype u001,float
go
...全文
97 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
WangAQ 2002-10-04
  • 打赏
  • 举报
回复
那是自定义变量类型
mantis 2002-10-04
  • 打赏
  • 举报
回复
学习!
flyhot 2002-10-04
  • 打赏
  • 举报
回复
密切关注行业动态!
ryoqiang 2002-09-20
  • 打赏
  • 举报
回复
同意楼上的
奇遇 2002-09-17
  • 打赏
  • 举报
回复
应该用

exec sp_addtype u001,'float'
exec sp_addtype 'u001','float'



CREATE DOMAIN "u001" float

贴出该存储过程你看看就明白了

create procedure dbo.sp_addtype(in @typename char(30),in @phystype char(30),in @ident_null char(20) default 'not specified')
begin
declare dflt char(30);
declare nullable char(8);
call dbo.sp_checkperms('RESOURCE');
set dflt='';
set nullable='';
if @ident_null is null then
set @ident_null='null'
end if;
if @ident_null<>'not specified' then
if lcase(@ident_null)='identity' then
set dflt='default autoincrement';
set nullable='not null'
else
if lcase(@ident_null)='nonull' then
set nullable='not null'
else
set nullable=@ident_null
end if
end if
end if;
execute immediate with quotes 'create domain '
||@typename||' '
||@phystype||' '||nullable||' '||dflt
end

2,598

社区成员

发帖
与我相关
我的任务
社区描述
Sybase相关技术讨论区
社区管理员
  • Sybase社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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