Sybase Stored Procedure fails to load with error 'java.lang.IllegalArgumentException: The column name is not valid'
book
Article ID: KB0080837
calendar_today
Updated On:
Products
Versions
Spotfire Analyst
All Versions
Description
Sybase stored procedure fails to load in TIBCO Spotfire with below error and works fine in SQL Developer:
InformationModelServiceException at Spotfire.Dxp.Services:
An Internal Error has occurred. java.lang.IllegalArgumentException: The column name is not valid. (HRESULT: 80131509)
Cause: If a Sybase stored procedure returns a column which is not named or with no alias, it fails to load in TIBCO Spotfire as that column is unnamed. Sybase Stored procedures returning unnamed columns are not supported. Below is the example of such Stored Procedures :
CREATE PROCEDURE TestProc
AS
BEGIN
------
-------
select convert(varchar(12), L.APPROVED_DATE) from tablename;
-------
END
In above example, stored procedure returns a column using convert() function which has no alias and hence considered as unnamed column.
Resolution
Add alias where ever necessary specially when functions as in above query are used and if stored procedure returns that column. By changing the select statement as below, Sybase stored procedures will be loaded in TIBCO Spotfire as well.
CREATE PROCEDURE TestProc
AS
BEGIN
------
-------
select convert(varchar(12), L.APPROVED_DATE) as column_name from tablename;
-------
END
Issue/Introduction
If unnamed columns or columns with no alias are tried to return from Sybase stored procedure, it fails to load in Spotfire.