Thread: Simple query language

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    52

    Simple query language

    Hi guys,

    I came looking for some guidance on creating a simple query parser that will support ors.. and ands..
    The idea would be something like this.

    I specify the query like this

    Column1 Cat / Column2 Dog & Column 3 Rabbit --------- Where (/ is or) and (& is and)

    Anyone know if there is something like that already implemented somewhere, so that I can put it as a wrapper on a bigger program.

    Any help on this greatly appreciated,

    Ed.

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Wow. Ugg.

    No advice, other than to not reinvent the wheel. There are lot's of free relational databases out there that support a level of SQL that you would be hard pressed to match without months of an investment in time.

    And, just think - you could spend more time on your bigger program and not this grunt work.
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Yes, you can use SQL and connect it with C++ code. Like http://www.alhem.net/sql_cpp_tutorial/tut_1.html.
    So you can use MySQL for example, build a database and do whatever query you want with it with C++. Dunno and specific wrappers to recommend.

  4. #4
    Registered User
    Join Date
    Jul 2008
    Posts
    52
    Yes, you can use SQL and connect it with C++ code. Like http://www.alhem.net/sql_cpp_tutorial/tut_1.html.
    So you can use MySQL for example, build a database and do whatever query you want with it with C++. Dunno and specific wrappers to recommend.
    The problem is..
    Take it as this.. I already have the database which is an implemented algorithm.. I need a parser to pass the queries to this database.. I'm not using MySQL.. or an DBMS.. I just need to make my own parsing query language.

    Ed.
    Last edited by afflictedd2; 12-04-2008 at 05:33 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. d programming language - a better c++?
    By kypronite in forum Tech Board
    Replies: 12
    Last Post: 02-28-2011, 02:55 AM
  2. developing hash tables in the C Programming language
    By w108dab in forum C Programming
    Replies: 1
    Last Post: 05-20-2008, 11:20 AM
  3. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  4. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 01:20 AM
  5. Enough language discussions.
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 06-13-2004, 09:59 AM