If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Embeded SQL statement in C/C++ but compile error!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-03, 02:42
kidder_whw kidder_whw is offline
Registered User
 
Join Date: Aug 2003
Posts: 11
Embeded SQL statement in C/C++ but compile error!

Embeded SQL statement in C/C++ but compile error?

sample, install DB2 NT:

#include <sql.h>
#include <sqlenv.h>
#include <sqlca.h>
#include <sqlda.h>


EXEC SQL INCLUDE SQLCA;

EXEC SQL BEGIN DECLARE SECTION;
char dbAlias[15];
char dbUser[129];
char dbPswd[15];
EXEC SQL END DECLARE SECTION;

int main()
{
.....
}


RE: compile error!
error C2146: syntax error : missing ';' before identifier 'SQL'
error C2501: 'EXEC' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found

Why?
Reply With Quote
  #2 (permalink)  
Old 10-29-03, 02:47
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Did you run the pre-compiler? Check out the Application Development Guide for details.
Reply With Quote
  #3 (permalink)  
Old 10-29-03, 02:59
kidder_whw kidder_whw is offline
Registered User
 
Join Date: Aug 2003
Posts: 11
Thanks! Marcus_A



yes!
I have no document about the Embeded SQL Application Development Guide.

are you know!
Reply With Quote
  #4 (permalink)  
Old 10-29-03, 03:09
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
You will find link to the db2 manuals(an much more) in the 'Useful DB2 Stuff' at the top of the forum

The starting point is www.ibm.com/db2/library

Sathyaram

Quote:
Originally posted by kidder_whw
Thanks! Marcus_A



yes!
I have no document about the Embeded SQL Application Development Guide.

are you know!
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 10-29-03, 03:38
kidder_whw kidder_whw is offline
Registered User
 
Join Date: Aug 2003
Posts: 11
Thanks

I know
Pre-compile
step1->> Edit
step2->> "Precompiling"
step3->>"Compiling and Linking"
step4->>"Binding"

Thanks All
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On