From: | Sheikh Salman Ahmed <salman_sheikh(at)hotmail(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Query Problem |
Date: | 2008-07-05 23:04:13 |
Message-ID: | BAY109-W340FF7310701C51BCB2B09989A0@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Fellows
I still have problem to access my databank.It shows syntax problem,I am using VC++ 2005 with postgresql 8.3.My table name is Person and it has three column,Person ID,first name and last name (testing version).whole c++ code is
// Test_postgres.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "libpq-fe.h"
int _tmain(int argc, _TCHAR* argv[])
{
const char *conninfo;
PGconn *conn;
const char *paramtext = "server_version";
PGresult *res;
conninfo = "hostaddr = 127.0.0.1 dbname = Salman_db user = postgres password = 732047";
conn = PQconnectdb(conninfo);
if (PQstatus(conn) != CONNECTION_OK)
{
printf("Unable to establish connection: %s",
PQerrorMessage(conn));
return 1;
} else
{
res = PQexec(conn, "INSERT INTO public.Person VALUES (221,'Siddiqi','Umer')");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
printf("Problem with command: %s\n", PQerrorMessage(conn));
PQclear(res);
PQfinish(conn);
return 1;
}
PQclear(res);
}
PQfinish(conn);
return 0;
}
It shows no relation between public and person,if i write only person ,it show ,Person doesn't exist.
hope, u ppl can help me.
Sheikh Salman AhmedDiplomand in Nano Struktur TechnologieDuisburg-Essen UniversitätMobile : 0049-179-9463738Home :0049-203-3945028
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Frankel | 2008-07-05 23:40:18 | roll back to 8.1 for PyQt driver work-around |
Previous Message | Susan Crayne | 2008-07-05 22:16:57 | Installation problem -- another installation is in progress |