Skip to Content
0
Apr 12, 2014 at 04:25 AM

Getting the row count for dynamically specified table in a procedure

613 Views

I have the following code in my procedure:

EXEC 'SELECT COUNT(*) INTO'|| V_CNT ||'FROM'|| :V_TBLNAM_IN;

:V_TBLNAM_IN is a dynamically specified table name.

I get the following error:

Could not execute 'CALL "xxx"."xxxxx"( '"TABLE_A"')' in 179 ms 917 µs .

SAP DBTech JDBC: [2048]: column store error: search table error: [2620] "xxx"."xxxxx": line 10 col 1 (at pos 240): [105] (range 1) NullConversion exception

When the code is compiled no error.

Any help would be appreciated.

Thanks.