OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / doc / postgresql / html / ecpg-errors.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Error Handling</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REV="MADE"
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
11 REL="HOME"
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
14 REL="UP"
15 TITLE="ECPG - Embedded SQL in C"
16 HREF="ecpg.html"><LINK
17 REL="PREVIOUS"
18 TITLE="Using SQL Descriptor Areas"
19 HREF="ecpg-descriptors.html"><LINK
20 REL="NEXT"
21 TITLE="Including Files"
22 HREF="ecpg-include.html"><LINK
23 REL="STYLESHEET"
24 TYPE="text/css"
25 HREF="stylesheet.css"><META
26 NAME="creation"
27 CONTENT="2003-12-22T03:48:47"></HEAD
28 ><BODY
29 CLASS="SECT1"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="5"
41 ALIGN="center"
42 VALIGN="bottom"
43 >PostgreSQL 7.4.1 Documentation</TH
44 ></TR
45 ><TR
46 ><TD
47 WIDTH="10%"
48 ALIGN="left"
49 VALIGN="top"
50 ><A
51 HREF="ecpg-descriptors.html"
52 ACCESSKEY="P"
53 >Prev</A
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="left"
58 VALIGN="top"
59 ><A
60 HREF="ecpg.html"
61 >Fast Backward</A
62 ></TD
63 ><TD
64 WIDTH="60%"
65 ALIGN="center"
66 VALIGN="bottom"
67 >Chapter 30. <SPAN
68 CLASS="APPLICATION"
69 >ECPG</SPAN
70 > - Embedded <ACRONYM
71 CLASS="ACRONYM"
72 >SQL</ACRONYM
73 > in C</TD
74 ><TD
75 WIDTH="10%"
76 ALIGN="right"
77 VALIGN="top"
78 ><A
79 HREF="ecpg.html"
80 >Fast Forward</A
81 ></TD
82 ><TD
83 WIDTH="10%"
84 ALIGN="right"
85 VALIGN="top"
86 ><A
87 HREF="ecpg-include.html"
88 ACCESSKEY="N"
89 >Next</A
90 ></TD
91 ></TR
92 ></TABLE
93 ><HR
94 ALIGN="LEFT"
95 WIDTH="100%"></DIV
96 ><DIV
97 CLASS="SECT1"
98 ><H1
99 CLASS="SECT1"
100 ><A
101 NAME="ECPG-ERRORS"
102 >30.9. Error Handling</A
103 ></H1
104 ><P
105 >   This section describes how you can handle exceptional conditions
106    and warnings in an embedded SQL program.  There are several
107    nonexclusive facilities for this.
108   </P
109 ><DIV
110 CLASS="SECT2"
111 ><H2
112 CLASS="SECT2"
113 ><A
114 NAME="AEN23650"
115 >30.9.1. Setting Callbacks</A
116 ></H2
117 ><P
118 >    One simple method to catch errors and warnings is to set a
119     specific action to be executed whenever a particular condition
120     occurs.  In general:
121 </P><PRE
122 CLASS="PROGRAMLISTING"
123 >EXEC SQL WHENEVER <VAR
124 CLASS="REPLACEABLE"
125 >condition</VAR
126 > <VAR
127 CLASS="REPLACEABLE"
128 >action</VAR
129 >;</PRE
130 ><P>
131    </P
132 ><P
133 >    <VAR
134 CLASS="REPLACEABLE"
135 >condition</VAR
136 > can be one of the following:
137
138     <P
139 ></P
140 ></P><DIV
141 CLASS="VARIABLELIST"
142 ><DL
143 ><DT
144 ><TT
145 CLASS="LITERAL"
146 >SQLERROR</TT
147 ></DT
148 ><DD
149 ><P
150 >        The specified action is called whenever an error occurs during
151         the execution of an SQL statement.
152        </P
153 ></DD
154 ><DT
155 ><TT
156 CLASS="LITERAL"
157 >SQLWARNING</TT
158 ></DT
159 ><DD
160 ><P
161 >        The specified action is called whenever a warning occurs
162         during the execution of an SQL statement.
163        </P
164 ></DD
165 ><DT
166 ><TT
167 CLASS="LITERAL"
168 >NOT FOUND</TT
169 ></DT
170 ><DD
171 ><P
172 >        The specified action is called whenever an SQL statement
173         retrieves or affects zero rows.  (This condition is not an
174         error, but you might be interested in handling it specially.)
175        </P
176 ></DD
177 ></DL
178 ></DIV
179 ><P>
180    </P
181 ><P
182 >    <VAR
183 CLASS="REPLACEABLE"
184 >action</VAR
185 > can be one of the following:
186
187     <P
188 ></P
189 ></P><DIV
190 CLASS="VARIABLELIST"
191 ><DL
192 ><DT
193 ><TT
194 CLASS="LITERAL"
195 >CONTINUE</TT
196 ></DT
197 ><DD
198 ><P
199 >        This effectively means that the condition is ignored.  This is
200         the default.
201        </P
202 ></DD
203 ><DT
204 ><TT
205 CLASS="LITERAL"
206 >GOTO <VAR
207 CLASS="REPLACEABLE"
208 >label</VAR
209 ></TT
210 ><BR><TT
211 CLASS="LITERAL"
212 >GO TO <VAR
213 CLASS="REPLACEABLE"
214 >label</VAR
215 ></TT
216 ></DT
217 ><DD
218 ><P
219 >        Jump to the specified label (using a C <TT
220 CLASS="LITERAL"
221 >goto</TT
222 >
223         statement).
224        </P
225 ></DD
226 ><DT
227 ><TT
228 CLASS="LITERAL"
229 >SQLPRINT</TT
230 ></DT
231 ><DD
232 ><P
233 >        Print a message to standard error.  This is useful for simple
234         programs or during prototyping.  The details of the message
235         cannot be configured.
236        </P
237 ></DD
238 ><DT
239 ><TT
240 CLASS="LITERAL"
241 >STOP</TT
242 ></DT
243 ><DD
244 ><P
245 >        Call <TT
246 CLASS="LITERAL"
247 >exit(1)</TT
248 >, which will terminate the
249         program.
250        </P
251 ></DD
252 ><DT
253 ><TT
254 CLASS="LITERAL"
255 >BREAK</TT
256 ></DT
257 ><DD
258 ><P
259 >        Execute the C statement <TT
260 CLASS="LITERAL"
261 >break</TT
262 >.  This should
263         only be used in loops or <TT
264 CLASS="LITERAL"
265 >switch</TT
266 > statements.
267        </P
268 ></DD
269 ><DT
270 ><TT
271 CLASS="LITERAL"
272 >CALL <VAR
273 CLASS="REPLACEABLE"
274 >name</VAR
275 > (<VAR
276 CLASS="REPLACEABLE"
277 >args</VAR
278 >)</TT
279 ><BR><TT
280 CLASS="LITERAL"
281 >DO <VAR
282 CLASS="REPLACEABLE"
283 >name</VAR
284 > (<VAR
285 CLASS="REPLACEABLE"
286 >args</VAR
287 >)</TT
288 ></DT
289 ><DD
290 ><P
291 >        Call the specified C functions with the specified arguments.
292        </P
293 ></DD
294 ></DL
295 ></DIV
296 ><P>
297
298     The SQL standard only provides for the actions
299     <TT
300 CLASS="LITERAL"
301 >CONTINUE</TT
302 > and <TT
303 CLASS="LITERAL"
304 >GOTO</TT
305 > (and
306     <TT
307 CLASS="LITERAL"
308 >GO TO</TT
309 >).
310    </P
311 ><P
312 >    Here is an example that you might want to use in a simple program.
313     It prints a simple message when a warning occurs and aborts the
314     program when an error happens.
315 </P><PRE
316 CLASS="PROGRAMLISTING"
317 >EXEC SQL WHENEVER SQLWARNING SQLPRINT;
318 EXEC SQL WHENEVER SQLERROR STOP;</PRE
319 ><P>
320    </P
321 ><P
322 >    The statement <TT
323 CLASS="LITERAL"
324 >EXEC SQL WHENEVER</TT
325 > is a directive
326     of the SQL preprocessor, not a C statement.  The error or warning
327     actions that it sets apply to all embedded SQL statements that
328     appear below the point where the handler is set, unless a
329     different action was set for the same condition between the first
330     <TT
331 CLASS="LITERAL"
332 >EXEC SQL WHENEVER</TT
333 > and the SQL statement causing
334     the condition, regardless of the flow of control in the C program.
335     So neither of the two following C program excerpts will have the
336     desired effect.
337 </P><PRE
338 CLASS="PROGRAMLISTING"
339 >/*
340  * WRONG
341  */
342 int main(int argc, char *argv[])
343 {
344     ...
345     if (verbose) {
346         EXEC SQL WHENEVER SQLWARNING SQLPRINT;
347     }
348     ...
349     EXEC SQL SELECT ...;
350     ...
351 }</PRE
352 ><P>
353
354 </P><PRE
355 CLASS="PROGRAMLISTING"
356 >/*
357  * WRONG
358  */
359 int main(int argc, char *argv[])
360 {
361     ...
362     set_error_handler();
363     ...
364     EXEC SQL SELECT ...;
365     ...
366 }
367
368 static void set_error_handler(void)
369 {
370     EXEC SQL WHENEVER SQLERROR STOP;
371 }</PRE
372 ><P>
373    </P
374 ></DIV
375 ><DIV
376 CLASS="SECT2"
377 ><H2
378 CLASS="SECT2"
379 ><A
380 NAME="AEN23731"
381 >30.9.2. sqlca</A
382 ></H2
383 ><P
384 >    For a more powerful error handling, the embedded SQL interface
385     provides a global variable with the name <VAR
386 CLASS="VARNAME"
387 >sqlca</VAR
388 >
389     that has the following structure:
390 </P><PRE
391 CLASS="PROGRAMLISTING"
392 >struct
393 {
394     char sqlcaid[8];
395     long sqlabc;
396     long sqlcode;
397     struct
398     {
399         int sqlerrml;
400         char sqlerrmc[70];
401     } sqlerrm;
402     char sqlerrp[8];
403     long sqlerrd[6];
404     char sqlwarn[8];
405     char sqlstate[5];
406 } sqlca;</PRE
407 ><P>
408     (In a multithreaded program, every thread automatically gets its
409     own copy of <VAR
410 CLASS="VARNAME"
411 >sqlca</VAR
412 >.  This works similar to the
413     handling of the standard C global variable
414     <VAR
415 CLASS="VARNAME"
416 >errno</VAR
417 >.)
418    </P
419 ><P
420 >    <VAR
421 CLASS="VARNAME"
422 >sqlca</VAR
423 > covers both warnings and errors.  If
424     multiple warnings or errors occur during the execution of a
425     statement, then <VAR
426 CLASS="VARNAME"
427 >sqlca</VAR
428 > will only contain
429     information about the last one.
430    </P
431 ><P
432 >    If no error occurred in the last <ACRONYM
433 CLASS="ACRONYM"
434 >SQL</ACRONYM
435 > statement,
436     <TT
437 CLASS="LITERAL"
438 >sqlca.sqlcode</TT
439 > will be 0 and
440     <TT
441 CLASS="LITERAL"
442 >sqlca.sqlstate</TT
443 > will be
444     <TT
445 CLASS="LITERAL"
446 >"00000"</TT
447 >.  If a warning or error occurred, then
448     <TT
449 CLASS="LITERAL"
450 >sqlca.sqlcode</TT
451 > will be negative and
452     <TT
453 CLASS="LITERAL"
454 >sqlca.sqlstate</TT
455 > will be different from
456     <TT
457 CLASS="LITERAL"
458 >"00000"</TT
459 >.  A positive
460     <TT
461 CLASS="LITERAL"
462 >sqlca.sqlcode</TT
463 > indicates a harmless condition,
464     such as that the last query returned zero rows.
465     <TT
466 CLASS="LITERAL"
467 >sqlcode</TT
468 > and <TT
469 CLASS="LITERAL"
470 >sqlstate</TT
471 > are two
472     different error code schemes; details appear below.
473    </P
474 ><P
475 >    If the last SQL statement was successful, then
476     <TT
477 CLASS="LITERAL"
478 >sqlca.sqlerrd[1]</TT
479 > contains the OID of the
480     processed row, if applicable, and
481     <TT
482 CLASS="LITERAL"
483 >sqlca.sqlerrd[2]</TT
484 > contains the number of
485     processed or returned rows, if applicable to the command.
486    </P
487 ><P
488 >    In case of an error or warning,
489     <TT
490 CLASS="LITERAL"
491 >sqlca.sqlerrm.sqlerrmc</TT
492 > will contain a string
493     that describes the error.  The field
494     <TT
495 CLASS="LITERAL"
496 >sqlca.sqlerrm.sqlerrml</TT
497 > contains the length of
498     the error message that is stored in
499     <TT
500 CLASS="LITERAL"
501 >sqlca.sqlerrm.sqlerrmc</TT
502 > (the result of
503     <CODE
504 CLASS="FUNCTION"
505 >strlen()</CODE
506 >, not really interesting for a C
507     programmer).
508    </P
509 ><P
510 >    In case of a warning, <TT
511 CLASS="LITERAL"
512 >sqlca.sqlwarn[2]</TT
513 > is set
514     to <TT
515 CLASS="LITERAL"
516 >W</TT
517 >.  (In all other cases, it is set to
518     something different from <TT
519 CLASS="LITERAL"
520 >W</TT
521 >.)  If
522     <TT
523 CLASS="LITERAL"
524 >sqlca.sqlwarn[1]</TT
525 > is set to
526     <TT
527 CLASS="LITERAL"
528 >W</TT
529 >, then a value was truncated when it was
530     stored in a host variable.  <TT
531 CLASS="LITERAL"
532 >sqlca.sqlwarn[0]</TT
533 > is
534     set to <TT
535 CLASS="LITERAL"
536 >W</TT
537 > if any of the other elements are set
538     to indicate a warning.
539    </P
540 ><P
541 >    The fields <TT
542 CLASS="STRUCTFIELD"
543 >sqlcaid</TT
544 >,
545     <TT
546 CLASS="STRUCTFIELD"
547 >sqlcabc</TT
548 >,
549     <TT
550 CLASS="STRUCTFIELD"
551 >sqlerrp</TT
552 >, and the remaining elements of
553     <TT
554 CLASS="STRUCTFIELD"
555 >sqlerrd</TT
556 > and
557     <TT
558 CLASS="STRUCTFIELD"
559 >sqlwarn</TT
560 > currently contain no useful
561     information.
562    </P
563 ><P
564 >    The structure <VAR
565 CLASS="VARNAME"
566 >sqlca</VAR
567 > is not defined in the SQL
568     standard, but is implemented in several other SQL database
569     systems.  The definitions are similar in the core, but if you want
570     to write portable applications, then you should investigate the
571     different implementations carefully.
572    </P
573 ></DIV
574 ><DIV
575 CLASS="SECT2"
576 ><H2
577 CLASS="SECT2"
578 ><A
579 NAME="AEN23776"
580 >30.9.3. <TT
581 CLASS="LITERAL"
582 >SQLSTATE</TT
583 > vs <TT
584 CLASS="LITERAL"
585 >SQLCODE</TT
586 ></A
587 ></H2
588 ><P
589 >    The fields <TT
590 CLASS="LITERAL"
591 >sqlca.sqlstate</TT
592 > and
593     <TT
594 CLASS="LITERAL"
595 >sqlca.sqlcode</TT
596 > are two different schemes that
597     provide error codes.  Both are specified in the SQL standard, but
598     <TT
599 CLASS="LITERAL"
600 >SQLCODE</TT
601 > has been marked deprecated in the 1992
602     edition of the standard and has been dropped in the 1999 edition.
603     Therefore, new applications are strongly encouraged to use
604     <TT
605 CLASS="LITERAL"
606 >SQLSTATE</TT
607 >.
608    </P
609 ><P
610 >    <TT
611 CLASS="LITERAL"
612 >SQLSTATE</TT
613 > is a five-character array.  The five
614     characters contain digits or upper-case letters that represent
615     codes of various error and warning conditions.
616     <TT
617 CLASS="LITERAL"
618 >SQLSTATE</TT
619 > has a hierarchical scheme: the first
620     two characters indicate the general class of the condition, the
621     last three characters indicate a subclass of the general
622     condition.  A successful state is indicated by the code
623     <TT
624 CLASS="LITERAL"
625 >00000</TT
626 >.  The <TT
627 CLASS="LITERAL"
628 >SQLSTATE</TT
629 > codes are for
630     the most part defined in the SQL standard.  The
631     <SPAN
632 CLASS="PRODUCTNAME"
633 >PostgreSQL</SPAN
634 > server natively supports
635     <TT
636 CLASS="LITERAL"
637 >SQLSTATE</TT
638 > error codes; therefore a high degree
639     of consistency can be achieved by using this error code scheme
640     throughout all applications.  For further information see
641     <A
642 HREF="errcodes-appendix.html"
643 >Appendix A</A
644 >.
645    </P
646 ><P
647 >    <TT
648 CLASS="LITERAL"
649 >SQLCODE</TT
650 >, the deprecated error code scheme, is a
651     simple integer.  A value of 0 indicates success, a positive value
652     indicates success with additional information, a negative value
653     indicates an error.  The SQL standard only defines the positive
654     value +100, which indicates that the last command returned or
655     affected zero rows, and no specific negative values.  Therefore,
656     this scheme can only achieve poor portability and does not have a
657     hierarchical code assignment.  Historically, the embedded SQL
658     processor for <SPAN
659 CLASS="PRODUCTNAME"
660 >PostgreSQL</SPAN
661 > has assigned
662     some specific <TT
663 CLASS="LITERAL"
664 >SQLCODE</TT
665 > values for its use, which
666     are listed below with their numeric value and their symbolic name.
667     Remember that these are not portable to other SQL implementations.
668     To simplify the porting of applications to the
669     <TT
670 CLASS="LITERAL"
671 >SQLSTATE</TT
672 > scheme, the corresponding
673     <TT
674 CLASS="LITERAL"
675 >SQLSTATE</TT
676 > is also listed.  There is, however, no
677     one-to-one or one-to-many mapping between the two schemes (indeed
678     it is many-to-many), so you should consult the global
679     <TT
680 CLASS="LITERAL"
681 >SQLSTATE</TT
682 > listing in <A
683 HREF="errcodes-appendix.html"
684 >Appendix A</A
685 >
686     in each case.
687    </P
688 ><P
689 >    These are the assigned <TT
690 CLASS="LITERAL"
691 >SQLCODE</TT
692 > values:
693
694     <P
695 ></P
696 ></P><DIV
697 CLASS="VARIABLELIST"
698 ><DL
699 ><DT
700 >-12 (<TT
701 CLASS="SYMBOL"
702 >ECPG_OUT_OF_MEMORY</TT
703 >)</DT
704 ><DD
705 ><P
706 >        Indicates that your virtual memory is exhausted. (SQLSTATE
707         YE001)
708       </P
709 ></DD
710 ><DT
711 >-200 (<TT
712 CLASS="SYMBOL"
713 >ECPG_UNSUPPORTED</TT
714 >)</DT
715 ><DD
716 ><P
717 >       Indicates the preprocessor has generated something that the
718        library does not know about.  Perhaps you are running
719        incompatible versions of the preprocessor and the
720        library. (SQLSTATE YE002)
721       </P
722 ></DD
723 ><DT
724 >-201 (<TT
725 CLASS="SYMBOL"
726 >ECPG_TOO_MANY_ARGUMENTS</TT
727 >)</DT
728 ><DD
729 ><P
730 >       This means that the command specified more host variables than
731        the command expected.  (SQLSTATE 07001 or 07002)
732       </P
733 ></DD
734 ><DT
735 >-202 (<TT
736 CLASS="SYMBOL"
737 >ECPG_TOO_FEW_ARGUMENTS</TT
738 >)</DT
739 ><DD
740 ><P
741 >       This means that the command specified fewer host variables than
742        the command expected.  (SQLSTATE 07001 or 07002)
743       </P
744 ></DD
745 ><DT
746 >-203 (<TT
747 CLASS="SYMBOL"
748 >ECPG_TOO_MANY_MATCHES</TT
749 >)</DT
750 ><DD
751 ><P
752 >       This means a query has returned multiple rows but the statement
753        was only prepared to store one result row (for example, because
754        the specified variables are not arrays).  (SQLSTATE 21000)
755       </P
756 ></DD
757 ><DT
758 >-204 (<TT
759 CLASS="SYMBOL"
760 >ECPG_INT_FORMAT</TT
761 >)</DT
762 ><DD
763 ><P
764 >       The host variable is of type <TT
765 CLASS="TYPE"
766 >int</TT
767 > and the datum in
768        the database is of a different type and contains a value that
769        cannot be interpreted as an <TT
770 CLASS="TYPE"
771 >int</TT
772 >.  The library uses
773        <CODE
774 CLASS="FUNCTION"
775 >strtol()</CODE
776 > for this conversion.  (SQLSTATE
777        42804)
778       </P
779 ></DD
780 ><DT
781 >-205 (<TT
782 CLASS="SYMBOL"
783 >ECPG_UINT_FORMAT</TT
784 >)</DT
785 ><DD
786 ><P
787 >       The host variable is of type <TT
788 CLASS="TYPE"
789 >unsigned int</TT
790 > and the
791        datum in the database is of a different type and contains a
792        value that cannot be interpreted as an <TT
793 CLASS="TYPE"
794 >unsigned
795        int</TT
796 >.  The library uses <CODE
797 CLASS="FUNCTION"
798 >strtoul()</CODE
799 >
800        for this conversion.  (SQLSTATE 42804)
801       </P
802 ></DD
803 ><DT
804 >-206 (<TT
805 CLASS="SYMBOL"
806 >ECPG_FLOAT_FORMAT</TT
807 >)</DT
808 ><DD
809 ><P
810 >       The host variable is of type <TT
811 CLASS="TYPE"
812 >float</TT
813 > and the datum
814        in the database is of another type and contains a value that
815        cannot be interpreted as a <TT
816 CLASS="TYPE"
817 >float</TT
818 >.  The library
819        uses <CODE
820 CLASS="FUNCTION"
821 >strtod()</CODE
822 > for this conversion.
823        (SQLSTATE 42804)
824       </P
825 ></DD
826 ><DT
827 >-207 (<TT
828 CLASS="SYMBOL"
829 >ECPG_CONVERT_BOOL</TT
830 >)</DT
831 ><DD
832 ><P
833 >       This means the host variable is of type <TT
834 CLASS="TYPE"
835 >bool</TT
836 > and
837        the datum in the database is neither <TT
838 CLASS="LITERAL"
839 >'t'</TT
840 > nor
841        <TT
842 CLASS="LITERAL"
843 >'f'</TT
844 >.  (SQLSTATE 42804)
845       </P
846 ></DD
847 ><DT
848 >-208 (<TT
849 CLASS="SYMBOL"
850 >ECPG_EMPTY</TT
851 >)</DT
852 ><DD
853 ><P
854 >       The statement sent to the <SPAN
855 CLASS="PRODUCTNAME"
856 >PostgreSQL</SPAN
857 >
858        server was empty.  (This cannot normally happen in an embedded
859        SQL program, so it may point to an internal error.)  (SQLSTATE
860        YE002)
861       </P
862 ></DD
863 ><DT
864 >-209 (<TT
865 CLASS="SYMBOL"
866 >ECPG_MISSING_INDICATOR</TT
867 >)</DT
868 ><DD
869 ><P
870 >       A null value was returned and no null indicator variable was
871        supplied.  (SQLSTATE 22002)
872       </P
873 ></DD
874 ><DT
875 >-210 (<TT
876 CLASS="SYMBOL"
877 >ECPG_NO_ARRAY</TT
878 >)</DT
879 ><DD
880 ><P
881 >       An ordinary variable was used in a place that requires an
882        array.  (SQLSTATE 42804)
883       </P
884 ></DD
885 ><DT
886 >-211 (<TT
887 CLASS="SYMBOL"
888 >ECPG_DATA_NOT_ARRAY</TT
889 >)</DT
890 ><DD
891 ><P
892 >       The database returned an ordinary variable in a place that
893        requires array value.  (SQLSTATE 42804)
894       </P
895 ></DD
896 ><DT
897 >-220 (<TT
898 CLASS="SYMBOL"
899 >ECPG_NO_CONN</TT
900 >)</DT
901 ><DD
902 ><P
903 >       The program tried to access a connection that does not exist.
904        (SQLSTATE 08003)
905       </P
906 ></DD
907 ><DT
908 >-221 (<TT
909 CLASS="SYMBOL"
910 >ECPG_NOT_CONN</TT
911 >)</DT
912 ><DD
913 ><P
914 >       The program tried to access a connection that does exist but is
915        not open.  (This is an internal error.)  (SQLSTATE YE002)
916       </P
917 ></DD
918 ><DT
919 >-230 (<TT
920 CLASS="SYMBOL"
921 >ECPG_INVALID_STMT</TT
922 >)</DT
923 ><DD
924 ><P
925 >       The statement you are trying to use has not been prepared.
926        (SQLSTATE 26000)
927       </P
928 ></DD
929 ><DT
930 >-240 (<TT
931 CLASS="SYMBOL"
932 >ECPG_UNKNOWN_DESCRIPTOR</TT
933 >)</DT
934 ><DD
935 ><P
936 >       The descriptor specified was not found.  The statement you are
937        trying to use has not been prepared.  (SQLSTATE 33000)
938       </P
939 ></DD
940 ><DT
941 >-241 (<TT
942 CLASS="SYMBOL"
943 >ECPG_INVALID_DESCRIPTOR_INDEX</TT
944 >)</DT
945 ><DD
946 ><P
947 >       The descriptor index specified was out of range.  (SQLSTATE
948        07009)
949       </P
950 ></DD
951 ><DT
952 >-242 (<TT
953 CLASS="SYMBOL"
954 >ECPG_UNKNOWN_DESCRIPTOR_ITEM</TT
955 >)</DT
956 ><DD
957 ><P
958 >       An invalid descriptor item was requested.  (This is an internal
959        error.)  (SQLSTATE YE002)
960       </P
961 ></DD
962 ><DT
963 >-243 (<TT
964 CLASS="SYMBOL"
965 >ECPG_VAR_NOT_NUMERIC</TT
966 >)</DT
967 ><DD
968 ><P
969 >       During the execution of a dynamic statement, the database
970        returned a numeric value and the host variable was not numeric.
971        (SQLSTATE 07006)
972       </P
973 ></DD
974 ><DT
975 >-244 (<TT
976 CLASS="SYMBOL"
977 >ECPG_VAR_NOT_CHAR</TT
978 >)</DT
979 ><DD
980 ><P
981 >       During the execution of a dynamic statement, the database
982        returned a non-numeric value and the host variable was numeric.
983        (SQLSTATE 07006)
984       </P
985 ></DD
986 ><DT
987 >-400 (<TT
988 CLASS="SYMBOL"
989 >ECPG_PGSQL</TT
990 >)</DT
991 ><DD
992 ><P
993 >       Some error caused by the <SPAN
994 CLASS="PRODUCTNAME"
995 >PostgreSQL</SPAN
996 >
997        server.  The message contains the error message from the
998        <SPAN
999 CLASS="PRODUCTNAME"
1000 >PostgreSQL</SPAN
1001 > server.
1002       </P
1003 ></DD
1004 ><DT
1005 >-401 (<TT
1006 CLASS="SYMBOL"
1007 >ECPG_TRANS</TT
1008 >)</DT
1009 ><DD
1010 ><P
1011 >       The <SPAN
1012 CLASS="PRODUCTNAME"
1013 >PostgreSQL</SPAN
1014 > server signaled that
1015        we cannot start, commit, or rollback the transaction.
1016        (SQLSTATE 08007)
1017       </P
1018 ></DD
1019 ><DT
1020 >-402 (<TT
1021 CLASS="SYMBOL"
1022 >ECPG_CONNECT</TT
1023 >)</DT
1024 ><DD
1025 ><P
1026 >       The connection attempt to the database did not succeed.
1027        (SQLSTATE 08001)
1028       </P
1029 ></DD
1030 ><DT
1031 >100 (<TT
1032 CLASS="SYMBOL"
1033 >ECPG_NOT_FOUND</TT
1034 >)</DT
1035 ><DD
1036 ><P
1037 >       This is a harmless condition indicating that the last command
1038        retrieved or processed zero rows, or that you are at the end of
1039        the cursor.  (SQLSTATE 02000)
1040       </P
1041 ></DD
1042 ></DL
1043 ></DIV
1044 ><P>
1045   </P
1046 ></DIV
1047 ></DIV
1048 ><DIV
1049 CLASS="NAVFOOTER"
1050 ><HR
1051 ALIGN="LEFT"
1052 WIDTH="100%"><TABLE
1053 SUMMARY="Footer navigation table"
1054 WIDTH="100%"
1055 BORDER="0"
1056 CELLPADDING="0"
1057 CELLSPACING="0"
1058 ><TR
1059 ><TD
1060 WIDTH="33%"
1061 ALIGN="left"
1062 VALIGN="top"
1063 ><A
1064 HREF="ecpg-descriptors.html"
1065 ACCESSKEY="P"
1066 >Prev</A
1067 ></TD
1068 ><TD
1069 WIDTH="34%"
1070 ALIGN="center"
1071 VALIGN="top"
1072 ><A
1073 HREF="index.html"
1074 ACCESSKEY="H"
1075 >Home</A
1076 ></TD
1077 ><TD
1078 WIDTH="33%"
1079 ALIGN="right"
1080 VALIGN="top"
1081 ><A
1082 HREF="ecpg-include.html"
1083 ACCESSKEY="N"
1084 >Next</A
1085 ></TD
1086 ></TR
1087 ><TR
1088 ><TD
1089 WIDTH="33%"
1090 ALIGN="left"
1091 VALIGN="top"
1092 >Using SQL Descriptor Areas</TD
1093 ><TD
1094 WIDTH="34%"
1095 ALIGN="center"
1096 VALIGN="top"
1097 ><A
1098 HREF="ecpg.html"
1099 ACCESSKEY="U"
1100 >Up</A
1101 ></TD
1102 ><TD
1103 WIDTH="33%"
1104 ALIGN="right"
1105 VALIGN="top"
1106 >Including Files</TD
1107 ></TR
1108 ></TABLE
1109 ></DIV
1110 ></BODY
1111 ></HTML
1112 >