org.postgresql.pljava.internal

Class SPI


public class SPI
extends java.lang.Object

The SPI class provides access to some global variables used by SPI.

Field Summary

static int
ERROR_ARGUMENT
static int
ERROR_CONNECT
static int
ERROR_COPY
static int
ERROR_CURSOR
static int
ERROR_NOATTRIBUTE
static int
ERROR_NOOUTFUNC
static int
ERROR_OPUNKNOWN
static int
ERROR_PARAM
static int
ERROR_TRANSACTION
static int
ERROR_TYPUNKNOWN
static int
ERROR_UNCONNECTED
static int
OK_CONNECT
static int
OK_CURSOR
static int
OK_DELETE
static int
OK_FETCH
static int
OK_FINISH
static int
OK_INSERT
static int
OK_SELECT
static int
OK_SELINTO
static int
OK_UPDATE
static int
OK_UTILITY

Method Summary

static int
exec(String command, int rowCount)
Execute a command using the internal SPI_exec function.
static void
freeTupTable()
static int
getProcessed()
Returns the value of the global variable SPI_processed.
static int
getResult()
Returns the value of the global variable SPI_result.
static String
getResultText(int resultCode)
Returns a textual representatio of a result code
static TupleTable
getTupTable(TupleDesc known)
Returns the value of the global variable SPI_tuptable.

Field Details

ERROR_ARGUMENT

public static final int ERROR_ARGUMENT
Field Value:
-6

ERROR_CONNECT

public static final int ERROR_CONNECT
Field Value:
-1

ERROR_COPY

public static final int ERROR_COPY
Field Value:
-2

ERROR_CURSOR

public static final int ERROR_CURSOR
Field Value:
-5

ERROR_NOATTRIBUTE

public static final int ERROR_NOATTRIBUTE
Field Value:
-9

ERROR_NOOUTFUNC

public static final int ERROR_NOOUTFUNC
Field Value:
-10

ERROR_OPUNKNOWN

public static final int ERROR_OPUNKNOWN
Field Value:
-3

ERROR_PARAM

public static final int ERROR_PARAM
Field Value:
-7

ERROR_TRANSACTION

public static final int ERROR_TRANSACTION
Field Value:
-8

ERROR_TYPUNKNOWN

public static final int ERROR_TYPUNKNOWN
Field Value:
-11

ERROR_UNCONNECTED

public static final int ERROR_UNCONNECTED
Field Value:
-4

OK_CONNECT

public static final int OK_CONNECT
Field Value:
1

OK_CURSOR

public static final int OK_CURSOR
Field Value:
10

OK_DELETE

public static final int OK_DELETE
Field Value:
8

OK_FETCH

public static final int OK_FETCH
Field Value:
3

OK_FINISH

public static final int OK_FINISH
Field Value:
2

OK_INSERT

public static final int OK_INSERT
Field Value:
7

OK_SELECT

public static final int OK_SELECT
Field Value:
5

OK_SELINTO

public static final int OK_SELINTO
Field Value:
6

OK_UPDATE

public static final int OK_UPDATE
Field Value:
9

OK_UTILITY

public static final int OK_UTILITY
Field Value:
4

Method Details

exec

public static int exec(String command,
                       int rowCount)
Execute a command using the internal SPI_exec function.
Parameters:
command - The command to execute.
rowCount - The maximum number of tuples to create. A value of rowCount of zero is interpreted as no limit, i.e., run to completion.
Returns:
One of the declared status codes.

freeTupTable

public static void freeTupTable()

getProcessed

public static int getProcessed()
Returns the value of the global variable SPI_processed.

getResult

public static int getResult()
Returns the value of the global variable SPI_result.

getResultText

public static String getResultText(int resultCode)
Returns a textual representatio of a result code

getTupTable

public static TupleTable getTupTable(TupleDesc known)
Returns the value of the global variable SPI_tuptable.

Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. \ Distributed under the terms shown in COPYRIGHT