I am trying to use BaseX to enter data from its XML db into an MS SQL server database, according to https://docs.microsoft.com/en-us/sql/connect/jdbc/using-basic-data-types?vie... the MS SQL server column type bigint is mapped to long in Java.
However, when I try
<sql:parameter type="long">{$id}</sql:parameter>
with BaseX and sql:execute-prepared, I get an error saying [sql:error] An SQL exception occurred: unsupported type: long
The BaseX documentation https://docs.basex.org/wiki/SQL_Module#sql:execute-prepared indeed only lists
attribute type { "int" | "string" | "boolean" | "date" | "double" | "float" | "short" | "time" | "timestamp" | "sqlxml" }
as the possible types. Am I out of luck trying to use BaseX that way for that datatype? Using <sql:parameter type="int">{$id}</sql:parameter> the sql doesn't succeed.
Hi Martin,
I have added "long" to the list of supported data types, as well as "byte" and "bigdecimal" [1]. I hope it works as expected. A new snapshot is available [2]; your feedback is welcome
Cheers, Christian
[1] https://github.com/BaseXdb/basex/commit/d3385eb787010d78a0a0176d84ca492ced76... [2] https://files.basex.org/releases/latest/
On Mon, May 31, 2021 at 4:05 PM Martin Honnen martin.honnen@gmx.de wrote:
I am trying to use BaseX to enter data from its XML db into an MS SQL server database, according to https://docs.microsoft.com/en-us/sql/connect/jdbc/using-basic-data-types?vie... the MS SQL server column type bigint is mapped to long in Java.
However, when I try
<sql:parameter type="long">{$id}</sql:parameter>
with BaseX and sql:execute-prepared, I get an error saying [sql:error] An SQL exception occurred: unsupported type: long
The BaseX documentation https://docs.basex.org/wiki/SQL_Module#sql:execute-prepared indeed only lists
attribute type { "int" | "string" | "boolean" | "date" | "double" | "float" | "short" | "time" | "timestamp" | "sqlxml" }
as the possible types. Am I out of luck trying to use BaseX that way for that datatype? Using <sql:parameter type="int">{$id}</sql:parameter> the sql doesn't succeed.
On 31.05.2021 18:01, Christian Grün wrote:
I have added "long" to the list of supported data types, as well as "byte" and "bigdecimal" [1]. I hope it works as expected. A new snapshot is available [2]; your feedback is welcome
Looks great, thanks a (put some bigint here) lot. Turns out my real data is not yet in shape for what I had planned but at least the long/bigint column insertion works fine.
basex-talk@mailman.uni-konstanz.de