Returning data to a client

An application can return text or image data inside of any event handler that can return row results. An application processes outgoing text or image data in several different steps, depending on how many columns are in the data row. If there is just one column, and it is a text or image column, the application takes the following steps:

  1. It describes the format in which the client will receive the text or image column, using srv_descfmt.

  2. It calls srv_text_info with cmd set to CS_SET to provide the total text length.

  3. It calls srv_send_text to send the data to the client in chunks.

If there are other columns in addition to the text and image column or columns, the application must take the following steps:

  1. It describes the format in which the client will receive the data using srv_descfmt, which is called once for each column.

  2. It describes the format and location of the local program variables in which the Open Server application stores the information, using srv_bind, which must be called once for each column.

  3. It provides text pointer and timestamp information by calling srv_text_info, which must be called once for each text or image column, with cmd set to CS_SET.

  4. Transfer the data using srv_xferdata, which must be called as many times as there are rows.

See “Processing parameter and row data” for details on partial update of text and image columns.