× 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.



I sent this message yesterday in response to a message that I thought was
from the list, but was in fact a private reply. Sending again so that all
know I'm grateful for Birgitta's and Charles' help.

Thanks for the compliments, John! And thanks to Birgitta and Charles for
the solution.


Code is at http://code.midrange.com/cba26e1723.html


Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"We're proud of our restaurant. The public is invited to inspect at any
time. KEEP OUT!"
-- sign on kitchen door of a New Your City restaurant


Very clever - and "Doh!" - such a simple idea - those are the best
ideas.

Please share with the list your final solution. I think it would be
good for us, the i-community, to have a standard implementation of this,
that we would see if we go from shop to shop. I am curious if you will
run into anything in the implementation that requires more thought (
return values ? maybe ?) or should the 2 decimal just be a standard


message: 3
date: Tue, 25 May 2010 08:30:06 -0400
from: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
subject: Quick SQL expression evaluation

I am trying to write a procedure I thought would be extremely simple: a
short SQL evaluation program that would simply take an expression and
return the result of SQL operating on that expression. For a silly
example:

Exec sql set :myResult = 2 + 2 ;

To minimize complexity, I am passing the '2 + 2' part as a string, so
that the meat of this very short procedure is:

Exec sql setl :myResult = :myExpression ;

Dennis E. Lovelady
AIM/Skype: delovelady MSN: fastcounter@xxxxxxxxxxxx
<http://www.linkedin.com/in/dennislovelady>
www.linkedin.com/in/dennislovelady --
You can't have everything. Where would you put it?


------------------------------
message: 4
date: Tue, 25 May 2010 14:51:26 +0200
from: "Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
subject: AW: Quick SQL expression evaluation

Try the following:

D MyResult S 11P 2
D String S 256A Varying
D Expr S 256A Varying inz('2 + 2')
/Free
String = 'Values(' + Expr + ') into ?';
/Exec SQL Prepare DynSQL From :String;
/Exec SQL Execute DynSQL using :MyResult;
Dsply MyResult;
/End-Free

Birgitta Hauser


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.