473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Pb with ecpg and include file on PG 8.0.0

Hi,

I have a set of libraries and C/C++ programs with embedded access to
a PG database. I'm using ecpg. I'm working on a Linux RedHat9 platform.

Until now I was in PG 7.4.2 :
[clipg@li SrcLib]$ ecpg --version
ecpg (PostgreSQL 7.4.2) 3.1.1
[clipg@li SrcLib]$ g++ --version
g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.

and without any problem.

I installed PG 8.0.0beta2 :
[clipg@li SrcLib]$ ecpg --version
ecpg (PostgreSQL 8.0.0beta2) 3.2.0

And if I try to recompile I find pre-compiled errors, variables which
are defined in an include file are not "seen".
Is there any known problem or bug about this ?

Detail :
======= Precompiling DbTablesFk.pgc =======

ecpg DbTablesFk.pgc -I/VALE/users/clipg/Server/Include -o DbTablesFk.cc
DbTablesFk.pgc:144: ERROR: trying to access an undeclared cursor MAX_FK

DbTablesFk.pgc:144: ERROR: syntax error at or near "IN"
and in the program :
....
EXEC SQL INCLUDE DbTablesUtilPg.hh;
....

EXEC SQL PREPARE S FROM :sqlstmt;
EXEC SQL DECLARE C_FK_COL CURSOR FOR S;
EXEC SQL OPEN C_FK_COL;
EXEC SQL FETCH MAX_FK IN C_FK_COL INTO :fk_id_L , :valid_L, :target_t_L;

with MAX_FK a variable defined in the file
/VALE/users/clipg/Server/Include/DbTablesUtilPg.hh :
exec sql define MAX_FK 100;

If I replace the MAX_FK variable by its value it's OK.
If I define the MAX_FK variable directly in the program (and not
in an include file) it's OK.

Any idea ? Thanks for all, Valerie.

************************************************** ******************
* Les points de vue exprimes sont strictement personnels et *
* n'engagent pas la responsabilite de METEO-FRANCE. *
************************************************** ******************
* Valerie SCHNEIDER Tel : +33 (0)5 61 07 81 91 *
* METEO-FRANCE / DSI/DEV Fax : +33 (0)5 61 07 81 09 *
* 42, avenue G. Coriolis Email : Va***************@meteo.fr *
* 31057 TOULOUSE Cedex - FRANCE http://www.meteo.fr *
************************************************** ******************
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
0 1371

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Slava Gorski | last post by:
Hi all, It seems that get diagnostics is not supported by ecpg in postgresql 7.3, I always get the following error when trying to use it: ERROR: parse error at or near "diagnostics" For...
2
by: Thierry Missimilly | last post by:
Hi, I'm not sure it's a bug or it's normal, so i don't send it to pgsq-bugs. Well, i have written pgbench in PRO*C to have a common pgbench.pgc source for Postgres and Oracle. However, there...
3
by: Carmen Gloria Sepulveda Dedes | last post by:
Hello. I have a problem with ecpg precompiler. In a code like: **** main() { .... some calls to EXEC SQL
3
by: Lynn.Tilby | last post by:
The following program produces the output below... It is built with: vrfy_prob: vrfy_prob.cpg /usr/local/pgsql/bin/ecpg -I/usr/local/pgsql/include -o vrfy_prob.c vrfy_prob.cpg gcc -g${DEBUG}...
3
by: Lynn.Tilby | last post by:
I am running 7.1.3... The docs for ecpg in 7.1.3 don't have the -e option in them! YET, ecpg -e WORKS!!! for solving the vacuum problem. Just WHAT does the -e option in ecpg do???? Thanks...
1
by: George Gensure | last post by:
I wanted to ask this on here before going any further. I've got functions that return rowsets, which from the psql shell require me to write selects with AS TBL( ... ) to define the return types....
0
by: Christian Rank | last post by:
Today I ran into problems when combining a C program with SQL statements with the ECPG interface of PostgreSQL: According to the documentation, it should be possible with EXEC SQL WHENEVER NOT...
0
by: Valerie Schneider DSI/DEV | last post by:
Hi, I have a set of libraries and C/C++ programs with embedded access to a PG database. I'm using ecpg. I'm working on a Linux RedHat9 platform. Until now I was in PG 7.4.2 : $ ecpg --version...
1
by: Richard Connamacher | last post by:
I was looking through the docs, ECPG looks like a great tool for developing client applications. Anyone know if it's possible to set it up for use with Objective C in XCode on Mac OS X? XCode...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.