skip to main content

Embedded SQL Statements : SET CONNECTION

SET CONNECTION
The SET CONNECTION statement activates a specified connection.
General format
EXEC SQL [AT Database]
Syntax rules
1.
Connection-Name is a host variable or Nonnumeric Literal, as defined in the Definitions section of the Preface of this document.
2.
3.
General rules
1.
2.
Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement.
Examples
Switch from one connection to another when having one connection to an Oracle DB and other to a MySQL DB
if db-to-use = ora-db
   exec sql
     set connection ora-conn-1
   end-exec
   exec sql
     set connection mysql-conn-2
   end-exec

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left