Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread EDBManager & debugging functions
Sat, Aug 16 2014 11:22 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

. I have just found out that double clicking a function name in  the left hand side tree executes it (shows how often I write SQL functions).

Two questions

1. The parameter for the function is a CLOB - how do I enter a multi line CLOB as a parameter?

2. How do I then step through the function to find out where I got it wrong?

Roy Lambert
Mon, Aug 18 2014 3:08 PMPermanent Link

Adam Brett

Orixa Systems

Roy Lambert wrote:

>>1. The parameter for the function is a CLOB - how do I enter a multi line CLOB as a parameter?

Sorry Roy, I don't use CLOBs as params.

>>2. How do I then step through the function to find out where I got it wrong?

Pretty sure you have to do this by throwing an exception, with a line-number. I don't think EDBMgr is clever enough to allow any sort of step-through debugging. If I am wrong I would really like to hear about it!
Tue, Aug 19 2014 8:18 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

>>>1. The parameter for the function is a CLOB - how do I enter a multi line CLOB as a parameter?
>
>Sorry Roy, I don't use CLOBs as params.

This is basically an extract and format for a report. The sort of thing you'd use a stringlist for in Delphi I've got it going now.

>>>2. How do I then step through the function to find out where I got it wrong?
>
>Pretty sure you have to do this by throwing an exception, with a line-number. I don't think EDBMgr is clever enough to allow any sort of step-through debugging. If I am wrong I would really like to hear about it!

I know you can step through scripts and I was hoping you could do the same with functions once I found I could run it by double clicking.

Roy

ps quiet and spooky here these days. Everyone must be on holiday Smile
Tue, Aug 19 2014 12:37 PMPermanent Link

Barry

Roy Lambert wrote:

Adam

>>>1. The parameter for the function is a CLOB - how do I enter a multi line CLOB as a parameter?
>
>Sorry Roy, I don't use CLOBs as params.

This is basically an extract and format for a report. The sort of thing you'd use a stringlist for in Delphi I've got it going now.

>>>2. How do I then step through the function to find out where I got it wrong?
>
>Pretty sure you have to do this by throwing an exception, with a line-number. I don't think EDBMgr is clever enough to allow any sort of step-through debugging. If I am wrong I would really like to hear about it!

I know you can step through scripts and I was hoping you could do the same with functions once I found I could run it by double clicking.<

That would be nice if it opened up a script window with the code and used the parameter values that are defined, but it doesn't (at least I haven't found a way to do it except manually as shown below). Maybe recommend this as a new feature? (There would have to be a save button to save it back to the function/procedure when you are done testing the script).

>ps quiet and spooky here these days. Everyone must be on holiday Smile

What is this thing you call "holiday"? <vbg>

For a Clob parameter, can you not just concatenate lines together with 'line1'+#13+#10+'line2'+#13+#10 ...?
(Remember to use a "+" between the #13 and #10).

To debug a function or stored procedure I do it the old fashioned way. You probably already know this, but I'm posting it anyways for the newbies out there.

1) I copy and paste the function/procedure code (from SQL tab)  to a script window and
2) declare a set of variables that match the parameter list with default values.
3) I then comment out the Return clause (if there is one) and add a "Set Log Message to Cast(Result as VarChar);"

4) I can step through the script as if it were processing the parameters (the variables with the default values I just defined).

5) When the script has been thoroughly tested and if I made changes to it, I comment out the Declare statements I added for the parameters using /* ... */  and comment the "Set Log Message ..." statement and uncomment the Return statement (if there is one).

6) I now Alter the function/procedure and paste the new code into the function/procedure.

The next time I need to test the function/procedure, I repeat the process, except this time I only need to uncomment the Declare statements for the parameters and the "Set Log Message " statement and I'm ready to go.

It works quite well and takes only a few seconds to start debugging in the script window.
I hope this helps someone.

Barry
Tue, Aug 19 2014 1:32 PMPermanent Link

Raul

Team Elevate Team Elevate

On 8/19/2014 8:18 AM, Roy Lambert wrote:
> ps quiet and spooky here these days. Everyone must be on holiday Smile
>

In my case couple of weeks of vacation (no NG reading of any kind) and
now trying to catch up on work. Combined with the Elevate Software
products "just working" at the moment so no need to post.

It's a quiet before  a storm though me thinks - once EWB 2 ships we
should lot more action.

Raul
Wed, Aug 20 2014 3:55 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Barry


Yup, your approach is about the only way I could think to do it as well.

As you say it would be nice to have this built in.

Roy Lambert
Image