Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASCRead - pblm with the TYPE parameter #1118

Closed
gpetit opened this issue Sep 17, 2020 · 4 comments
Closed

ASCRead - pblm with the TYPE parameter #1118

gpetit opened this issue Sep 17, 2020 · 4 comments
Labels
Milestone

Comments

@gpetit
Copy link
Contributor

gpetit commented Sep 17, 2020

When using the type parameter in the ASCRead function I have a problem. If I execute

CALL ASCREAD('/home/gpetit/dem.asc', 1);
-- or
CALL ASCREAD('/home/gpetit/dem.asc', 'myDEMTable', 1);

In both cases, I have this error message

Please use 1 for integer or 2 for double conversion; SQL statement:

After investigation, it seems that the problem come from this line

since ValueInteger is a Java object that can not been compared to an integer (cf if (zType != 1 || zType != 2) line 94)

@ebocher @nicolas-f

@gpetit gpetit added the bug label Sep 17, 2020
@gpetit gpetit added this to the H2GIS 2.X milestone Sep 17, 2020
@nicolas-f
Copy link
Member

The issue here is the boolean condition
For an error to be thrown condition A or condition B must be true
A is true if zType is not equal to 1
B is true if zType is not equal to 2

So zType must be equal to 1 and equal to 2 to not throw an error. This will be difficult.

The real test is:

if (!(zType == 1 || zType == 2)) {

or

if (zType < 1 || zType > 2) {

@ebocher
Copy link
Member

ebocher commented Sep 18, 2020

Done thanks

@ebocher
Copy link
Member

ebocher commented Sep 24, 2020

Done here #1120

@gpetit
Copy link
Contributor Author

gpetit commented Sep 24, 2020

Nice. Thx

@gpetit gpetit closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants