Exec 47) Sends a query to the backend server. It's probably more desirable to use one of the next two functions. �䤤��碌��Хå�����ɥ����Ф��������ޤ��� �����������μ��˽ФƤ�����Ĥδؿ��Τ����줫��ƤӽФ������ɤ��Ǥ��礦��
ExecStatusType PgConnection::Exec(const char* query)
48)
Returns the result of the query. The following status results can be expected:
�䤤��碌�η�̤ξ��֤��֤��ޤ���ͽ����������֤ϰʲ����̤�Ǥ���
| PGRES_EMPTY_QUERY |
| 49) PGRES_COMMAND_OK, if the query was a command |
| PGRES_COMMAND_OK���䤤��碌�����ޥ�ɤ��ä����� |
| 50) PGRES_TUPLES_OK, if the query successfully returned tuples |
| PGRES_TUPLES_OK���䤤��碌�����ץ���֤��Τ������������� |
| PGRES_COPY_OUT |
| PGRES_COPY_IN |
| 51) PGRES_BAD_RESPONSE, if an unexpected response was received |
| PGRES_BAD_RESPONSE��ͽ�����ʤ������������������ |
| PGRES_NONFATAL_ERROR |
| PGRES_FATAL_ERROR |
ExecCommandOk 52) Sends a command query to the backend server. �Хå�����ɥ����Ф��䤤��碌���������ޤ���
int PgConnection::ExecCommandOk(const char *query)
53)
Returns TRUE if the command query succeeds.
�䤤��碌�μ¹Ԥ���������� TRUE ���֤��ޤ���
ExecTuplesOk 54) Sends a command query to the backend server. �Хå�����ɥ����Ф��䤤��碌���������ޤ���
int PgConnection::ExecTuplesOk(const char *query)
55)
Returns TRUE if the command query succeeds and there are tuples to be retrieved.
�䤤��碌�μ¹Ԥ������������Ф����ץ뤬¸�ߤ���� TRUE ���֤��ޤ���
ErrorMessage 56) Returns the last error message text. �Ǹ�˽��Ϥ��줿���顼��å������ƥ����Ȥ��֤��ޤ���
const char *PgConnection::ErrorMessage()
Tuples 57) Returns the number of tuples (instances) in the query result. �䤤��碌��̤˴ޤޤ�륿�ץ�ʥ����ˤο����֤��ޤ���
int PgDatabase::Tuples()
Fields 58) Returns the number of fields (attributes) in each tuple of the query result. �䤤��碌��̤Υ��ץ�˴ޤޤ��ե�����ɡ�°���ˤο����֤��ޤ���
int PgDatabase::Fields()
FieldName 59) Returns the field (attribute) name associated with the given field index. Field indices start at 0. Ϳ����줿�ե�����ɡ�°���ˤΥ���ǥå������б�����ե������̾���֤��ޤ��� �ե�����ɤΥ���ǥå����� 0 ����Ϥޤ�ޤ���
const char *PgDatabase::FieldName(int field_num)
FieldNum 60) PQfnumber Returns the field (attribute) index associated with the given field name. Ϳ����줿�ե�����ɡ�°����̾���б�����ե�����ɤΥ���ǥå������֤��ޤ���
int PgDatabase::FieldNum(const char* field_name)
61)
-1 is returned if the given name does not match any field.
Ϳ����줿̾�����ɤΥե�����ɤȤ���פ��ʤ����� -1 ���֤��ޤ���
FieldType 62) Returns the field type associated with the given field index. The integer returned is an internal coding of the type. Field indices start at 0. Ϳ����줿�ե�����ɤΥ���ǥå������б�����ե�����ɤη����֤��ޤ��� �֤��줿�����Ϸ����Ф������������ɤǤ��� �ե�����ɤΥ���ǥå����� 0 ����Ϥޤ�ޤ���
Oid PgDatabase::FieldType(int field_num)
FieldType 63) Returns the field type associated with the given field name. The integer returned is an internal coding of the type. Field indices start at 0. ���Ǹ�ΰ�ʸ�Ͼä�˺�� Ϳ����줿�ե������̾���б�����ե�����ɤη����֤��ޤ��� �֤��줿�����Ϸ����Ф������������ɤǤ���
Oid PgDatabase::FieldType(const char* field_name)
FieldSize 64) Returns the size in bytes of the field associated with the given field index. Field indices start at 0. Ϳ����줿�ե�����ɤΥ���ǥå������б�����ե�����ɤΥ�������Х��ȿ����֤��ޤ��� �ե�����ɤΥ���ǥå����� 0 ����Ϥޤ�ޤ���
short PgDatabase::FieldSize(int field_num)
65)
Returns the space allocated for this field in a database tuple given
the field number. In other words the size of the server's binary
representation of the data type. -1 is returned if the field is
variable size.
���ץ���λ��ꤵ�줿�ե�������ֹ�˳�����Ƥ�줿�ΰ�Υ��������֤��ޤ���
�Ĥޤꤳ��ϡ����Υǡ������Υ����Фˤ�����Х��ʥ�ɽ���Υ������Ǥ���
�ե�����ɤ�����Ĺ�ξ��� -1 ���֤��ޤ���
FieldSize 66) Returns the size in bytes of the field associated with the given field index. Field indices start at 0. ����ʸ�Ȥ⽤��˺�� Ϳ����줿�ե������̾���б�����ե�����ɤΥ�������Х��ȿ����֤��ޤ���
short PgDatabase::FieldSize(const char *field_name)
67)
Returns the space allocated for this field in a database tuple given
the field name. In other words the size of the server's binary
representation of the data type. -1 is returned if the field is
variable size.
���ץ���λ��ꤵ�줿�ե������̾�˳�����Ƥ�줿�ΰ�Υ��������֤��ޤ���
�Ĥޤꤳ��ϡ����Υǡ������Υ����Фˤ�����Х��ʥ�ɽ���Υ������Ǥ���
�ե�����ɤ�����Ĺ�ξ��� -1 ���֤��ޤ���
GetValue 68) Returns a single field (attribute) value of one tuple of a PGresult. Tuple and field indices start at 0. PGresult ���饿�ץ��ҤȤļ�ꡤ �����椫��ե�����ɡ�°���ˤ��ͤ�ҤȤ��֤��ޤ��� ���ץ�ȥե�����ɤΥ���ǥå����� 0 ����Ϥޤ�ޤ���
const char *PgDatabase::GetValue(int tup_num, int field_num)
69)
For most queries, the value returned by GetValue is a null-terminated
ASCII string representation of the attribute value. But if BinaryTuples()
is TRUE, the value returned by GetValue is the binary representation
of the type in the internal format of the backend server (but not including
the size word, if the field is variable-length). It is then the programmer's
responsibility to cast and convert the data to the correct C type. The
pointer returned by GetValue points to storage that is part of the
PGresult structure. One should not modify it, and one must explicitly
copy the value into other storage if it is to be used past the lifetime
of the PGresult structure itself. BinaryTuples() is not yet implemented.
�ۤȤ�ɤ��䤤��碌�ˤ����ơ�GetValue ���֤��ͤ�°���ͤ� NULL ��ü��
ASCII ʸ�����ɽ��������ΤȤʤ�ޤ���
������ BinaryTuples() �� TRUE �ξ�硤GetValue
���֤��ͤϥХå�����ɥ����Ф������ե����ޥåȤˤ��Х��ʥ귿ɽ���Ǥ���
�ʤ������ե�����ɤ�����Ĺ�Ǥ��äƤ⡤���Υ���������ɤϴޤޤ�ޤ����
�������äơ������������ C �η��˥��㥹�Ȥ����Ѵ�����Τϥץ�����ޤ���Ǥ�Ǥ���
GetValue ���֤��ݥ��� PGresult ��¤�Τε����ΰ�ΰ����Ǥ����顤
������ѹ����ƤϤ����ޤ���
�⤷�ͤ� PGresult ��¤�μ��Ȥμ�̿��Ķ���ƻȤ��ΤǤ���С�
����Ū���̤ε����ΰ�˥��ԡ����ʤ���Фʤ�ޤ���
��BinaryTuples() �Ϥޤ���������Ƥ��ޤ����
GetValue 70) Returns a single field (attribute) value of one tuple of a PGresult. Tuple and field indices start at 0. ���Ǹ�ΰ�ʸ�Ͻ�����˺�� PGresult ���饿�ץ��ҤȤļ�ꡤ �����椫��ե�����ɡ�°���ˤ��ͤ�ҤȤ��֤��ޤ��� ���ץ�Υ���ǥå����� 0 ����Ϥޤ�ޤ���
const char *PgDatabase::GetValue(int tup_num, const char *field_name)
71)
For most queries, the value returned by GetValue is a null-terminated
ASCII string representation of the attribute value. But if BinaryTuples()
is TRUE, the value returned by GetValue is the binary representation
of the type in the internal format of the backend server (but not including
the size word, if the field is variable-length). It is then the programmer's
responsibility to cast and convert the data to the correct C type. The
pointer returned by GetValue points to storage that is part of the
PGresult structure. One should not modify it, and one must explicitly
copy the value into other storage if it is to be used past the lifetime
of the PGresult structure itself. BinaryTuples() is not yet implemented.
�ۤȤ�ɤ��䤤��碌�ˤ����ơ�GetValue ���֤��ͤ�°���ͤ� NULL ��ü��
ASCII ʸ�����ɽ��������ΤȤʤ�ޤ���
������ BinaryTuples() �� TRUE �ξ�硤GetValue
���֤��ͤϥХå�����ɥ����Ф������ե����ޥåȤˤ��Х��ʥ귿ɽ���Ǥ���
�ʤ������ե�����ɤ�����Ĺ�Ǥ��äƤ⡤���Υ���������ɤϴޤޤ�ޤ����
�������äơ������������ C �η��˥��㥹�Ȥ����Ѵ�����Τϥץ�����ޤ���Ǥ�Ǥ���
GetValue ���֤��ݥ��� PGresult ��¤�Τε����ΰ�ΰ����Ǥ����顤
������ѹ����ƤϤ����ޤ���
�⤷�ͤ� PGresult ��¤�μ��Ȥμ�̿��Ķ���ƻȤ��ΤǤ���С�
����Ū���̤ε����ΰ�˥��ԡ����ʤ���Фʤ�ޤ���
��BinaryTuples() �Ϥޤ���������Ƥ��ޤ����
GetLength 72) Returns the length of a field (attribute) in bytes. Tuple and field indices start at 0. �ե�����ɡ�°���ˤ�Ĺ����Х��ȿ����֤��ޤ��� ���ץ�ȥե�����ɤΥ���ǥå����� 0 ����Ϥޤ�ޤ���
int PgDatabase::GetLength(int tup_num, int field_num)
73)
This is the actual data length for the particular data value, that
is the size of the object pointed to by GetValue. Note that for
ASCII-represented values, this size has little to do with the binary size reported by PQfsize.
����ϸġ��Υǡ����ͤ��Ф���ºݤΥǡ���Ĺ�ǡ�
GetValue ���ؤ����֥������ȤΥ������Ǥ���
�ʤ� ASCII ɽ�����ͤξ�硤���Υ������� PQfsize
��������Х��ʥꥵ�����ȤϤ��ޤ��Ϣ���ޤ������դ��Ƥ���������
GetLength 74) Returns the length of a field (attribute) in bytes. Tuple and field indices start at 0. ���Ǹ�ΰ�ʸ�Ͻ�����˺�� �ե�����ɡ�°���ˤ�Ĺ����Х��ȿ����֤��ޤ��� ���ץ�Υ���ǥå����� 0 ����Ϥޤ�ޤ���
int PgDatabase::GetLength(int tup_num, const char* field_name)
75)
This is the actual data length for the particular data value, that
is the size of the object pointed to by GetValue. Note that for
ASCII-represented values, this size has little to do with the binary
size reported by PQfsize.
����ϸġ��Υǡ����ͤ��Ф���ºݤΥǡ���Ĺ�ǡ�
GetValue ���ؤ����֥������ȤΥ������Ǥ���
�ʤ� ASCII ɽ�����ͤξ�硤���Υ������� PQfsize
��������Х��ʥꥵ�����ȤϤ��ޤ��Ϣ���ޤ������դ��Ƥ���������
DisplayTuples 76) Prints out all the tuples and, optionally, the attribute names to the specified output stream. ���ꤵ�줿���ϥ��ȥ��ؤ��٤ƤΥ��ץ�ȡ�ɬ�פʤ�°��̾��ɽ�����ޤ���
void PgDatabase::DisplayTuples(FILE *out = 0, int fillAlign = 1,
const char* fieldSep = "|",int printHeader = 1, int quiet = 0)
PrintTuples 77) Prints out all the tuples and, optionally, the attribute names to the specified output stream. ���ꤵ�줿���ϥ��ȥ��ؤ��٤ƤΥ��ץ�ȡ�ɬ�פʤ�°��̾��ɽ�����ޤ���
void PgDatabase::PrintTuples(FILE *out = 0, int printAttName = 1,
int terseOutput = 0, int width = 0)
GetLine
int PgDatabase::GetLine(char* string, int length)
PutLine
void PgDatabase::PutLine(const char* string)
OidStatus
const char *PgDatabase::OidStatus()
EndCopy
int PgDatabase::EndCopy()