R rohitbhoir New Member Apr 25, 2008 #1 Is there a way to select any working database using a query, and not via the data dictionary? (the database is already connected)
Is there a way to select any working database using a query, and not via the data dictionary? (the database is already connected)
S sphipp Member Apr 25, 2008 #2 If you create an alias DICTDB for the database then that selects the working database. You have to access the database tables in another program, though, as CREATE ALIAS doesn't apply to the current program. Code: CREATE ALIAS DICTDB FOR DATABASE mydb. /* For mydb database */ You can use a variable to store the database you want to select. Code: DEF VAR mydb AS CHAR INITIAL "sports2000" NO-UNDO. CREATE ALIAS DICTDB FOR DATABASE VALUE (mydb).
If you create an alias DICTDB for the database then that selects the working database. You have to access the database tables in another program, though, as CREATE ALIAS doesn't apply to the current program. Code: CREATE ALIAS DICTDB FOR DATABASE mydb. /* For mydb database */ You can use a variable to store the database you want to select. Code: DEF VAR mydb AS CHAR INITIAL "sports2000" NO-UNDO. CREATE ALIAS DICTDB FOR DATABASE VALUE (mydb).
TomBascom Curmudgeon Apr 27, 2008 #3 DICTDB is the alias for the default working database. You can either reassign that alias or you can fully qualify the elements of your query with database names: Code: for each dbname.tblname no-lock where dbname.tblname.fieldname = something: /* do something */ end.
DICTDB is the alias for the default working database. You can either reassign that alias or you can fully qualify the elements of your query with database names: Code: for each dbname.tblname no-lock where dbname.tblname.fieldname = something: /* do something */ end.
R rohitbhoir New Member Apr 28, 2008 #4 Thanx once again for your reply. found the alias one useful as i am taking the database name in a variable
Thanx once again for your reply. found the alias one useful as i am taking the database name in a variable