f2s_schema_name

Applies to: Oracle, MS SQL

Syntax

set_attribute f2s_schema_name of {DriverID} to {variable}
get_attribute f2s_schema_name of {DriverID} to {variable}

Parameter

Description

DriverID

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

variable

String variable with the name of the schema being used to open tables. The default schema is the one for the current user.

Description

Getting this attribute returns the name of the schema currently being used to open tables. Setting this attribute sets the name of the schema used to open tables.

Note

  • Setting this attribute to a schema that does not exist on the database will not throw an error. That will happen when you try to open the table. Setting this attribute does NOT create a schema on the server.

  • Setting this attribute will NOT override the SCHEMA_NAME token in the .int file. In other words, this attribute does NOT work if the SCHEMA_NAME token is defined in the .int file.

  • This is similiar to the attribute f2s_pg_namespace for PostGres. f2s_schema_name is for Oracle and MS SQL.

Examples

get_attribute

string sSchema

get_attribute f2s_schema_name of _f2s_Active_DriverId to sSchema

set_attribute

In this example, the tables in VDF Order Entry have been converted to MSSQL. The table Production.Users has been added to the database. It has the same structure as dbo.Users (dbo being the default schema) but has different data.

 String sName sFirstName

 get_attribute f2s_schema_name of _f2s_Active_DriverId to sName

 Send Clear to oUsers_DD
 Send Find to oUsers_DD GE Index.1
 Showln (SFormat("The first name in users for schema %1 is %2.",sName, Users.Full_Name))

 //close the table so it can be openned using the new schema
 Close Users

 set_attribute f2s_schema_name of _f2s_Active_DriverId to "Production"
 get_attribute f2s_schema_name of _f2s_Active_DriverId to sName

 //open the table using the new schema
 Open Users
 Send Clear to oUsers_DD
 Send Find to oUsers_DD GE Index.1
 Showln (SFormat("The first name in users for schema %1 is %2.",sName, Users.Full_Name))

 //close the table so it is set back to its default
 Close Users

 //reset the schema to the original
 set_attribute f2s_schema_name of _f2s_Active_DriverId to "dbo"
 Open Users

This will show:

The first name in users for schema dbo is John Doe.
The first name in users for schema Production is Jane Fox

Replaces