Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

referencing a field in a recordset

Status
Not open for further replies.

mbames

Programmer
Jun 5, 2003
29
GB
Hi,

Is there a way that I can reference a field in a recordset via a number, rather than by its actual name?

eg. select id, name, age from people

then then I could access field(1) which would be the same as the 'name' field.

Cheers,
Matt
 
Hi,
Access it how?
In SqlPlus there is no recordset, so no...
( Except in the 'sort by' clause, maybe)
In asp,perl,php, etc. - probably yes..


Need more info about what you want to do...

[profile]
 
In general, the answer is YES (not for pure sql). But it may depend on tool you use. If you need it in pl/sql read about dbms_sql package.

Regards, Dima
 
I think that I have managed to resolve what I was trying to do. The background to this, was that when I insert a new record into a table, I wanted to be able to return the new autonumber field (currval from a sequence).

What I have done is written a package that does an insert and then returns me a recordset with the currval field in it.

I can post the code if anyone is interested.

Cheers,
Matt
 
You may use RETURNING clause.


Regards, Dima
 
The trouble was I needed to access this value in C++, and my DB <--> C++ skills on handling returns were not too good, but I know how to handle a recordset!

Cheers,m
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top