Am I able to use an indexer from PHP?
Posted: May 19th, 2007, 1:10 pm
The IDataReader interface allows an implementer to create an indexer for the implementation that is able to return a field value for a named field. In C# this might be:
string value = (string)reader"fieldname";
If a similar syntax is used in PHP Phalanger rightly warns that $reader is being used as an array and fails to return any value.
Of course in this example, the workaround is to use the GetOrdinal("field") and GetString($pos) methods of the reader class. This is a fairly cumbersome way to retrieve resultset values and the indexer will be much more elegant. What syntax should I use? Are indexers supported? I've looked through the PDF files and have been unable to see anything relating to indexers.
Edit: I've just see message 1617 which indicates indexers are TDB. Is this feature still to be done?
Bill Seddon
string value = (string)reader"fieldname";
If a similar syntax is used in PHP Phalanger rightly warns that $reader is being used as an array and fails to return any value.
Of course in this example, the workaround is to use the GetOrdinal("field") and GetString($pos) methods of the reader class. This is a fairly cumbersome way to retrieve resultset values and the indexer will be much more elegant. What syntax should I use? Are indexers supported? I've looked through the PDF files and have been unable to see anything relating to indexers.
Edit: I've just see message 1617 which indicates indexers are TDB. Is this feature still to be done?
Bill Seddon