isClosed: Checks if a DBI connection is closed

Description Usage Arguments Value Author(s) See Also Examples

View source: R/isClosed.r

Description

Checks if a connection inheriting from the DBIConnection class (including 'ODB' connections) is closed.

Usage

1

Arguments

connection

An object inheriting from DBIConnection class.

Value

Returns a single logical value, whether SQL queries can be sent to the connection or not.

Author(s)

Sylvain Mareschal

See Also

odb.open, odb.close

dbConnect, dbDisconnect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  # New empty .odb file
  odbFile <- tempfile(fileext=".odb")
  odb.create(odbFile, overwrite="do")
  ODB <- odb.open(odbFile)
  
  # Is the connection closed ?
  print(isClosed(ODB))
  
  # Save changes in the .odb file
  odb.close(ODB, write=TRUE)
  
  # And now ?
  print(isClosed(ODB))

ODB documentation built on March 26, 2020, 7:46 p.m.