当前位置: 代码迷 >> PB >> 郭老师:Adaptive Server Anywhere 存储过程 语法和SQL2000 有什么区别?该怎么解决
  详细解决方案

郭老师:Adaptive Server Anywhere 存储过程 语法和SQL2000 有什么区别?该怎么解决

热度:106   发布时间:2016-04-29 09:06:32.0
郭老师:Adaptive Server Anywhere 存储过程 语法和SQL2000 有什么区别?
郭老师:Adaptive Server Anywhere 存储过程 语法和SQL2000 有什么区别?
创建一个简单的语句都错?

CREATE PROCEDURE ruku 
 AS
  SELECT * FROM ydjq
go
exec ruku


------解决方案--------------------
怎么还冒出个 郭老师。。。。

贴一个曾经写过的 asa的存储过程

ALTER PROCEDURE "spectwosuite"."zu_proc_g_34"(in p_evaluationdate datetime,in p_vessel numeric(15),in p_name numeric(15))
begin

create table #tmptable(
employeeid numeric(15) null,
name varchar(200) null,
Rank varchar(200) null,
Birth datetime null,
Vessel numeric(15) null,
company varchar(50) null,
evaluationdate datetime null,
Port_joined varchar(50) null,
Date_joined datetime null,
Port_signed_off varchar(50) null,
Date_signed_off datetime null,
Jan_Jun varchar(50) null,
Jul_Dec varchar(50) null,
New_joiner varchar(50) null,
Sign_off varchar(50) null,
uOthers varchar(50) null,
Category01 varchar(50) null,
Category02 varchar(50) null,
Category03 varchar(50) null,
Category04 varchar(50) null,
Category05 varchar(50) null,
Category06 varchar(50) null,
Category07 varchar(50) null,
Category08 varchar(50) null,
Category09 varchar(50) null,
Category10 varchar(50) null,
Category11 varchar(50) null,
Category12 varchar(50) null,
Category13 varchar(50) null,
Category14 varchar(50) null,


Remarks varchar(500) null,
CPD varchar(500) null,
ISM varchar(500) null,
ESD varchar(500) null,
BD varchar(500) null,
employalbe varchar(50) null,
);
insert into #tmptable( employeeid,name,rank,Birth,evaluationdate )
select distinct "employee"."employeeid","employee"."surname", "empranktype"."description" , "employee"."birthdate" , "empevaluation"."evaluationdate"
FROM "empevaluation" LEFT OUTER JOIN "employee" ON "employee"."employeeid" = "empevaluation"."employeeid" LEFT OUTER JOIN "empranktype" ON "empranktype"."empranktypeid" = "employee"."employeerankid"
 where empevaluation.EMPEVALPROFILEID=12500000002;

 update #tmptable 
set company =(
SELECT top 1 "address"."name" 
from "address" ,"empcontract" where "empcontract"."companyaddressid" = "address"."addressid" 
and "empcontract"."employeeid" = #tmptable .employeeid ) ;

 update #tmptable 
set Vessel =(
SELECT "empevaluation"."ZU_VESSEL"
from "empevaluation" where "empevaluation"."evaluationdate" = "#tmptable"."evaluationdate"
and "#tmptable"."employeeid" = "empevaluation"."employeeid"
and "empevaluation"."ZU_VESSEL" is not null) ;

update #tmptable 
set Port_joined =(
SELECT "empevaluation"."ZU_PORTJOINED"
from "empevaluation" where "empevaluation"."evaluationdate" = "#tmptable"."evaluationdate"
and "#tmptable"."employeeid" = "empevaluation"."employeeid"
and "empevaluation"."ZU_PORTJOINED" is not null) ;

update #tmptable 
set Date_joined =(
SELECT "empevaluation"."ZU_DATEJOINED"
from "empevaluation" where "empevaluation"."evaluationdate" = "#tmptable"."evaluationdate"
  相关解决方案