Statement macro
Considers dbms to be the DBMS in use throughout body.
with-dbms(dbms) body end [with-dbms]
<dbms>.
sql
sql
Considers dbms to be the DBMS in use throughout body. If you apply make to any of the classes <user>, <database>, or <sql-statement> in body, this macro creates an instance of the subclass suitable for dbms. This means you can write code in body that does not refer to a specific DBMS type, making it easier to write inter-DBMS applications. For example, you can write this:
let dbms = make(<odbc-dbms>); with-dbms(dbms) let user = make(<user>, name: "foo", password: "bar"); let db = make(<database>, datasource-name: "db.world"); let connection = connect(db, user); ... end with-dbms;
Instead of writing this:
let dbms = make(<odbc-dbms>); let user = make(<odbc-user>, name: "foo". password: "bar"); let db = make (<odbc-database>, datasource-name: "db.world"); let connection = connect(db, user, dbms: dbms); ...