[Original] libpq-PostgreSQL client Programming Interface (2) ---- command execution function in libpq

Source: Internet
Author: User

PGresult *  *command = = PQexec(conn,command);

 (PQresultStatus(res) !=                   cout << PQresultErrorMessage(res) <<             }

command = ;

BEGIN/COMMITThe command is used to separate the entire string into multiple transactions. Note thatPGresultThe structure only describes the result of the last command executed in the string ." No experiment is conducted here. If multiple transactions are involved in actual development, we recommend that you define different PQexec for execution. For complex businesses, you can consider using stored procedures or other methods.

        PGresult * * strSQL =         res =(PQresultStatus(res) !=<<  << PQresultStatus(res) <<            cout << PQresultErrorMessage(res) <<<<  << PQoidValue(res) <<*= PQexec(conn,(PQresultStatus(res_getallrows) !=<<  << PQresultStatus(res_getallrows) <<            cout << PQresultErrorMessage(res_getallrows) <<            cout <<  << PQntuples(res_getallrows) <<            cout <<  << PQnfields(res_getallrows) << fieldsCount =( fieldIndex = ;fieldIndex < fieldsCount;++<<  << fieldIndex <<  << PQfname(res_getallrows,fieldIndex) <<                cout <<  << fieldIndex <<  << PQfformat(res_getallrows,fieldIndex) <<                cout <<  << fieldIndex <<  << PQfmod(res_getallrows,fieldIndex) <<                cout <<  << fieldIndex <<  << PQfsize(res_getallrows,fieldIndex) <<<<  << PQfnumber(res_getallrows,) <<<<   << PQfnumber(res_getallrows,) <<             row_number = ,column_number = (!<<  << row_number <<  << column_number <<  << PQgetvalue(res_getallrows,row_number,column_number) <<        PQclear(res_getallrows);

At this point, you can use libpq to complete most of the daily development work of the EnterpriseDB (PostgreSQL Plus Advanced Server) database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.