602SQL Documentation Index  



mixed wb_export_to_XML_buffer( resource connection, string dad_ref, resource cursor [, array hostvars] )


Identifier of the open connection, returned by the wb_connect or wb_pconnect function.
Pointer to the Data Access Definition (DAD).
Identifier of an open cursor or the NULL PHP constant.
An array with the client variable descriptions. Optional parameter.

Since version



This function exports data specified in the DAD to the XML format as a text string. This string is returned as a result of this function. In the case of an analytical DAD, the data source is fixed by the DAD description, therefore set cursor = NULL. In the case of a syntactical DAD you may use the DAD description, then set cursor = NULL or use redirecting to an open cursor of the same structure (set the PHP identifier of this cursor in the curs parameter, the result of the wb_exec or wb_psql_execute function that opened the cursor).

The dad_ref may have two forms: object_name prefixed with an asterisk (*object_name), then the transfer type object is searched for in the DAD of the opened application, otherwise the DAD definition is read from this parameter.

If the DAD is designed to a ODBC Data Source, then this ODBC connection must be open using the wb_odbc_connect fuction in advance. If the DAD is designed to a different 602SQL server, then this different connection must be open using wb_connect function in advance.

The hostvars array allows you to pass the PHP application client variables that may be used in the query specified as the data source in DAD as variables bound to some element of the DAD. If you do not use these variables, either omit the hostvars parameter, or set the PHP constant to NULL. The format of client variable descriptions is specified here.


Returns the string of the XML document that contains the exported data if successful, otherwise it is FALSE.



To read data from MySQL server (ODBC Data Source to the MySQL table is registered as MySQL test) and to assign them to a string variable.

  $odbc_resource=wb_odbc_connect("MySQL test","admin","password") or die("MySQL odbc connect failed");
  $resXML = wb_export_to_XML_buffer($connection,$dad,NULL,NULL) or die("export from MySQL to XML failed");