Show TOC

Automatic PublishingLocate this document in the navigation structure

Use the SybaseRTP add-in function when the data in a cell changes

SybaseRTP is a wrapper function around the underlying Excel real-time data mechanism used for publishing data. The syntax for this formula is:

=SybaseRTP("ConnectionName","StreamName","OperationCode",DataRange,
[[ColumnRange],[TransposeRows],["LogFile"],[InstanceNo],[NoResults])]

where:

Parameter Description
ConnectionName Name of the connection to use for publishing. You must establish the connection before you can publish successfully.
StreamName Name of the stream where data is published.
OperationCode The opcode for publishing INSERT, UPDATE, DELETE, or UPSERT.
DataRange The address or name of the Excel range containing the data to publish. Do not enclose the DataRange object in double quotes.
[ColumnRange] (Optional) The Excel range address or range name containing the stream column names. Do not enclose this parameter in quotes.
[TransposeRows] (Optional) Whether the data record is specified in a column instead of a row. It can be either true or false (the default).
[LogFile] (Optional) The name and location of the log file to which any errors are logged. If not provided, no logging is done.
[InstanceNo] Internal use only; leave empty.
[NoResults] Internal use only; set to false or leave empty.

For example:

=SybaseRTP("Connection1","Trades","INSERT",A2:E10, A1:E1,False,"C:\logs\log1.log",,)

You can place this formula in any sheet in the workbook. When constructing the formula, tell Excel the workbook or worksheet to which the address refers either by selecting the appropriate cells in the desired worksheet or using the [Workbook]Worksheet!A1:E5 format.

Once the formula is in Excel, any changes made to any of the cells publishes the entire range. To publish only when certain cells are changed, use a call inside a custom wrapper that encapsulates the business logic that dictates when to call this function.

The return value for this function is an array that is formatted as a string using an Excel-style location: {{val11,val12},{val21,22}....}. You can then convert this formula into an Excel-style array object. The string contains one or more array of elements, and each subelement contains two subitems. The array string contains only one element when there are errors passed in values. Otherwise, it contains one more element than the number of rows to publish.

The first element in the array string is a summary that indicates whether errors are detected when parsing the formula, a one-element array of the form is returned; for example:
{{"1","Some error message."}}

If there are errors during record validation, or if the process is completed successfully, there is one more array element than the number of rows to publish. For example, if there are two rows to publish and both the records have been successfully published, the array string looks like the following example:

{{"0",""},{"0",""},{"0",""}}

If only one record was published successfully, and another failed, then the return array string looks like this:

{{"1","An error message"},{"0",""},{"1","row level error message"}}