Skip to Content
avatar image
Former Member

XML Datatype

I need to save a xml file into a SQL database, but I can't create a field of XML datatype by B1. Do you have any suggestion on how can I save this file. I don't want to use ntext because it will be obsolete in the future. Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 30, 2014 at 01:14 PM

    Hi Danilo

    It depends what you need it for. If you just want to be able to find your xml based on a value in an UDF you can try to store XML in file system and put just a path in your field. Or you can set a field to type 'link' and link your XML as an attachment to your object. Or you can create your own table in database with let's say two fields (one id identity(1,1), second xml XML) and put only value of id in SAP's UDF.

    Kind regards,

    Radek

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Radoslaw,

      For this situation I really need to save the whole file in database, not the path, I'm not sure if I can create a table without using UTB and UDF

  • Dec 30, 2014 at 04:21 PM

    Hi Danilo,

    imho you should use a ntext field. The only argument against is that in future versions of MSSQL this type is not supported anymore. But right now it is and SBO is using ntext for its memo fields.

    So basically it is a problem of SAP to make sure, future versions of MSSQL can be used ( planned ?? )  and when upgrading ntext fields that they are converted to nvarchar.

    I really can't imagine SAP saying : so far you were able to save big texts in a field, now we will cut all the data.

    regards,

    Maik

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 31, 2014 at 01:49 AM

    Hi Danilo,

    It depends on whether you are storing the content of the file or the file it self.

    If you are storing the xml content only, i would go with what @Maik Delly  has suggested.

    But if you need to store the file it self, I would recommend you to keep your own table so you can set your own data type either varbinary or image or xml with a RecordID for each file.

    You will then store this RecordID in  related SBO table UDF.


    Regards

    Edy

    Add comment
    10|10000 characters needed characters exceeded