|
4. Re: SQL Statement failing in COBOL program (Jim Essinger)
date: Thu, 23 Aug 2007 10:41:57 -0600
Ok - here is the solution. Count the variables correctly and things will
work. I had repeated one field in the declare cursor statement, and when I
removed the duplicate field, I get the result that I desired. It sure helps
when SQL can match up the number of variables!
On comparing the character version of a number with an actual number field,
I found that
cast(1234567.89 as Char(10))
leaves the decimal in place. What I needed was the entire number without
the decimal.
replace(1234567.89,".","")
or
digits(1234567..89)
seems to do what I need in one step. The result is a valid compare with the
character number "123456789".
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.