dbTalk Databases Forums  

Urgent (Pro*C++)

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Urgent (Pro*C++) in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
vihangtole@gmail.com
 
Posts: n/a

Default Urgent (Pro*C++) - 03-04-2008 , 02:29 AM






I am unable to compile my Pro*C++ program when i declare any host
variables/structures in header files. It seems that Pro*C++ only
accepts declaration placed inside the block
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;

But EXEC SQL statement are not allowed inside header files. Therefore
i am forced to include host structure / variable definitions in the
main program.

But i want to access these structure across different programs. I am
forced to include these definitions in each program as i cant include
them inside header file.

Pro*C allows you to declare host structure / variables anywhere
(header files / program).
But i think Pro*C++ has above mentioned restriction.

Is there any way out???
Please help me.

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Urgent (Pro*C++) - 03-04-2008 , 05:21 AM






vihangtole (AT) gmail (DOT) com <vihangtole (AT) gmail (DOT) com> wrote:
Quote:
I am unable to compile my Pro*C++ program when i declare any host
variables/structures in header files. It seems that Pro*C++ only
accepts declaration placed inside the block
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;

But EXEC SQL statement are not allowed inside header files. Therefore
i am forced to include host structure / variable definitions in the
main program.

But i want to access these structure across different programs. I am
forced to include these definitions in each program as i cant include
them inside header file.

Pro*C allows you to declare host structure / variables anywhere
(header files / program).
But i think Pro*C++ has above mentioned restriction.

Is there any way out???
I haven't tried it, but maybe the EXEC SQL INCLUDE can help you.

According to the documentation, it will include the header file into
the C source during the precompile step, so you can have any embedded
SQL statements in a file that is included that way.

Yours,
Laurenz Albe


Reply With Quote
  #3  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Urgent (Pro*C++) - 03-04-2008 , 05:21 AM



vihangtole (AT) gmail (DOT) com <vihangtole (AT) gmail (DOT) com> wrote:
Quote:
I am unable to compile my Pro*C++ program when i declare any host
variables/structures in header files. It seems that Pro*C++ only
accepts declaration placed inside the block
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;

But EXEC SQL statement are not allowed inside header files. Therefore
i am forced to include host structure / variable definitions in the
main program.

But i want to access these structure across different programs. I am
forced to include these definitions in each program as i cant include
them inside header file.

Pro*C allows you to declare host structure / variables anywhere
(header files / program).
But i think Pro*C++ has above mentioned restriction.

Is there any way out???
I haven't tried it, but maybe the EXEC SQL INCLUDE can help you.

According to the documentation, it will include the header file into
the C source during the precompile step, so you can have any embedded
SQL statements in a file that is included that way.

Yours,
Laurenz Albe


Reply With Quote
  #4  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Urgent (Pro*C++) - 03-04-2008 , 05:21 AM



vihangtole (AT) gmail (DOT) com <vihangtole (AT) gmail (DOT) com> wrote:
Quote:
I am unable to compile my Pro*C++ program when i declare any host
variables/structures in header files. It seems that Pro*C++ only
accepts declaration placed inside the block
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;

But EXEC SQL statement are not allowed inside header files. Therefore
i am forced to include host structure / variable definitions in the
main program.

But i want to access these structure across different programs. I am
forced to include these definitions in each program as i cant include
them inside header file.

Pro*C allows you to declare host structure / variables anywhere
(header files / program).
But i think Pro*C++ has above mentioned restriction.

Is there any way out???
I haven't tried it, but maybe the EXEC SQL INCLUDE can help you.

According to the documentation, it will include the header file into
the C source during the precompile step, so you can have any embedded
SQL statements in a file that is included that way.

Yours,
Laurenz Albe


Reply With Quote
  #5  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Urgent (Pro*C++) - 03-04-2008 , 05:21 AM



vihangtole (AT) gmail (DOT) com <vihangtole (AT) gmail (DOT) com> wrote:
Quote:
I am unable to compile my Pro*C++ program when i declare any host
variables/structures in header files. It seems that Pro*C++ only
accepts declaration placed inside the block
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL END DECLARE SECTION;

But EXEC SQL statement are not allowed inside header files. Therefore
i am forced to include host structure / variable definitions in the
main program.

But i want to access these structure across different programs. I am
forced to include these definitions in each program as i cant include
them inside header file.

Pro*C allows you to declare host structure / variables anywhere
(header files / program).
But i think Pro*C++ has above mentioned restriction.

Is there any way out???
I haven't tried it, but maybe the EXEC SQL INCLUDE can help you.

According to the documentation, it will include the header file into
the C source during the precompile step, so you can have any embedded
SQL statements in a file that is included that way.

Yours,
Laurenz Albe


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.