Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 7 of 7 total |
View values as function processes?? |
Thu, Feb 1 2024 12:50 AM | Permanent Link |
Ian Branch | Hi Team,
I have this function: {sql} create FUNCTION ConvertDurationToSeconds(in durationString CHAR(12)) RETURNS BIGInt BEGIN DECLARE hours INT; Declare minutes INT; Declare seconds DECIMAL(6,4); set hours = Cast(Substring(durationString from 1 for 3) as Int); SET minutes = cast(Substring(durationString from 5 for 2) as Int); SET seconds = CAST(Substring(Durationstring from 8 for 2)+ '.'+ Substring(durationstring from 11 for 2) AS DECIMAL(6,4)); RETURN hours * 3600 + minutes * 60 + seconds; END; {sql} I would like to be able to the values of hours, minutes & seconds as the function processes them. Suggestions would be appreciated. Regards & TIA, Ian |
Thu, Feb 1 2024 7:58 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
What would you like "to be able to the values" and what's stopping you? Roy Lambert |
Thu, Feb 1 2024 12:51 PM | Permanent Link |
Ian Branch | Serves me right for not being careful enough after 8 hours at the keyboard...
I want to see in some form each of the hours, minutes,seconds values as the function processes. It can be written to a log or simply seen on-screen. Ian |
Fri, Feb 2 2024 3:09 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
Some bright spark might be able to come up with something but my advice is to give up. SQL is not meant as a display language and anything you do is liable to severely mess up the machine its running on. That's my thought since you'd be interfering with the SQL process which is intended to act in an atomic fashion. Of course that's based on the (possibly erroneous) assumption that I understand what you want to achieve. Roy Lambert |
Fri, Feb 2 2024 2:38 PM | Permanent Link |
Terry Swiers | > I want to see in some form each of the hours, minutes,seconds values as the function processes. It can be written to a log or simply seen on-screen. I assume you are trying to debug the function. Rework the function as a script with parameters and you can debug that within EDB Manager to see what the values are as it is processing. |
Fri, Feb 2 2024 3:50 PM | Permanent Link |
Ian Branch | Hi All,
Thank you for your inputs. I have eliminated the need for the function now. Regards, Ian |
Sat, Feb 3 2024 2:57 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Terry
Good catch - I never thought of the need for debugging. Roy Lambert |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |