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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>30.10.Including Files</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="ecpg.html" title="Chapter30.ECPG - Embedded SQL in C">
<link rel="prev" href="ecpg-errors.html" title="30.9.Error Handling">
<link rel="next" href="ecpg-process.html" title="30.11.Processing Embedded SQL Programs">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="ecpg-include"></a>30.10.Including Files</h2></div></div></div>
<p> To include an external file into your embedded SQL program, use:
</p>
<pre class="programlisting">EXEC SQL INCLUDE <em class="replaceable"><code>filename</code></em>;</pre>
<p>
The embedded SQL preprocessor will look for a file named
<code class="literal"><em class="replaceable"><code>filename</code></em>.h</code>,
preprocess it, and include it in the resulting C output. Thus,
embedded SQL statements in the included file are handled correctly.
</p>
<p> Note that this is <span class="emphasis"><em>not</em></span> the same as
</p>
<pre class="programlisting">#include <<em class="replaceable"><code>filename</code></em>.h></pre>
<p>
because this file would not be subject to SQL command preprocessing.
Naturally, you can continue to use the C
<code class="literal">#include</code> directive to include other header
files.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p> The include file name is case-sensitive, even though the rest of
the <code class="literal">EXEC SQL INCLUDE</code> command follows the normal
SQL case-sensitivity rules.
</p>
</div>
</div></body>
</html>
|