1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SPI_fnumber</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="spi-interface-support.html" title="40.2.Interface Support Functions">
<link rel="prev" href="spi-spi-fname.html" title="SPI_fname">
<link rel="next" href="spi-spi-getvalue.html" title="SPI_getvalue">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="spi-spi-fnumber"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>SPI_fnumber — determine the column number for the specified column name</p>
</div>
<a name="id737648"></a><div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">int SPI_fnumber(TupleDesc <em class="parameter"><code>rowdesc</code></em>, const char * <em class="parameter"><code>colname</code></em>)</pre>
</div>
<div class="refsect1" lang="en">
<a name="id737674"></a><h2>Description</h2>
<p> <code class="function">SPI_fnumber</code> returns the column number for the
column with the specified name.
</p>
<p> If <em class="parameter"><code>colname</code></em> refers to a system column (e.g.,
<code class="literal">oid</code>) then the appropriate negative column number will
be returned. The caller should be careful to test the return value
for exact equality to <code class="symbol">SPI_ERROR_NOATTRIBUTE</code> to
detect an error; testing the result for less than or equal to 0 is
not correct unless system columns should be rejected.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id737713"></a><h2>Arguments</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="literal">TupleDesc <em class="parameter"><code>rowdesc</code></em></code></span></dt>
<dd><p> input row description
</p></dd>
<dt><span class="term"><code class="literal">const char * <em class="parameter"><code>colname</code></em></code></span></dt>
<dd><p> column name
</p></dd>
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id737752"></a><h2>Return Value</h2>
<p> Column number (count starts at 1), or
<code class="symbol">SPI_ERROR_NOATTRIBUTE</code> if the named column was not
found.
</p>
</div>
</div></body>
</html>
|