Use this function to retrieve data from a flat file or XML extract file.
Note | The SrchData function, released in version 11.1 and included in version 11.0, patch 32, lets you include spaces in the search criteria, whereas the GetData function does not. Here is an example: |
SrchData("11,HEADERREC,21(A,B, ,D)", 40, 20)
SrchData("'!/XML/Form[@form="PP 03 02"]/@form", 1,10)
Note | Note the space between A,B, ,D and PP 03 02.The ability to include spaces in search criteria is important when you are using XML XPaths. |
Use this function during Documaker Server processing, after the extract file has been loaded — after the LoadExtractData rule has been run.
Note |
DAL internally manages Unicode strings using UTF8, which is a standard mechanism for handling Unicode string data. The GetData function will use this method if the extract file data is defined as XML. See the Unicode Guide for more information. |
GetData (SearchMask, Occurence)
Parameter |
Description |
SearchMask |
Enter the criteria that defines what data you want the system to look for. Format the search mask as shown here: "extract search mask offset, length" |
Occurrence |
This parameter lets you specify which occurrence of the data to get. The default is the first occurrence. |
The system returns the data from the extract file based on the search mask.
Here is an example:
GetData( "11,HEADEREC 40,17")
In this example, the GetData function finds the extract record designated by "11,HEADEREC" and returns the data at offset 40 for a length of 17. The GetData function does not format the data.
You can use an occurrence variable to get the Nth iteration of the data. Enter one (1) to return the first record, two (2) to return the second, and so on. Here is an example:
GetData("11,NAMEREC 40,17", 2);
This example finds the second record designated by "11,NAMEREC" and returns the data from offset 40 for a length of 17.
Here is an example that gets data from an XML extract file:
value = Trim (GetData ("!Diamond/Data/Client/Accounts/Account/Policies/Policy/PolicyImages/PolicyImage/premium_fullterm 1,7") );
If Trim (GetData ("!Diamond/Data/Client/Accounts/Account/Policies/Policy/PolicyImages/PolicyImage/premium_fullterm 1,7") ) = "2549" Then;
Return ("equal - " & GetData ("!/descendant::Personalauto/child::Vehicles/child::Vehicle[**vehovfsym**]/vehicle_num 1,2")
Else Return ("not equal - " & value)
End;
In this example, the GetData function checks to see if the specified XML extract record equals 2549, if it does, the function returns the string: equal - concatenated with the value from another XML extract record. If not, it returns the string: not equal - concatenated to a value from a different XML extract record.
© Copyright 2014, Oracle and/or its affiliates. All rights reserved. Legal notices.