dbTalk Databases Forums  

stricter type checking ?

comp.databases.ingres comp.databases.ingres


Discuss stricter type checking ? in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nikosv
 
Posts: n/a

Default stricter type checking ? - 04-07-2011 , 12:42 AM






more like a question out of scientific interest than pratical value
In each version it seems that more strict type checks are employed. I
met one condition on 9.2 and now I get another one on 9.3.1

INGRES REPORT Copyright 2009 Ingres Corporation
Reading report specifications and preparing query . . .
E_RW11F7 Arithmetic operands not the same data type and each cannot be
coerced to the data type of the other in header text for 'detail'.
Line with
error: 'let h_timh_xrewshs=timh_symb*(100.0+pt_fpa)/periektiko/
100.0'.
Processing continues . . .

E_RW100A 1 error(s) have occurred in setting up the report. No report
will
be written. Correct errors and rerun.

first of all hats off to the one who though of this error description!
it is really well set.
the issue is that the types of pt_fpa,timh_symb,periektiko are not
known until run time
since they come from the database being read from a select query :

select timh_symb = y.timh_symb, pt_fpa = y.pt_fpa,
periektiko = y.periektiko,

hence their types :

timh_symb decimal 16,4
periektiko integer 4
pt_fpa float

cannot be checked at compile time and that is why I get a runtime
error


'pt_fpa' has a float data type (it is not a scientific domain
application, but probably the type was chosen like that in the pre-
decimal era) ,
'timh_symb' has a decimal type and seems that a float cannot be
converted to a decimal implicitly, although it could in previous
versions

then trying to convert the float to decimal by :
timh_symb*(100.0+decimal(pt_fpa,16,4))/periektiko/100.0

gives :

INGRES REPORT Copyright 2009 Ingres Corporation
Reading report specifications and preparing query . . .
E_RW107E Too many arguments for function call or no closing
parenthesis in
header text for 'detail'. Line with error: 'let
h_timh_xrewshs=timh_symb*(100.0+decimal(pt_fpa,16, 4))/periektiko/
100.0'.
Error check continues . . .

E_RW100A 1 error(s) have occurred in setting up the report. No report
will
be written. Correct errors and rerun.


the solution was to assign the pt_fpa field to a variable of decimal
type and use that instead :
h_pt_fpa = decimal(16,4) not null

..let h_pt_fpa=pt_fpa
..let h_timh_xrewshs = timh_symb * (100.0 + h_pt_fpa) / periektiko /
100.0

which made the report run successfully

so why the design decision to have more strict type checking as each
version comes out?

Reply With Quote
  #2  
Old   
Ingres Forums
 
Posts: n/a

Default Re: stricter type checking ? - 04-07-2011 , 02:01 AM






This sounds like a bug as it should be possible to coerce a float into
decimal and vice versa.
Have you tested with version 10 yet?


--
Bodo

Reply With Quote
  #3  
Old   
nikosv
 
Posts: n/a

Default Re: stricter type checking ? - 04-07-2011 , 03:35 AM



On Apr 7, 10:01*am, Ingres Forums <info-
ing... (AT) kettleriverconsulting (DOT) com> wrote:
Quote:
This sounds like a bug as it should be possible to coerce a float into
decimal and vice versa.
Have you tested with version 10 yet?

--
Bodo
------------------------------------------------------------------------
Bodo's Profile:http://community.ingres.com/forum/member.php?userid=16
View this thread:http://community.ingres.com/forum/sh...ad.php?t=13194
unfortunately I have no version 10 installation

Reply With Quote
  #4  
Old   
Ingres Forums
 
Posts: n/a

Default Re: stricter type checking ? - 04-07-2011 , 06:00 AM



I just saw that this is actually not an error from the DBMS but from the
Report Writer, so this is probably rather a limitation of the Report
Writer here.
It works when doing the calculation as SELECT statement with 9.2.


--
Bodo

Reply With Quote
  #5  
Old   
nikosv
 
Posts: n/a

Default Re: stricter type checking ? - 04-07-2011 , 07:19 AM



On Apr 7, 2:00*pm, Ingres Forums <info-
ing... (AT) kettleriverconsulting (DOT) com> wrote:
Quote:
I just saw that this is actually not an error from the DBMS but from the
Report Writer, so this is probably rather a limitation of the Report
Writer here.
It works when doing the calculation as SELECT statement with 9.2.

--
Bodo
------------------------------------------------------------------------
Bodo's Profile:http://community.ingres.com/forum/member.php?userid=16
View this thread:http://community.ingres.com/forum/sh...ad.php?t=13194
I see.thanks for looking it up

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.