Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#712 Stored procedure having aggreagte function in select statement

v1.3
open
momo
2
2013-08-06
2013-08-06
suraj
No

If an aggregate function e.g count(*) is used in procedure, the column name gets blank value.

DB:MSSQL 2012
Procedure used:
CREATE procedure [dbo].[testprocedure6]
As
select COUNT(*) from table

GO

code snippet:

rs = databaseMetaData.getProcedureColumns(...
while (rs.next())
{rs.getString(COLUMN_NAME)}

Discussion

  • suraj
    suraj
    2013-08-06

    Please ignore the above code snippet. This error I am getting after execution of procedure.

    ResultSetMetaData rsMetadata = rs.getMetaData();

    String columnName = rsMetadata.getColumnName(column_index);