我创建了以下程序,但它给了我错误
PROCEDURE profileMigration20 compiled
Warning: execution completed with warning
1/30 PLS-00103: Encountered the symbol "@" when expecting one of the following:
<an identifier> <a double-quoted delimited-identifier>
current delete exists prior
create or replace Procedure profileMigration20(@firstname varchar(40))
is
Begin
INSERT INTO DPS_USER(ID
,LOGIN
,AUTO_LOGIN
,PASSWORD
,MEMBER
,FIRST_NAME
,MIDDLE_NAME
,LAST_NAME
,USER_TYPE
,LOCALE
,LASTACTIVITY_DATE
,REGISTRATION_DATE)
select ID
,LOGIN
,AUTO_LOGIN
,PASSWORD
,MEMBER
,FIRST_NAME
,MIDDLE_NAME
,LAST_NAME
,USER_TYPE
,LOCALE
,LASTACTIVITY_DATE
,REGISTRATION_DATE
FROM NM_DPS_USER where FIRST_NAME=@firstname;
End;
答案 0 :(得分:2)
如果记忆对我有用......
看起来你使用了错误的语法(它看起来像是MS SQL使用的T-SQL语法)。
要在pl / sql中使用参数,语法应为:
CREATE [OR REPLACE] PROCEDURE procedure_name (
param_name1 IN datatype, param_name12 IN datatype ... )
在你的情况下:
create or replace Procedure profileMigration20(firstname IN varchar2(40))
并使用它只需在没有@符号的情况下调用它:
FROM NM_DPS_USER where FIRST_NAME=firstname;