connecting to the database - Mailing list pgsql-general

From viksa verma
Subject connecting to the database
Date
Msg-id afvktr$1tta$1@news.hub.org
Whole thread Raw
List pgsql-general
Hi,

I have some trouble making connection to the database.
This is what I use.

 EXEC SQL CONNECT TO
            tcp:postgresql://vikas.verma.com:5334/mydbname user vikasverma;

It works fine when I hard code the values like this.
But i want to use macros which i want to define in some other file and
include it.

Something like this

EXEC SQL CONNECT TO
    tcp:postgresql://DB_IP:DB_PORT/DB_NAME user USER;

where DB_IP,DB_NAME,DB_PORT etc are macros defined in some file which i will
include.

Please help with this.

Question 2
If i have to define something in an include file lets say

myheader.h
EXEC SQL DEFINE NUM 20;

then do i have to include this as EXEC SQL INCLUDE myheader.h or #include
myheader.h.


Vikas.



pgsql-general by date:

Previous
From: teknokrat@yahoo.com (teknokrat)
Date:
Subject: Can someone tell me if this is possible
Next
From: "Manuel W."
Date:
Subject: Re: PostgreSQL 7.2.1 on SuSE Linux with Coldfusion MX