× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Last word...

Here are things that I learned doing the "less than elegant" SQL I wrote.

I had never needed to find the remainder of division in SQL...now I know that the MOD scalar will tell me this value.

TIMESTAMP_FORMAT will convert "bad" date values stored as numbers in such a way that one cannot test the failures using CASE, COALESCE or IFNULL tests. BTW - I view this as a bug at this point.

The OP provided an SQL example where the number-as-date needed validation. I incorrectly thought that the TIMESTAMP_FORMAT scalar might get the OP closer to the answer. Rob was correct in pointing out my error. The failure cannot be monitored for within the scope of the select, unless you incorporate a UDF to perform the task. So I simply wanted to find a way to validate the number-as-date was a date.

This was never a debate on RPG vs. SQL. The restriction to use only SQL was my own. Meant to challenge me.

After coding with RPG for > 30 years, doing it with RPG would have been too easy. Even so, a production version of this tool would likely be a hybrid of RPG and SQL. Now that I learned a bunch of new techniques (you only see where I finally stopped, not the path of dead ends that got me there)...I'll likely just put the experience on the shelf...waiting for an appropriate requirement for one of the many things that I learned doing this task this way.

I’d do it again in exactly this way...for the challenge! The only difference will be that I will not share it here...it isn't worth it.

Steve Needles


________________________________
This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.

TRVDiscDefault::1201

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.