IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: Havardo
About
User Name: Havardo
Forum Rank: Newbie
Real Name:
Location UK
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Wednesday, July 13, 2016
Last Visit: Tuesday, December 5, 2017 3:43:36 PM
Number of Posts: 5
[0.03% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Disappearing User Functions :0
Posted: Tuesday, December 5, 2017 12:57:51 PM
I have use Mapforce for a few months now and have created a couple of shared Mapforce libraries with a selection of user functions. I typically will work with the libraries open alongside my project and add generic functions to these libraries when needed.

However, once in a while a number of functions just disappear out of the blue. The latest incident happened when the software crashed, but I also have had cases when I open a project and several function referrences are flaggesd "The function could not be found within the included libraries".

Does anyone else experience this? Is there anything to be done to avoid this?

Thanks in advance.
Topic: XML to MS SQL Mapping – Unquoted datatime values in output causing errors
Posted: Tuesday, September 12, 2017 2:34:52 PM
Thanks That,
The update works fine when I push the data to the database :)

With 100K+ records, I wanted to test a small subset of the output. I worked around it by filtering the records for testing.

PS: Newbie symptom, trying out different stuff.

Cheers :)
Topic: XML to MS SQL Mapping – How to convert Empty strings to NULL values
Posted: Monday, September 11, 2017 5:08:19 PM
I have a number of XML files and many elements contains empty strings, which ideally should be inserted as NULL values on the target database. The generated SQL inserts empty strings, which is very annoying.

The database is relatively large, so having to manually insert a function for every field is a lot of work.

Any tip would be highly appreciated.


PS: The XML did not include an XSD, but I have had that generated by MapForce.


Example
..(CAST('' AS nvarchar(255))), 1, (CAST('***' AS nvarchar(10))))

should be
... NULL, NULL)

OR
..NULLIF(('',CAST('' AS nvarchar(255)))), 1,NULLIF('',CAST('' AS nvarchar(10))))


Edit : I have for the time beeing fixed the issue with a user defined function workaround. But this approach will require a lot of extra work.

The SQL is also not very elegant :/

Example
..(CAST(NULL AS nvarchar(255))), 1, (CAST(NULL AS nvarchar(10))))



Topic: XML to MS SQL Mapping – Unquoted datatime values in output causing errors
Posted: Monday, September 11, 2017 5:05:06 PM
Hi,
When trying to map a XML to MS SQL Datatime, the datetime values in the generated output (INSERT statement) are without single quotes. This is syntactically incorrect. Is there a method to fix this?

Any tip would be highly appreciated.

Example (part of insert).
....(CAST('' AS nvarchar(255))), 1, (CAST('***' AS nvarchar(10))), 2002-05-31T12:55:28, (CAST('***' AS nvarchar(10))), 2002-09-10T14:20:53, (CAST('' AS nvarchar(100))

Should have been

....(CAST('' AS nvarchar(255))), 1, (CAST('***' AS nvarchar(10))), '2002-05-31T12:55:28', (CAST('***' AS nvarchar(10))), '2002-09-10T14:20:53', (CAST('' AS nvarchar(100))
Topic: Export to database. Is varchar(max) as default possible
Posted: Wednesday, July 13, 2016 9:59:47 AM
Hi,
I have some relatlivly complex XML data (several GB without schema). The generated SQL Server DDL us varchar(255) for most fields, which unfortunalty is insufficient for many, which is consequently followed by data truncation errors.

There are two workarounds I am familer with (both are time consuming).
1. Define a schema
2. manually fix the DDL and try again.

Is there another method of telling XMLSpy that default datatype for SQL Server varchar should be varchar(max) and not varchar(255)?

Any comments would be highly appreciated.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.