Re: OCI question

From: Scott Urman <surman_at_dlsun338.us.oracle.com>
Date: 1996/07/30
Message-ID: <4tjl62$o4b_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <31fd4110.623604205_at_news.tncnet.com>, simonl_at_dataworks.com (Simon Lee) writes:
|>
|> Is it just me or does Oracle's OCI library suck? I'm writing an
|> application, and OCI doesn't even return the number of columns from a
|> query. Does anyone know how I can write a "fetch" function that after
|> given a SQL statement, I can call fetch(), which will retrieve any
|> results pending? The problem I have is trying to figure out how many
|> columns there will be, and to allocate memory for the define structure
|> per column, without losing performance.
|>

Use odescr(). It will tell you exactly what Oracle is planning on returning - each column, its datatype, and its size. You then allocate memory to hold this info and point to it using odefin(). Then fetch using ofen() or ofetch().

|> Any help very much appreciated.
|> -Simon Lee



Scott Urman Oracle Corporation surman_at_us.oracle.com

Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm

"The opinions expressed here are my own, and are not necessarily that of  Oracle Corporation"
Received on Tue Jul 30 1996 - 00:00:00 CEST

Original text of this message