SQLBaseCommand

Discussion forum about all things SqlBase.
Mide

SQLBaseCommand

Post by Mide » 26 Nov 2015, 15:55

When using SqlBaseCommand ExecuteNonQuery() strange thing hapens.

Lets consider this sql

Code: Select all

INSERT INTO someTable (col1, col2) SELECT col1, col2 FROM someTable WHERE dateColumn BETWEEN 26.11.2015 AND 27.11.2015
After executing ExecuteNonQuery() I recieve error and the couse is that ExecuteNonQuery change CommandText into

Code: Select all

SELECT col1, col2 FROM someTable WHERE dateColumn BETWEEN 26.11 .2015 AND 27.11 .2015
notice space after 26.11 and 27.11

Same aply to ExecuteScalar() (of course different sql text but using BETWEEN and hard coded dates)

Am I missing something ?

Using parameters works ok, but I'm porting old application to SqlBase 12 and have things like this all over the place.

Thank you.

FRBhote
India
Posts: 2176
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SQLBaseCommand

Post by FRBhote » 27 Nov 2015, 06:00

AFAIK Sqlbase does not accept dd-MM-yyyy format. Change it to yyyy-MM-dd and see?

Mide

Re: SQLBaseCommand

Post by Mide » 27 Nov 2015, 07:44

8.5 accept and application was made with this version and is working with no problems.

I can change inline text to use SqlBaseParameter (which is working) but that's a lot of work.

Thank you

Mike Vandine

Re: SQLBaseCommand

Post by Mike Vandine » 03 Dec 2015, 06:35

Hi,

Can you give me a small project example against the ISLAND database that I can give to Development?

Thanks!

Mide

Re: SQLBaseCommand

Post by Mide » 08 Dec 2015, 08:03

Mike thanks for interest.

I took "sneak a peak" and FRBhote is right. .NET driver is now accepting only en-US format for inline dates (yyyy-MM-dd). I don't know in which version is this changed, but I'll have to live with it.

I've already changed all my format strings to parameters.

PS Inline text with format dd.MM.yyyy definitely worked in driver version 9.01.

Thank you

Mike Vandine

Re: SQLBaseCommand

Post by Mike Vandine » 11 Dec 2015, 05:04

Hi Mide,

Hmmmm. I'm going to get someone from Dev to comment on this one too.

Best regards,

dosborne

Re: SQLBaseCommand

Post by dosborne » 15 Dec 2015, 00:28

That's a bug.
During the transition to fully managed code, the parsing code was revamped, and is now based on TD.NET.
By inspection, this might also affect TD.NET (and TD Mobile).

As a workaround, you can surround the date in single quotes, which will force it to be a literal and bypass the buggy parsing.

UPDATE: This has been fixed and will be available publicly in the next service pack.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests