Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

Part Number B10119-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

CanUpdate Method

Applies To

ODynaset

Description

This method returns TRUE if the ODynaset is updatable.

Usage

oboolean CanUpdate(void) const

Remarks

Depending on the SQL statement that is used to Open or Refresh the ODynaset, it may or may not be possible to make changes to the dynaset. Several factors can make a dynaset non-updatable:

· The SQL statement may contain fields that are not database table columns (for example, computed fields or fields whose names have been aliased).

· The SQL statement may reference columns in more than one database field (a join).

· The user may not have privileges to update the table the dynaset is on.

· The dynaset may have been opened with the ODYNASET_READONLY option.

Note that even if the SQL statement references only a single view, the dynaset will not be updatable if that view is created by way of a join, computed columns, or aliased columns.

Return Value

TRUE if the dynaset is updatable; FALSE if not.

Example

Here are examples of dynaset updatability.

// we assume the existence of an open ODatabase named odb

ODynaset dyn; // construct an ODynaset

// now open the ODynaset with various SQL statements

dyn.Open(odb, "select * from emp");

if (dyn.CanUpdate()) ; // is TRUE

dyn.Open(odb, "select sal*1.1 from emp");

if (dyn.CanUpdate()) ; // FALSE because of computed field

dyn.Open(odb, "select emp.ename, dept.dname from emp, dept \

where emp.deptno = dept.deptno");

if (dyn.CanUpdate()) ; // FALSE because of join