473,811 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with exec sql include

Hello.

I have a 2 files: test.h and test.pgc.

In test.h, I defined:

typedef struct {
long curid;
char curnombre[20];
char curfecha[10];
} struct_cursor;

And, in test.pgc, I want to declare:

EXEC SQL BEGIN DECLARE SECTION;
struct_cursor t_cursor;
EXEC SQL END DECLARE SECTION;

But, when I do: ecpg -I/<include_file_p ath> test.pgc,
I get: test.pgc:7: ERROR: invalid datatype 'struct_cursor'

I know that I can include the typedef at DECLARE SECTION, but I don't
want to use that (test.h and test.pgc are only examples of the problem
bigest).

How can I resolve this?

Thanks.

CG
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #1
4 3120
On Wed, Nov 19, 2003 at 11:09:58AM -0300, Carmen Gloria Sepulveda Dedes wrote:
I know that I can include the typedef at DECLARE SECTION, but I don't
want to use that (test.h and test.pgc are only examples of the problem


ECPG does not parse anything outside EXEC SQL blocks, so how else should
it lear about your struct definition? You can of course use a EXEC SQL
TYPE command to define it for ECPG as well.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: me****@jabber.o rg
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #2
Thanks for you suggestion.

In the test.pgc file, I do:

EXEC SQL BEGIN DECLARE SECTION;
exec sql include test;
struct_cursor t_cursor;
EXEC SQL END DECLARE SECTION;

.... and it works fine. It is correct????

Thank you again.

CG

ECPG does not parse anything outside EXEC SQL blocks, so how else should
it lear about your struct definition? You can of course use a EXEC SQL
TYPE command to define it for ECPG as well.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #3
On Wed, Nov 19, 2003 at 12:26:07PM -0300, Carmen Gloria Sepulveda Dedes wrote:
In the test.pgc file, I do:

EXEC SQL BEGIN DECLARE SECTION;
exec sql include test;
struct_cursor t_cursor;
EXEC SQL END DECLARE SECTION;

... and it works fine. It is correct????


Depends on what test.h contains. ecpg has to learn the definition of
your struct somewhere.

Michael

--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: me****@jabber.o rg
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #4
On Wed, Nov 19, 2003 at 12:26:07PM -0300, Carmen Gloria Sepulveda Dedes wrote:
In the test.pgc file, I do:

EXEC SQL BEGIN DECLARE SECTION;
exec sql include test;
struct_cursor t_cursor;
EXEC SQL END DECLARE SECTION;

... and it works fine. It is correct????


Depends on what test.h contains. ecpg has to learn the definition of
your struct somewhere.

Michael

--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: me****@jabber.o rg
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #5

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

Similar topics

12
12896
by: Ghislain Benrais | last post by:
Hello, My "problem" : install php's XSLT API. 1)I installed Sablotron (with the rpm) : ok 2) I read every where that the next step was to compile php with option --with-xslt-sablot. Since I have php's rpm, I wonder if I can use it directly and tell the rpm command to use this compilation option. Is it possible ? If not, that's no problem since I can download php and compile, but still I'm wondering if rpms can be used with such options....
14
11687
by: Hemanth | last post by:
Hello there, I'm new to PHP. I'm trying to run a simple php script (on a Red hat linux machine with apache web server ) through a windows web browser (IE). I'm using an exec() function in my php script. The code is given below (with line numbers). 01 <?php 02 $output = exec("pwd");
6
3527
by: John Berman | last post by:
Hi the following works fine in an html page <!--#exec cgi="/cgi-bin/pr/pr_log.cgi"--> but not with an asp page include like
4
2449
by: TWEB | last post by:
I think I may have an IIS / ASP.Net Configuration issue that I need some guidance with resolving. Here's the problem: a) I have a .stm file. b) I referenc a .aspx file on this .stm file using a server-side-include directive: <!-- include virtual="../../foobar.aspx"--> c)When the .stm file is rendered: The .aspx file is included, but it doesn't look like the ASP.NET engine is processing the page, because I see the raw
0
2698
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 FOUND action to trigger an action when a query does not return a row. This does not seem to function. Here is the C program I tested: ----------------------------------------------------------------
4
1969
by: comp.lang.tcl | last post by:
I wrote this PHP function in the hopes that it would properly use a TCL proc I wrote about 4 years ago: if (!function_exists('proper_case')) { /** * Ths function will convert a string into a proper case format using the customized TCL proc "PROPER_CASE" from the included TCL string tools libraries * * @access public
27
5159
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set contents ]; close $fileID
2
2235
by: Hul Tytus | last post by:
comp.infosystems.www.authoring.html question about ssi's #exec Are there any obvious errors in the html or c code below? Without the #exec line in the html code, the text from pag1p1 and einst both show as would be expected. If the #exec line is included, the text from pag1p1 shows but not that from einst. However, the c code, which increments a long in fstcount, works fine - but nothing afterwards. This is being tested from one of...
2
1656
by: Danny Shevitz | last post by:
Howdy, In my app I need to exec user text that defines a function. I want this function to unpickle an object. Pickle breaks because it is looking for the object definition that isn't in the calling namespace. I have mocked up a simple example that shows the problem. Run this first code (from create_pickle.py) to create the pickle. create_pickle.py: (run this first)
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.