Page 1 of 1

ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Mon 04 Nov 2013 09:50
by Brob
Hi

When using ODBC provider I get this error when trying to insert or update a value in a timestamp field.

"[DataDirect][ODBC Progress OpenEdge Driver]Timestamp parameters with zero scale must have a precision of 13, 16, or 19. Parameter number: 1, precision: 0."

I can use an ODBC parameter "WorkArounds2=2" to stop this but WorkArounds2 partameter is needed to for another problem using a different value and also I don't want my customer to have to put this on every computer.

Is there any way I stop this error? Maybe using Data Type Mapping Rules?

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Mon 04 Nov 2013 13:38
by AlexP
Hello,

Please open access to server again, in order for us to try to reproduce the problem.

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Mon 04 Nov 2013 14:25
by Brob
Hello Alex
Connection details sent to your email

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Tue 05 Nov 2013 09:40
by AlexP
Hello,

There is no DATE_ADDED field in the PUB.ORT_REPORTS table, there is a DATE_CREATED field only, and I get a 'permission denied' error when attempting to modify it. Please clarify the table and the field, and check the access privileges.

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Tue 05 Nov 2013 10:00
by Brob
Sorry Alex
Forgot to grant you insert, update, delete on this table.
As you say the field is DATE_CREATED.

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Wed 06 Nov 2013 08:57
by AlexP
hello,

Thank you for the information - we have reproduced the described situation. This behaviour is due to the specificity of the ODBC driver. In the MSDN documentation http://msdn.microsoft.com/en-us/library ... s.85).aspx it is claimed that the ColumnSize parameter and DecimalDigits are ignored in the SQLBindParameter method for SQL_TIMESTAMP types. However, the driver you are using (in contrast to the documentation) requires setting the ColumnSize parameter for this type. To solve the problem, you can either use the WorkArounds2=2 ODBC parameter or, if you have an edition with source code, we can tell the required modifications for setting a value for this parameter.

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Wed 06 Nov 2013 09:34
by Brob
Many thanks for investigating this problem for me.
I am upgrading to UniDAC edition with source code so if you could please send me the details of where to change the code that would be great.

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Wed 06 Nov 2013 10:06
by AlexP
Hello,

To solve the problem, you should modify the TODBCCommand.DetectDataType method in the ODBCClassesUni.pas module as follows:

replace

Code: Select all

    SQL_TYPE_TIMESTAMP, SQL_TIMESTAMP: 
      DataType := dtDateTime;
with

Code: Select all

    SQL_TYPE_TIMESTAMP, SQL_TIMESTAMP: begin
      DataType := dtDateTime;
      Length := SQLLength;
    end;

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Wed 06 Nov 2013 10:09
by Brob
As always you came up a solution.
Thanks again.

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Fri 08 Nov 2013 13:17
by AlexP
Hello,

If you have any other questions, feel free to contact us

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Tue 11 Feb 2014 12:29
by Brob
Hi Alex

Is there any possibility that a specific option could be added in the future for the connection or dataset objects to the deal with this problem?

Re: ODBC Provider Error - Timestamp parameters with zero scale must have.......

Posted: Wed 12 Feb 2014 14:36
by AlexP
As I wrote earlier, this problem is due to the driver you are using and it doesn't occur in any other ODBC driver. Unfortunately, we cannot add separate options for each specific driver, specification of which differs from the MSDN specification. Therefore you should either use the recommendations of your driver developer: use the WorkArounds2=2 ODBC parameter, or edit our code.