Hello to everybody.
Currently I'm trying to execute a SP but AX return an error that says
something like this:
Can not select a record at ( )
The SQL Data Base has thrown an error.
This is the code that i'm trying to execute. I have to say that i
allready try to use an ODBC connection without any success.
server static InventDimId getLabelInventDimId(JournalId _journalId,
Voucher _voucher)
{
Connection connection;
Statement statement;
ResultSet resultSet;
SqlStatementExecutePermission perm;
str sqlStatement =
"exec dbo.PFXGetInventDim %1,%2";
InventDimId inventDimId;
;
connection = new Connection();
sqlStatement = strfmt(sqlStatement,_journalId,_voucher);
perm = new SqlStatementExecutePermission(sqlStatement );
perm.assert();
statement = connection.createStatement();
resultSet = statement.executeQuery(sqlStatement);
while ( resultSet.next() ) // The Error is thrown here
{
inventDimId = resultSet.getString(1);
}
CodeAccessPermission::revertAssert();
return inventDimId;
}
The Stored Procedure Code on Modification Mode
USE [PFX]
GO
/****** Objeto: StoredProcedure [dbo].[PFXGetInventDim] Fecha de la
secuencia de comandos: 02/25/2009 12:08:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[PFXGetInventDim]
@JournalId varchar(20),
@Voucher varchar(20),
@Result varchar(20) Output
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT @Result = dbo.INVENTDIM.INVENTDIMID
FROM dbo.PRODJOURNALTABLE WITH (NOLOCK)
INNER JOIN dbo.PRODJOURNALPROD WITH (NOLOCK)
ON dbo.PRODJOURNALTABLE.JOURNALID = @JOURNALID AND
dbo.PRODJOURNALTABLE.JOURNALID =
dbo.PRODJOURNALPROD.JOURNALID AND
dbo.PRODJOURNALTABLE.JOURNALTYPE = 1 AND
dbo.PRODJOURNALPROD.VOUCHER = @Voucher
INNER JOIN dbo.INVENTTRANS WITH (NOLOCK)
ON dbo.INVENTTRANS.VOUCHERPHYSICAL =
dbo.PRODJOURNALPROD.VOUCHER
INNER JOIN dbo.INVENTDIM WITH (NOLOCK)
ON dbo.INVENTDIM.INVENTDIMID = dbo.INVENTTRANS.INVENTDIMID
END
Thank you very much if you can help me :D
Gustavo Camargo
[Non-text portions of this message have been removed]