开发者

Oracle Uknown Command Error when executing stored proc

I am using SQl Developer to execute a procedure with in a package named CONTRACTOR_REG. The procedure has the following signiture.

PROCEDURE usp_ins_contractor_all(
          webid          VARCHAR2,--
          firstname      VARCHAR2,--
          lastname       VARCHAR2,--
          middlename     VARCHAR2,--
          busname        VARCHAR2,--
          townname       VARCHAR2,--
          strname        VARCHAR2,--
          strtypecd      VARCHAR2,--
          strpfxcd       VARCHAR2,--
          strsfxcd       VARCHAR2,--
          addressoverflo VARCHAR2,--
          houseno        VARCHAR2,--
          zipcd          VARCHAR2,--
          state          VARCHAR2,--
          phonenum       VARCHAR2,--
          phonenight     VARCHAR2,
          phonecell      VARCHAR2,--
          phonefax       VARCHAR2,--
          phonepager     VARCHAR2,
          licno          VARCHAR2,--
          regSite        VARCHAR2,
          licstate       VARCHAR2,--
          level_type     VARCHAR2 := 'NA',--
          type_cd        CHAR)

I am trying to execute the following:

exec user1.contractor_reg.usp_ins_contractor_all('testing12345',
          'test',
          'me',
          'a',
          'testbiz',
          'DFGGH',
          'something'开发者_运维问答,
          null,
          null,
          null,
          'pobox:12345',
          '45',
          '00000',
          'DF',
          '1231231231',
          '2342342344',
          '443243242',
          '111111111',
          null,
          '123123123',
          null,
          'FD',
          'NA',
          'EC')

I get following error:

Error starting at line 25 in command:
          'EC')
Error report:
Unknown Command

Seems really random to me, whats wrong with my last parameter?

Thanks in advance!


The reason mentioned in your reply might not be the reason for the error.

As Alex mentioned below, to use EXEC with SQLPLUS, you need use the continuation character, if your command spans multiple lines...

http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12022.htm#i2697931

EXEC is a SQLPLUS command. when you use..

exec p1;

in sqlplus,it in turn adds a begin and end block to execute your procedure...

begin
  p1;
end;
/

Not sure if SQL Developer supports this.I don't have access to SQL Developer at work, but..

Have you tried executing this procedure using BEGIN-END ?

begin
  user1.contractor_reg.usp_ins_contractor_all('testing12345',
          'test',
          'me',
          'a',
          'testbiz',
          'DFGGH',
          'something',
          null,
          null,
          null,
          'pobox:12345',
          '45',
          '00000',
          'DF',
          '1231231231',
          '2342342344',
          '443243242',
          '111111111',
          null,
          '123123123',
          null,
          'FD',
          'NA',
          'EC');
end;
/


Aparently, you cannot have line breaks inbetween each paramter like I did... Stupid program...

exec user1.contractor_reg.usp_ins_contractor_all('testing12345','test','me','a','testbiz','sdfsdf','something',null,null,null,'pobox:12345','45','00000','sdfff', '1231231231', '2342342344', '443243242', '111111111', null, '123123123', null, 'sdff', 'E1','EC')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜