Oracle Objects for OLE C++ Class Library
Release 9.0.1

Part Number A90172-01

Home

Book List

Contents

Master Index

Feedback

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


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents