Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    11

    Unanswered: 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?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Did you run the pre-compiler? Check out the Application Development Guide for details.

  3. #3
    Join Date
    Aug 2003
    Posts
    11
    Thanks! Marcus_A



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

    are you know!

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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

    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.

  5. #5
    Join Date
    Aug 2003
    Posts
    11
    Thanks

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

    Thanks All

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •