Subject Re: [firebird-python] fdb: conversion error from string (datetime value)
Author Pavel Cisar
Hi,


Dne 27.9.2012 00:10, Maximiliano Robaina napsal(a):
> Hi (again),
>
> Testing django-firebird I caught this error:
>
> Error while executing SQL statement:\n- SQLCODE: -303\n- Incompatible
> column/host variable data type\n- Dynamic SQL Error\n- SQL error code
> = -303\n- conversion error from string "2012-10-10 16:34:30.072356"',
> -303, 335544569)
>
> (BTW, I can found what -303 is)
>
> The sql statement is:
>
> INSERT INTO "DJANGO_SESSION" ("SESSION_KEY", "SESSION_DATA",
> "EXPIRE_DATE") VALUES ('239a187593169b5b12cac16fbb19032c',
> 'ZTliNzMyZTU4MWZkODI0ODg4ZTM5MzQ3Yzk4YzdlYmQ4ODkzNWE0ODqAAn1xAS4=',
> '2012-10-10 16:34:30.072356')
>
> Then, I run this sql on FlameRobin and I get a different error code:
> SQL Message : -413 Overflow occurred during data type conversion.
>
> Engine Code : 335544334 Engine Message : conversion error from
> string "2012-10-10 16:34:30.072356"
>
> So, two questions:
>
> 1. What is the real error code -413 or -303?

Both :-) You must realize that in FlameRobin, you send to server the
whole command as one string, while in FDB (I'm sure) you used
parameters. The error is discovered by different layers, so error code
is different. Why they're different when it's basically the same thing?
Probably an artifact of Firebird's code evolution.

> 2. What is the best approach to resolve this? Replaces 6 digits
> microseconds to 4 digits allowed in Firebird?

Most likely.

best regards
Pavel Cisar
IBPhoenix