|
Rank: Member
Joined: 11/14/2011 Posts: 15 Location: Coeur D Alene, iD
|
Hello. I am sure there is an easy way to do this, I am just missing a step. I am exporting XML data to an SQL database. I have several fields, including Docket_ID where I only want to export records where the Docket_ID is like 40*.
I have tried inserting the 'Filter' and a Constant '40*', but getting errors and I'm sure this is incorrect. Can someone recommend what I should insert here to do this?
Thanks! bmacbmac attached the following image(s):
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Hi,
use an SQL WHERE component
|
|
Rank: Member
Joined: 11/14/2011 Posts: 15 Location: Coeur D Alene, iD
|
I tried using that, but my source data is XML and I am mapping/exporting to an SQL database. Can I use 'SQL Where' if my source data is XML? If so, I'll keep playing with it.
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
My mistake, I thought you were exporting from a database. You cannot use an SQL where if your source is an xml file.
The screenshot below makes the assumption that you you want to filter values that begin with 40 followed by 0 or more additional characters.
Using the match-pattern function you can filter the correct nodes accordingly.
File Attachment(s): test.zip (2kb) downloaded 803 time(s).
island attached the following image(s):
|
|
Rank: Newbie
Joined: 10/17/2016 Posts: 6
|
A bit more simply, there is a function called "starts-with". This allows you to check if the value starts with a given substring.
Just so you are aware, this is a string function, so your input value will be converted to a string, but it can do this implicitly so that poses no problem.
Also, using the regular expression the other poster provided would assume that your input value only has standard alphanumeric characters, so you would have to adjust it if you needed any symbols or accented characters. Using starts-with will avoid this potential issue altogether. If you had more complex requirements, match-pattern would be the way to go, but it's not strictly necessary in this case. :)
|
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Quote: Also, using the regular expression the other poster provided would assume that your input value only has standard alphanumeric characters, so you would have to adjust it if you needed any symbols or accented characters.
This is correct. To take account of non standard characters as well the following regex could be used with the match-pattern function.
|
|
guest |