I run into a problem while calling a proc in SQL server. I am using a database control to do so. The proc returns a integer. This is the first time I use SQL server. Any thoughts? Thanks in advance.
My method call is:
int createAccount(SQLParameter[] param)
The sql is:
{call espsiCompany(?, ?, ?)}
The error is:
java.lang.NullPointerException
at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1885)
at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2691)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
at services.OnyxDBControl.createAccount(OnyxDBControl.ctrl)
at services.OnyxDBControlTest.createAccount(OnyxDBControlTest.jws:18)
DECLARE @RC int
DECLARE @iSiteId int
DECLARE @iCompanyId int
DECLARE @chLanguageCode char(4)
DECLARE @vchAssignedId varchar(255)
DECLARE @vchCompanyName varchar(255)
DECLARE @vchAddress1 varchar(255)
DECLARE @vchAddress2 varchar(255)
DECLARE @vchAddress3 varchar(255)
DECLARE @vchCity varchar(255)
DECLARE @chRegionCode char(4)
DECLARE @chCountryCode char(4)
DECLARE @vchPostCode varchar(40)
DECLARE @vchPhoneNumber varchar(40)
DECLARE @vchEmailAddress varchar(255)
DECLARE @vchURL varchar(255)
DECLARE @iCompanyTypeCode int
DECLARE @iCompanySubTypeCode int
DECLARE @iFamilyId int
DECLARE @iParentId int
DECLARE @iPrimaryContactId int
DECLARE @vchContactFirstName varchar(255)
DECLARE @vchContactLastName varchar(255)
DECLARE @iDivisionCode int
DECLARE @iSICCode int
DECLARE @iMarketSector int
DECLARE @vchTaxId varchar(255)
DECLARE @vchDunnsNumber varchar(255)
DECLARE @iPhoneTypeId int
DECLARE @iAddressTypeId int
DECLARE @iSourceId int
DECLARE @iStatusId int
DECLARE @bValidAddress tinyint
DECLARE @iAccessCode int
DECLARE @bPrivate tinyint
DECLARE @vchUser1 varchar(255)
DECLARE @vchUser2 varchar(255)
DECLARE @vchUser3 varchar(255)
DECLARE @vchUser4 varchar(255)
DECLARE @vchUser5 varchar(255)
DECLARE @vchUser6 varchar(255)
DECLARE @vchUser7 varchar(255)
DECLARE @vchUser8 varchar(255)
DECLARE @vchUser9 varchar(255)
DECLARE @vchUser10 varchar(255)
DECLARE @chInsertBy char(10)
DECLARE @dtInsertDate datetime
DECLARE @tiLockRecord tinyint
DECLARE @tiRecordStatus tinyint
DECLARE @tireturnType tinyint
-- Set parameter values
EXEC @RC = [ONYXPROD].[dbo].[espsiCompany] @iSiteId, @iCompanyId OUTPUT , @chLanguageCode, @vchAssignedId, @vchCompanyName, @vchAddress1, @vchAddress2, @vchAddress3, @vchCity, @chRegionCode, @chCountryCode, @vchPostCode, @vchPhoneNumber, @vchEmailAddress, @vchURL, @iCompanyTypeCode, @iCompanySubTypeCode, @iFamilyId, @iParentId, @iPrimaryContactId, @vchContactFirstName, @vchContactLastName, @iDivisionCode, @iSICCode, @iMarketSector, @vchTaxId, @vchDunnsNumber, @iPhoneTypeId, @iAddressTypeId, @iSourceId, @iStatusId, @bValidAddress, @iAccessCode, @bPrivate, @vchUser1, @vchUser2, @vchUser3, @vchUser4, @vchUser5, @vchUser6, @vchUser7, @vchUser8, @vchUser9, @vchUser10, @chInsertBy, @dtInsertDate, @tiLockRecord, @tiRecordStatus, @tireturnType
Hi. That's not the signature of the procedure. What I'd like to see is
the SQL used to create the procedure, eg:
create procedure myProc @foo int, @bar varchar(30) ....
as
begin
...
end