Next Previous Up Top Contents Index

1.2.5 Connection protocol functions, methods, and macros

with-dbms

Statement macro

Summary

Considers dbms to be the DBMS in use throughout body.

Signature

with-dbms(dbms) 
  body 
end [with-dbms]

Arguments

dbms
An instance of <dbms>.

Library

sql

Module

sql

Description

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);
...

OLE, COM, ActiveX and DBMS Reference - 31 MAR 2000

Next Previous Up Top Contents Index