SQL oriented scripting language that can be executed from a C++ code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michal O

    SQL oriented scripting language that can be executed from a C++ code

    Hi.
    I have to write a C++ code that invokes a set of SQL statements
    (inserts, updates, selects etc.),
    according to the system administrator's directives.

    The directives should be written as a simple script.

    In addition to the SQL statements invocation,
    the script should enable using query results as an input to other SQL statements,
    and should be able to handle multiple query results.
    The script writer should be able to access informaion from the C++ program.

    Do you have any recommendation for a suitable scripting language,
    that is well integrated with C++?
    (I used to work with Java-->Jython and Iv'e been thinking of something similar,
    but for C++, and more SQL oriented).
    Thanks.

    [ See http://www.gotw.ca/resources/clcm.htm for info about ]
    [ comp.lang.c++.m oderated. First time posters: Do this! ]
  • Evan Carew

    #2
    Re: SQL oriented scripting language that can be executed from a C++code

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Part of every standard DBMS installation is something called an embedded
    compiler (really, an embedded precompiler). This takes your C or C++
    code & compiles it with the appropriate vendor's C library calls based
    on the simplified SQL scripts you embedded in your code. For an example
    of this, have a look at PostgreSQL's embedded compiler.

    Evan

    Michal O wrote:[color=blue]
    > Hi.
    > I have to write a C++ code that invokes a set of SQL statements
    > (inserts, updates, selects etc.),
    > according to the system administrator's directives.
    >
    > The directives should be written as a simple script.
    >
    > In addition to the SQL statements invocation,
    > the script should enable using query results as an input to other SQL statements,
    > and should be able to handle multiple query results.
    > The script writer should be able to access informaion from the C++ program.
    >
    > Do you have any recommendation for a suitable scripting language,
    > that is well integrated with C++?
    > (I used to work with Java-->Jython and Iv'e been thinking of something similar,
    > but for C++, and more SQL oriented).
    > Thanks.
    >
    > [ See http://www.gotw.ca/resources/clcm.htm for info about ]
    > [ comp.lang.c++.m oderated. First time posters: Do this! ][/color]

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.6 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFBUiKpoo/Prlj9GScRAhqQAJ 4qPkai/MrzDlqcsvxWtDRR bX6jcwCfeHJa
    lIIKbWJHsM+K94e UNpxbPd8=
    =qCBx
    -----END PGP SIGNATURE-----

    Comment

    • Kurt Krueckeberg

      #3
      Re: SQL oriented scripting language that can be executed from a C++ code

      [color=blue]
      > Hi.
      > I have to write a C++ code that invokes a set of SQL statements
      > (inserts, updates, selects etc.),
      > according to the system administrator's directives.
      >
      > The directives should be written as a simple script.
      >
      > In addition to the SQL statements invocation,
      > the script should enable using query results as an input to other SQL
      > statements,
      > and should be able to handle multiple query results.
      > The script writer should be able to access informaion from the C++
      > program.
      >
      > Do you have any recommendation for a suitable scripting language,
      > that is well integrated with C++?
      > (I used to work with Java-->Jython and Iv'e been thinking of something
      > similar,
      > but for C++, and more SQL oriented).
      > Thanks.[/color]

      I don't now if this helps, but if you use MySql as the database, it has a
      C++ API.



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.m oderated. First time posters: Do this! ]

      Comment

      • Costa B.

        #4
        Re: SQL oriented scripting language that can be executed from a C++ code

        I think you should provide more details. Do you want to implement a client
        SQL interpreter? Various DBMS systems provide several interfaces, from ODBC
        to low level API or the dreaded OLE DB. There are also a bunch of client
        libraries C++ that wrap ODBC or driver specific API in a more unified way.
        One of them is source pro db from roguewave
        http://www.roguewave.com/products/sourcepro/db/ and another one, cheaper,
        is sql api: http://www.sqlapi.com/

        On the other hand several DBMS systems provide a SQL language that you can
        use to write scripts to do whatever you want: Oracle has PL/SQL, SQL Server
        has Transact-SQL etc.

        Costa

        "Michal O" <michalo@gmail. com> wrote in message
        news:4612f134.0 409220114.826e0 00@posting.goog le.com...[color=blue]
        > Hi.
        > I have to write a C++ code that invokes a set of SQL statements
        > (inserts, updates, selects etc.),
        > according to the system administrator's directives.
        >
        > The directives should be written as a simple script.
        >
        > In addition to the SQL statements invocation,
        > the script should enable using query results as an input to other SQL[/color]
        statements,[color=blue]
        > and should be able to handle multiple query results.
        > The script writer should be able to access informaion from the C++[/color]
        program.[color=blue]
        >
        > Do you have any recommendation for a suitable scripting language,
        > that is well integrated with C++?
        > (I used to work with Java-->Jython and Iv'e been thinking of something[/color]
        similar,[color=blue]
        > but for C++, and more SQL oriented).[/color]


        [ See http://www.gotw.ca/resources/clcm.htm for info about ]
        [ comp.lang.c++.m oderated. First time posters: Do this! ]

        Comment

        Working...