4gl & SQL 
Author Message
 4gl & SQL

Why does the same sql statement performed in 4GL command and dbaccess give
two different results?

UNLOAD TO "legaltbl.unl"
SELECT  T0.tworkdt, T3.tkinitb, T0.tbillrt,  T0.tbillhrs, T0.tudef2,
T1.tddesc, T1.tindex, T1.tdline, T1.tdindex
FROM timecard T0, timedesc T1, matter T2, timekeep T3
WHERE T0.tindex = T1.tindex
AND T0.tmatter = T2.mmatter
AND T0.ttk = T3.tkinit
AND (T0.tinvoice  = 599793
AND T0.tbillhrs  <> 0.00
 )ORDER BY 1, 2, 3, 4, 5

tbillhrs is defined at a DECIMAL in the original table.

When I run it from dbaccess the data in the unload table appears like this:
10/31/2001|MRM|150.0|-0.48||Less 10% Discount|3602078|1|5893013|

When I run this from a 4gl command the data in the unload table appears like
this:
10/31/2001|MRM|150.00000000|-||Less 10% Discount|3602078|1|5893013|
and then of course when I try to reload it, I get "Character to numeric
conversion error" because the data is a - (dash) instead of -0.48



Mon, 12 Jul 2004 01:06:10 GMT
 4gl & SQL



Quote:
>Why does the same sql statement performed in 4GL command and dbaccess give
>two different results?

>UNLOAD TO "legaltbl.unl"
>SELECT  T0.tworkdt, T3.tkinitb, T0.tbillrt,  T0.tbillhrs, T0.tudef2,
>T1.tddesc, T1.tindex, T1.tdline, T1.tdindex
>FROM timecard T0, timedesc T1, matter T2, timekeep T3
>WHERE T0.tindex = T1.tindex
>AND T0.tmatter = T2.mmatter
>AND T0.ttk = T3.tkinit
>AND (T0.tinvoice  = 599793
>AND T0.tbillhrs  <> 0.00
> )ORDER BY 1, 2, 3, 4, 5

>tbillhrs is defined at a DECIMAL in the original table.

>When I run it from dbaccess the data in the unload table appears like this:
>10/31/2001|MRM|150.0|-0.48||Less 10% Discount|3602078|1|5893013|

>When I run this from a 4gl command the data in the unload table appears like
>this:
>10/31/2001|MRM|150.00000000|-||Less 10% Discount|3602078|1|5893013|
>and then of course when I try to reload it, I get "Character to numeric
>conversion error" because the data is a - (dash) instead of -0.48

OS and versions? Dopey mare! :)


Mon, 12 Jul 2004 04:44:20 GMT
 4gl & SQL

Quote:

>Why does the same sql statement performed in 4GL command and dbaccess give two different results?

>UNLOAD TO "legaltbl.unl"
>SELECT  T0.tworkdt, T3.tkinitb, T0.tbillrt,  T0.tbillhrs, T0.tudef2,
>T1.tddesc, T1.tindex, T1.tdline, T1.tdindex
>FROM timecard T0, timedesc T1, matter T2, timekeep T3
>WHERE T0.tindex = T1.tindex
>AND T0.tmatter = T2.mmatter
>AND T0.ttk = T3.tkinit
>AND (T0.tinvoice  = 599793
>AND T0.tbillhrs  <> 0.00
> )ORDER BY 1, 2, 3, 4, 5

>tbillhrs is defined at a DECIMAL in the original table.

>When I run it from dbaccess the data in the unload table appears like this:
>10/31/2001|MRM|150.0|-0.48||Less 10% Discount|3602078|1|5893013|

>When I run this from a 4gl command the data in the unload table appears like this:
>10/31/2001|MRM|150.00000000|-||Less 10% Discount|3602078|1|5893013|
>and then of course when I try to reload it, I get "Character to numeric
>conversion error" because the data is a - (dash) instead of -0.48

You get different results because the UNLOAD function is implemented differently for ISQL and I4GL.  It would appear that there is a bug in the I4GL version you are using, and as OTC pointed out, you don't really give us any clue as to platform or version.

--

Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>



Mon, 12 Jul 2004 13:56:46 GMT
 4gl & SQL
Cripes, I thought I was world renown for using WindowsNT (4) and 7.30.TC9X2.
EPP Compiler Version 2.02.01 Geez, you guys want to know so much personal
information...:-)

Also...it takes one to know one!



Quote:


> >Why does the same sql statement performed in 4GL command and dbaccess
give
> >two different results?

> >UNLOAD TO "legaltbl.unl"
> >SELECT  T0.tworkdt, T3.tkinitb, T0.tbillrt,  T0.tbillhrs, T0.tudef2,
> >T1.tddesc, T1.tindex, T1.tdline, T1.tdindex
> >FROM timecard T0, timedesc T1, matter T2, timekeep T3
> >WHERE T0.tindex = T1.tindex
> >AND T0.tmatter = T2.mmatter
> >AND T0.ttk = T3.tkinit
> >AND (T0.tinvoice  = 599793
> >AND T0.tbillhrs  <> 0.00
> > )ORDER BY 1, 2, 3, 4, 5

> >tbillhrs is defined at a DECIMAL in the original table.

> >When I run it from dbaccess the data in the unload table appears like
this:
> >10/31/2001|MRM|150.0|-0.48||Less 10% Discount|3602078|1|5893013|

> >When I run this from a 4gl command the data in the unload table appears
like
> >this:
> >10/31/2001|MRM|150.00000000|-||Less 10% Discount|3602078|1|5893013|
> >and then of course when I try to reload it, I get "Character to numeric
> >conversion error" because the data is a - (dash) instead of -0.48

> OS and versions? Dopey mare! :)



Tue, 13 Jul 2004 22:43:24 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. 4GL & SQL Forms

2. US- INFORMIX 4GL Arkansas informix 4GL, informix 4GL, informix 4GL, informix 4GL, informix 4GL, informix 4GL,

3. Informix 4.0 4gl & Sql on SCO Openserver 5.0

4. 4GL-RDS & 4GL-ID Version mismatch

5. Accessing 4GL cursors with prepared & executed SQL

6. SQL & ABF 4GL

7. 4GL *** UPSHIFT Function for 4GL available *** 4GL

8. Oracle*&SQL*Plus 8.0/Net8 versus Designer&SQL*Plus 3.x/SQL*Net

9. CGI & 4GL related

10. Deadlocks with Online & 4GL

11. Informix 4GL & status variable

12. FW: 4GL compile & rsqbreak.c


 
Powered by phpBB® Forum Software