Hi,
I fixed this issue. the Dynamic sql should be written as:
SET stmt = 'SELECT MIN(' || p_fieldname || ') , MAX (' || p_fieldname || ') from ' || trim(p_schemana me) || '.' || trim(p_tablenam e);
User Profile
Collapse
-
wlinliang started a topic Create dynamic cursor got ERROR: Invalid use of an aggregate function or ...in DB2Create dynamic cursor got ERROR: Invalid use of an aggregate function or ...
Hi All,
I am new in SQL/PL, I wrote following procedure to return min and max value (type: TIMSTAMP)in DB2 v9.5. IT is a dynamic SQL since i would like pass fieldname and table name as parameter.
...Code:CREATE OR REPLACE PROCEDURE get_min_max_time( IN p_schemaname ANCHOR maint.archive_cntl.del_schema, IN p_tablename ANCHOR maint.archive_cntl.del_table, IN p_fieldname ANCHOR maint.archive_cntl.del_table_time_col_name,
No activity results to display
Show More
Leave a comment: