HowTo: Precompiler / Embedded SQL


Prerequisites


All the files required to run the examples are contained in the directory $DEP/doc/FirstSteps/Precompiler.


Accessing SQL using the C Precompiler / Enbedded SQL

Hello, MaxDB
HelloMaxDB.cpc shows
  • how to connect to the database
  • how to execute SQL
  • how to fetch results
  • execute it as
    make && ./HelloMaxDB <sqluser> <password> <dbname> <host>
    The command line arguments are optional, the defaults will access the installed example database MAXDB1 with user MONA and password RED.