If you are on a currently supported version of Db2 for LUW (11.1 or 11.5) you can use either DBMS_UTILITY.FORMAT_CALL_STACK() or DBMS_UTILITY.FORMAT_ERROR_BACKTRACE() in your signal handler to log the troubleshooting information.
It works fine for me in clpplus 1.6
$ clpplus -h | head -1
CLPPlus: Version 1.6
$ cat sql
create or replace procedure proc1()
declare vId int default 0;
SELECT TEXT FROM SYSCAT.PROCEDURES WHERE PROCNAME = 'PROC1'
$ clpplus -nw $user/"$password"@$host:$port/$database @"$...
In this section of your procedure:
where rtrim(substring(PrdAcctId,1,8)) in (@prd)
and floor(cast(substring(PrdAcctId,17,8) as int))=0
you are using the @fromdate as the filter and looking for the values earlier. Then you increase the @fromdate value. But the earliest date before Wednesday of the ...
I'm not aware that either the CLP or Dbeaver strip formatting from Stored Procs (views in the CLP are a different matter unfortunately ).
For example, this is from Dbeaver
CREATE PROCEDURE P()
SELECT TEXT FROM SYSCAT.PROCEDURES WHERE PROCNAME = 'P'
CREATE PROCEDURE P()
and from the command line, ...
I don't believe the behavior has changed between SQL 2016 and SQL 2017. It may be that the SQL 2016 database was TRUSTWORTHY whereas the SQL 2017 database is not or has a database owner sid mismatch. The proper solution is module signing as Rusanu describes. Also see the Activation Procedures for Service Broker topic topic in the appendex of ...
One of the drive is the source, because that could define the best way.
Now, i will assume there is some internal logic to the procedure.
send it as json/xml and parse it using MSSQL functions
send it as a table valuable
place it into a temporar table and process it in procedure
IF convert(varchar(11),CURRENT_TIMESTAMP,108) >= '06:56:59' BREAK;
Before fetching the new row.
This will stop the cursor after 06:56:59
The current timestamp will be converted in a 24h string and will be compared wuth the choosen time every day.
Use the SHOW command to check to make sure CLPPlus has the preservewhitespace option and make sure it is ON.
If the option is not there you may have on old clpplus.jar file.
My problem was that the clpplus.jar file had date stamp 2011-04-01 6:54 AM even though it shows CLPPlus: Version 1.6 when it launches.