User Profile

Collapse

Profile Sidebar

Collapse
wlinliang
wlinliang
Last Activity: Jul 21 '13, 12:43 AM
Joined: Jul 14 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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);
    See more | Go to post

    Leave a comment:


  • Create 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,
    ...
    See more | Go to post
    Last edited by Rabbit; Jul 14 '13, 08:51 PM. Reason: Please use code tags when posting code.
No activity results to display
Show More
Working...