Oracle Objects for OLE C++ Class Library Release 9.2 Part Number A95896-01 |
|
Applies To
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));
|
Copyright © 1998, 2002 Oracle Corporation. All Rights Reserved. |
|