f2s_esql_server¶

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

set_attribute f2s_esql_server of {DriverID} to {server}
get_attribute f2s_esql_server of {DriverID} to {server}

Parameter

Description

DriverID

The ID of the driver for which this applies. In most cases, you should use _f2s_ActiveDriverID.

server

String, name of the server to get/set

Description

Setting this attribute specifies which server to use for embedded SQL statements. Getting this attribute returns the name of server being used by embedded SQL statements. By default, the last logged in server is used. This command is only needed when connecting to multiple servers (or multiple server instances). If no connection has yet been made to any server, getting this attribute will return an empty string.

Examples

get_attribute

string sServer

get_attribute f2s_esql_server of _f2s_ActiveDriverID to sServer

set_attribute

f2s_esql_create_stmt "select * from orderhea where SalesPerson_ID = ?"
f2s_esql_prepare_stmt
f2s_esql_set_param 1 to "SM"
f2s_esql_execute_stmt
f2s_esql_get_row vRowServerA
f2s_esql_close_stmt

// Now let's switch to the second server (we're already logged into) and do the same query there
set_attribute f2s_esql_server of _f2s_ActiveDriverID to "ServerB"

f2s_esql_create_stmt "select * from orderhea where SalesPerson_ID = ?"
f2s_esql_prepare_stmt
f2s_esql_set_param 1 to "SM"
f2s_esql_execute_stmt
f2s_esql_get_row vRowServerB
f2s_esql_close_stmt

Related Attributes

Replaces: Commands GET_CURRENT_SQL_SERVER_CONNECTION and SET_CURRENT_SQL_SERVER_CONNECTION