# db_select

Definition: | integer i = db_select(string st)
Description: | Choose a new, already open, database to be the current database. Subsequent database operations will apply to this database. st is the path of the database file as it was originally opened with db_open() or db_create(). The return code, i, indicates success (DB_OK) or failure.
pwa/p2js: | Not supported
Comments: | When you create (db_create) or open (db_open) a database, it automatically becomes the current database. Use db_select() when you want to switch back and forth between open databases, perhaps to copy records from one to the other. After selecting a new database, you should select a table within that database using db_select_table().
Example: |
    if db_select("employees") != DB_OK then
        puts(2, "Couldn't select employees database\n")
    end if
See Also: | db_open