Hello Andy,
I tried as you recommended..
1. Created a stored procedure as same as UDF mentioned above.
2. Created a function to wrap up... like,
CREATE FUNCTION TRUNCATE_EDWTABLE_PARTITION(p_table_name VARCHAR(100), p_partition_suffix VARCHAR(100))
RETURNS DECIMAL
LANGUAGE SQL
MODIFIES SQL DATA
SPECIFIC TRUNCATE_EDWTABLE_PARTITION
BEGIN ATOMIC
CALL TRUNCATE_TP(p_table_name,p_partition_suffix);
RETURN 0;
END @
This gives...
/sp> db2 -td@ -f tf.sql
DB21034E The command was processed as an SQL statement because it was not avalid Command Line Processor command. During SQL processing it returned:
SQL0270N Function not supported (Reason code = "71"). LINE NUMBER=7. SQLSTATE=42997
=> 71
In a parallel environment, do not use CALL statement in a trigger, a SQL function, a SQL method or a dynamic compound statement.
Refer:-
http://publib.boulder.ibm.com/infoce.../t0011377.html
When invoking a procedure from within an SQL trigger, an SQL routine, or a dynamic compound statement the following restrictions apply:
* In partitioned database environments procedures cannot be invoked from triggers or SQL UDFs.
Please let me know if you have any suggestions... thanks