Skip Headers
Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 2 (10.2)

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

GetFieldOriginalName Method

Applies To

ODynaset

Description

This method returns the original field name in the "select" statement in the dynaset.

Usage

const char * GetFieldOriginalName(int fieldindex)

Arguments

fieldindex Field index of the original name of the field as it appears in the SQL .

Remarks

This method returns the original column name specified in the sql statement during dynaset

creation. This is property is useful when sql statement contains 'schema.table.col' as the 'name' of the field.

This enables duplicate col names to be referenced. Alternate way to avoid duplicate columns is to have alias specified in the SQL statement.

Return Value

A pointer to a string if successful; NULL if not.

Example

/ first, open an Odatabase

ODatabase odb("ExampleDB", "scott", "tiger");

// create and open a dynaset

ODynaset odyn;

odyn.Open(odb, "select scott.emp.deptno, dept.deptno from scott.emp, scott.dept where dept.deptno = emp.deptno");

//Now Display the Original Field name in the Messagebox, that is "scott.emp.deptno"
AfxMessageBox(odyn.GetFieldOriginalName(0));