Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


It is possible to select the connection to the database within the code using a dynamically created connect string… take the following code as an example for Oracle:

Code Block
DATABASE demo
MAIN
DEFINE username VARCHAR(255)
DEFINE passwd VARCHAR(255)
DEFINE server VARCHAR(255)
DEFINE connectStr VARCHAR(255)
#
LET server = dbserver --this is the name of your database server
LET connectStr = username CLIPPED,"/",passwd CLIPPED, "@",server CLIPPED
## the following line switches to the username and password specified..
## .. by forming the command 'DATABASE username/password@server'
DATABASE connectStr
END MAIN

You can use a full connect string (eg. user/password@server) with the DATABASE keyword allowing you to dynamically switch database users.

Related articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "db" and ancestor = "66289702"