|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/spi.sgml,v 1.30 2003/12/01 22:07:57 momjian Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/spi.sgml,v 1.31 2004/03/05 00:47:01 momjian Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <chapter id="spi">
|
@@ -573,6 +573,190 @@ void * SPI_prepare(const char * <parameter>command</parameter>, int <parameter>n
|
573 | 573 |
|
574 | 574 | <!-- *********************************************** -->
|
575 | 575 |
|
| 576 | +<refentry id="spi-spi-getargcount"> |
| 577 | + <refmeta> |
| 578 | + <refentrytitle>SPI_getargcount</refentrytitle> |
| 579 | + </refmeta> |
| 580 | + |
| 581 | + <refnamediv> |
| 582 | + <refname>SPI_getargcount</refname> |
| 583 | + <refpurpose>returns the number of arguments needed when executing a plan |
| 584 | + prepared by <function>SPI_prepare</function></refpurpose> |
| 585 | + </refnamediv> |
| 586 | + |
| 587 | + <indexterm><primary>SPI_getargcount</primary></indexterm> |
| 588 | + |
| 589 | + <refsynopsisdiv> |
| 590 | +<synopsis> |
| 591 | +int SPI_getargcount(void * <parameter>plan</parameter>) |
| 592 | +</synopsis> |
| 593 | + </refsynopsisdiv> |
| 594 | + |
| 595 | + <refsect1> |
| 596 | + <title>Description</title> |
| 597 | + |
| 598 | + <para> |
| 599 | + <function>SPI_getargcount</function> returns the number of arguments needed |
| 600 | + when executing a plan prepared by <function>SPI_prepare</function>. |
| 601 | + </para> |
| 602 | + </refsect1> |
| 603 | + |
| 604 | + <refsect1> |
| 605 | + <title>Arguments</title> |
| 606 | + |
| 607 | + <variablelist> |
| 608 | + <varlistentry> |
| 609 | + <term><literal>void * <parameter>plan</parameter></literal></term> |
| 610 | + <listitem> |
| 611 | + <para> |
| 612 | + execution plan (returned by <function>SPI_prepare</function>) |
| 613 | + </para> |
| 614 | + </listitem> |
| 615 | + </varlistentry> |
| 616 | + </variablelist> |
| 617 | + </refsect1> |
| 618 | + |
| 619 | + <refsect1> |
| 620 | + <title>Return Value</title> |
| 621 | + <para> |
| 622 | + The expected argument count for the <parameter>plan</parameter> or |
| 623 | + <symbol>SPI_ERROR_ARGUMENT</symbol> if the <parameter>plan |
| 624 | + </parameter> is <symbol>NULL</symbol> |
| 625 | + </para> |
| 626 | + </refsect1> |
| 627 | +</refentry> |
| 628 | + |
| 629 | +<!-- *********************************************** --> |
| 630 | + |
| 631 | +<refentry id="spi-spi-getargtypeid"> |
| 632 | + <refmeta> |
| 633 | + <refentrytitle>SPI_getargtypeid</refentrytitle> |
| 634 | + </refmeta> |
| 635 | + |
| 636 | + <refnamediv> |
| 637 | + <refname>SPI_getargtypeid</refname> |
| 638 | + <refpurpose>returns the expected typeid for the specified argument when |
| 639 | + executing a plan prepared by <function>SPI_prepare</function></refpurpose> |
| 640 | + </refnamediv> |
| 641 | + |
| 642 | + <indexterm><primary>SPI_getargtypeid</primary></indexterm> |
| 643 | + |
| 644 | + <refsynopsisdiv> |
| 645 | +<synopsis> |
| 646 | +Oid SPI_getargtypeid(void * <parameter>plan</parameter>, int <parameter>argIndex</parameter>) |
| 647 | +</synopsis> |
| 648 | + </refsynopsisdiv> |
| 649 | + |
| 650 | + <refsect1> |
| 651 | + <title>Description</title> |
| 652 | + |
| 653 | + <para> |
| 654 | + <function>SPI_getargtypeid</function> returns the Oid representing the type |
| 655 | + id for argument at <parameter>argIndex</parameter> in a plan prepared by |
| 656 | + <function>SPI_prepare</function>. First argument is at index zero. |
| 657 | + </para> |
| 658 | + </refsect1> |
| 659 | + |
| 660 | + <refsect1> |
| 661 | + <title>Arguments</title> |
| 662 | + |
| 663 | + <variablelist> |
| 664 | + <varlistentry> |
| 665 | + <term><literal>void * <parameter>plan</parameter></literal></term> |
| 666 | + <listitem> |
| 667 | + <para> |
| 668 | + execution plan (returned by <function>SPI_prepare</function>) |
| 669 | + </para> |
| 670 | + </listitem> |
| 671 | + </varlistentry> |
| 672 | + |
| 673 | + <varlistentry> |
| 674 | + <term><literal>int <parameter>argIndex</parameter></literal></term> |
| 675 | + <listitem> |
| 676 | + <para> |
| 677 | + zero based index of the argument |
| 678 | + </para> |
| 679 | + </listitem> |
| 680 | + </varlistentry> |
| 681 | + </variablelist> |
| 682 | + </refsect1> |
| 683 | + |
| 684 | + <refsect1> |
| 685 | + <title>Return Value</title> |
| 686 | + <para> |
| 687 | + The type id of the argument at the given index or <symbol> |
| 688 | + SPI_ERROR_ARGUMENT</symbol> if the <parameter>plan</parameter> is |
| 689 | + <symbol>NULL</symbol> or <parameter>argIndex</parameter> is less than 0 or |
| 690 | + not less than the number of arguments declared for the <parameter>plan |
| 691 | + </parameter> |
| 692 | + </para> |
| 693 | + </refsect1> |
| 694 | +</refentry> |
| 695 | + |
| 696 | +<!-- *********************************************** --> |
| 697 | + |
| 698 | +<refentry id="spi-spi-is_cursor_plan"> |
| 699 | + <refmeta> |
| 700 | + <refentrytitle>SPI_is_cursor_plan</refentrytitle> |
| 701 | + </refmeta> |
| 702 | + |
| 703 | + <refnamediv> |
| 704 | + <refname>SPI_is_cursor_plan</refname> |
| 705 | + <refpurpose>returns <symbol>true</symbol> if a plan |
| 706 | + prepared by <function>SPI_prepare</function> can be passed |
| 707 | + as an argument to <function>SPI_cursor_open</function></refpurpose> |
| 708 | + </refnamediv> |
| 709 | + |
| 710 | + <indexterm><primary>SPI_is_cursor_plan</primary></indexterm> |
| 711 | + |
| 712 | + <refsynopsisdiv> |
| 713 | +<synopsis> |
| 714 | +bool SPI_is_cursor_plan(void * <parameter>plan</parameter>) |
| 715 | +</synopsis> |
| 716 | + </refsynopsisdiv> |
| 717 | + |
| 718 | + <refsect1> |
| 719 | + <title>Description</title> |
| 720 | + |
| 721 | + <para> |
| 722 | + <function>SPI_is_cursor_plan</function> returns <symbol>true</symbol> |
| 723 | + if a plan prepared by <function>SPI_prepare</function> can be passed |
| 724 | + as an argument to <function>SPI_cursor_open</function> and <symbol> |
| 725 | + false</symbol> if that is not the case. The criteria is that the |
| 726 | + <parameter>plan</parameter> represents one single command and that this |
| 727 | + command is a <command>SELECT</command> without an <command>INTO</command> |
| 728 | + clause. |
| 729 | + </para> |
| 730 | + </refsect1> |
| 731 | + |
| 732 | + <refsect1> |
| 733 | + <title>Arguments</title> |
| 734 | + |
| 735 | + <variablelist> |
| 736 | + <varlistentry> |
| 737 | + <term><literal>void * <parameter>plan</parameter></literal></term> |
| 738 | + <listitem> |
| 739 | + <para> |
| 740 | + execution plan (returned by <function>SPI_prepare</function>) |
| 741 | + </para> |
| 742 | + </listitem> |
| 743 | + </varlistentry> |
| 744 | + </variablelist> |
| 745 | + </refsect1> |
| 746 | + |
| 747 | + <refsect1> |
| 748 | + <title>Return Value</title> |
| 749 | + <para> |
| 750 | + <symbol>true</symbol> or <symbol>false</symbol> to indicate if the |
| 751 | + <parameter>plan</parameter> can produce a cursor or not, or |
| 752 | + <symbol>SPI_ERROR_ARGUMENT</symbol> if the <parameter>plan</parameter> |
| 753 | + is <symbol>NULL</symbol> |
| 754 | + </para> |
| 755 | + </refsect1> |
| 756 | +</refentry> |
| 757 | + |
| 758 | +<!-- *********************************************** --> |
| 759 | + |
576 | 760 | <refentry id="spi-spi-execp">
|
577 | 761 | <refmeta>
|
578 | 762 | <refentrytitle>SPI_execp</refentrytitle>
|
|
0 commit comments