New answers tagged db2
You can't do this in a single step. The locking required to truncate the table precludes you querying the table at the same time. The best option you would have is to declare a global temporary table (DGTT) and insert the rows you want into it, truncate the source table, and then insert the rows from the DGTT back into the source table. Something like: ...
You say that your procedure has two parameters: an input INTEGER and an output VARCHAR, however, you call a procedure with only one argument, therefore DB2 is looking for the procedure that has only one INTEGER argument. You should call it like so: call ADMINIST.LOG_MSG_TEST(1,?); where the question mark is a placeholder for the output argument.
If you are doing SQL, then you probably would need to do a TRUNCATE/DELETE on the table and then INSERT into. If you are using LOAD and/or IMPORT, they both have options for clearing the table before getting data into the table.
There was no change that I am aware of in Fixpack 5 to the requirement that the registry variable DB2_COMPATIBILITY_VECTOR must be set to MYS for the ... LIMIT x OFFSET y functionality to work. (Unsetting it in FP5 still results in an error if you try to use LIMIT / OFFSET). You may want to look to see if DB2_COMPATIBILITY_VECTOR is set in the global ...
LOG_CONF_BP is a bufferpool. That is a chunk of memory dedicated to doing something (usually servicing one or more tablespaces, which is where tables reside). So what is happening is your stored procedure is trying to create an object that already exists. So what is going to need to change is the stored procedure. I would ask if your stored procedure needs ...
The IXF format is documented in the manuals. Conceivably, if other methods don't work as you would like them to, you could write a script to extract column definitions.
In situations where one static sql (procedure) executes better than an equivalent one, I would examine: a) whether this depends on the order of execution, i.e. does the second one benefit from the first one reading data from disk into the bufferpool? If one runs better than the other regardless of the order they are run in this is not the case. b) are the ...
You don't specify what "first" means (or provide any table structure or example data), but let's assume it's the earliest completion timestamp: SELECT entity, min(completion_ts) FROM your_table GROUP BY entity If you are just getting results for a single entity, you can simplify even more: SELECT min(completion_ts) FROM your_table WHERE ...
Top 50 recent answers are included