dbGetPort#
Purpose#
Returns the database connection’s port number if it has been set.
Format#
- db_port = dbGetPort(db_id)#
- Parameters:
db_id (scalar) – database connection index number.
- Returns:
db_port (scalar) – the port number of the specified database connection.
Remarks#
dbGetPort() will only return the port number if it was previously set
with dbSetPort().
Examples#
// Add MySQL to the list of database connections
db_id = dbAddDatabase("MYSQL");
// Set the port number
dbSetPort(db_id, 3306);
// Retrieve and verify the port
port = dbGetPort(db_id);
print (port);