GET

You can use the GET function to retrieve data using one of the source adapters, such as a messaging system, a database, a file, and so forth, within the course of your map.

When the GET function is used in a map, the default OnSuccess action is adapter specific. The default OnFailure action is to rollback any changes made during map processing. The default Scope will be integral unless the map is defined to run in bursts (which is the case when one or more inputs have the FetchAs property set to Burst).

GET can also be used for adapters that support request and reply, such as Socket.

Syntax:

GET (single-text-expression , single-text-expression
[ , single-text-expression ])

Meaning:

GET (adapter_alias, adapter_commands
[ , data_request_to_send_to_adapter ])

Returns:
A single character text item

GET returns the data that is returned by the source adapter. The adapter identified by adapter_alias is called using the specified adapter_commands and passing data_request_to_send_to_adapter as data to the adapter. See the Resource Adapters documentation

You cannot use the GET function to retrieve a file that was built by an earlier output card within the same map. Instead, map the output of the earlier card to the later card.

To identify whether the function was successful, you can generally use the VALID function with the GET function. However, for certain adapters such as E-mail and FTP, the success state is not known until after map completion and using the VALID function in such cases might consistently return "success".

Examples

  • Reply (s) = GET ("SOCKET", "-HOST localhost -PORT 8015 -EOF -LSN 10 -T", PACKAGE (Request Object:.:Input))

    In this example, the GET function would connect to the socket-based server on localhost using port 8015. The Socket Adapter would submit the "Input" data to the server, and then wait up to 10 seconds for a reply to that message.

  • Acct# = GET ("DB" , "-dbtype ORACLE -connect shasta -user rjc -pw vm70" + "SELECT Acct# FROM CustMaster WHERE CustID = '" + SenderID Field:Identification Segment:Msg + "'")

    In this example, the GET function could be used instead of a DBLOOKUP or DBQUERY function to retrieve data from a database from within in a map rule.

Related functions

  • FAIL
  • LASTERRORCODE
  • LASTERRORMSG
  • PUT
  • VALID