Base MYSQL Database create stored procedures resolve the Delimiter error

Base MYSQL Database create stored procedures resolve the Delimiter error, It must be created using a query script. You can't use the Create Procedure Wizard directly.
for example:
Delimiter $$ CREATE PROCEDUREPR_SELSTATION( in Sname varchar(50), in Scode varchar(50) ) BEGIN if Sname='' and Scode <> '' then Begin SELECT NUM_STN ,NAME_STN ,SHORTNAME_STN ,IDEOBJ_STN ,IDENO_STN ,THISFLAG_STN ,QUICKKEY_STN ,STNO_STN ,(Select VALUE_PARAV From TB_SYS_PARAV Where NUM_PARAV=STASPECT_STN) as dierction_STN FROM TB_SYS_STATION WHERE NUM_STN LIKE concat('%',Scode,'%'); end; end if; if Scode='' and Sname <> '' then Begin SELECT NUM_STN ,NAME_STN ,SHORTNAME_STN ,IDEOBJ_STN ,IDENO_STN ,THISFLAG_STN ,QUICKKEY_STN ,STNO_STN ,(Select VALUE_PARAV From TB_SYS_PARAV Where NUM_PARAV=STASPECT_STN) as dierction_STN FROM TB_SYS_STATION WHERE NAME_STN LIKE concat('%',Sname,'%'); END; end if; if Sname<>'' And Scode<>'' then Begin SELECT NUM_STN ,NAME_STN ,SHORTNAME_STN ,IDEOBJ_STN ,IDENO_STN ,THISFLAG_STN ,QUICKKEY_STN ,STNO_STN ,(Select VALUE_PARAV From TB_SYS_PARAV Where NUM_PARAV=STASPECT_STN) as dierction_STN FROM TB_SYS_STATION WHERE NAME_STN LIKE concat('%',Sname,'%') And NUM_STN LIKE concat('%',Scode,'%'); End; end if; END$$

posted @ 2024-02-22 18:09  瘦腿先生Stephen  阅读(23)  评论(0编辑  收藏  举报