Store XML file

17 views
Skip to first unread message

nikosv

unread,
Apr 21, 2022, 4:49:25 PMApr 21
to
I have an XML file and want to store it in a table.Which data type should I choose?

Roy Hann

unread,
Apr 22, 2022, 4:48:10 AMApr 22
to
nikosv wrote:

> I have an XML file and want to store it in a table.Which data type
> should I choose?

Depending on the potential size of the file I'd choose VARCHAR if I
could be confident I could declare it big enough. A VARCHAR can be up to
32kb if your page size is sufficient. I'd modify the table WITH
COMPRESSION=(DATA).

If my files might be too big for an ordinary VARCHAR then I'd go for
LONG VARCHAR which has a 2Gb limit. They are not so convenient to use
though. You may end up having to deal with data handler routines and
they are harder to use in WHERE clauses.

Roy

nikosv

unread,
Apr 22, 2022, 8:22:48 AMApr 22
to
thanks Roy.the file is less than 32K so varchar would be fine.
As a side note,why doesn't Ingres support the native XML type?

Roy Hann

unread,
Apr 22, 2022, 11:02:57 AMApr 22
to
nikosv wrote:

> thanks Roy.the file is less than 32K so varchar would be fine.
> As a side note,why doesn't Ingres support the native XML type?

Could you use JSON instead? Ingres has fairly extensive support for
JSON.

https://docs.actian.com/actianx/11.2/index.html#page/SQLRef/Working_with_JSON_Data.htm#

Roy

nksvg

unread,
Apr 22, 2022, 4:08:23 PMApr 22
to
that would be ideal but the file is coming from a SOAP based web service
so I'm stuck with XML
Reply all
Reply to author
Forward
0 new messages