sql interface

Discussion in 'HTML' started by mpeters@nospammers.com, Feb 24, 2009.

  1. Guest

    Hello,

    I am sure this has been done lots of times but I can't seem to find some
    examples. I need to write an SQL interface that allows the user to
    specify fairly straightforward conditional clauses. Like,


    first_name='john' and age < 30


    I imagine I would have a list of field names on one side and a list of
    entry fields on the other where the user could specify the data. I
    guess the trick is how to let the user specify the connectors like
    "and", "or", or even put them in parentheses. I am thinking some
    Javascript library would come in handy here.


    Is there something like this that I can re-use or take as a starting point?
    , Feb 24, 2009
    #1
    1. Advertising

  2. Evertjan. Guest

    wrote on 24 feb 2009 in comp.lang.javascript:

    > Hello,
    >
    > I am sure this has been done lots of times but I can't seem to find
    > some examples. I need to write an SQL interface that allows the user
    > to specify fairly straightforward conditional clauses. Like,
    >
    >
    > first_name='john' and age < 30


    yes that can be part of a sql string

    > I imagine I would have a list of field names on one side and a list of
    > entry fields on the other where the user could specify the data. I
    > guess the trick is how to let the user specify the connectors like
    > "and", "or", or even put them in parentheses. I am thinking some
    > Javascript library would come in handy here.
    >
    > Is there something like this that I can re-use or take as a starting
    > point?


    You will first have to specify the platform you use.

    Serverside javascript, under ASP?
    Cscript/wscript?
    probably not clientside in a browser?
    on an open inernet connection?

    etc.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Feb 24, 2009
    #2
    1. Advertising

  3. Guest

    Evertjan. wrote:
    >
    > You will first have to specify the platform you use.
    >
    > Serverside javascript, under ASP?
    > Cscript/wscript?
    > probably not clientside in a browser?
    > on an open inernet connection?
    >



    This is on Windows XP, using MySQL as the database. The trick is that
    the condition will be specified by the user on the client side through
    the browser. Most of the action will take place on the client side.
    So, the interaction is:

    - user logs in
    - user sees a list of columns
    - with the browser, user enters simple "x=y" type conditions or combines
    those simple ones into larger ones using parentheses, "and", "or", etc.
    - user clicks on a button then, the whole condition gets processed, and
    results returned to the user via the browser.


    I guess the challenge is that we do not want to simply provide the user
    with a large text field to type in. We want to simplify it so that they
    can just click and enter a few data elements.


    We can use HTML, CSS, Javascript and AJAX.
    , Feb 24, 2009
    #3
  4. David Mark Guest

    On Feb 24, 12:32 pm, "Evertjan." <>
    wrote:
    >  wrote on 24 feb 2009 in comp.lang.javascript:
    >
    > > Hello,

    >
    > > I am sure this has been done lots of times but I can't seem to find
    > > some examples.  I need to write an SQL interface that allows the user
    > > to specify fairly straightforward conditional clauses.  Like,

    >
    > > first_name='john' and age < 30

    >
    > yes that can be part of a sql string
    >
    > > I imagine I would have a list of field names on one side and a list of
    > > entry fields on the other where the user could specify the data.  I
    > > guess the trick is how to let the user specify the connectors like
    > > "and", "or", or even put them in parentheses.  I am thinking some
    > > Javascript library would come in handy here.

    >
    > > Is there something like this that I can re-use or take as a starting
    > > point?

    >
    > You will first have to specify the platform you use.
    >
    > Serverside javascript, under ASP?
    > Cscript/wscript?
    > probably not clientside in a browser?


    Webkit has it. I use it in lieu of cookies whenever possible. Adds a
    lot of possibilities for offline apps.

    I imagine others will follow as it is part of some proposed standard.
    David Mark, Feb 24, 2009
    #4
  5. Evertjan. Guest

    wrote on 24 feb 2009 in comp.lang.javascript:

    > Evertjan. wrote:
    >>
    >> You will first have to specify the platform you use.
    >>
    >> Serverside javascript, under ASP?
    >> Cscript/wscript?
    >> probably not clientside in a browser?
    >> on an open inernet connection?
    >>

    >
    >
    > This is on Windows XP, using MySQL as the database. The trick is that
    > the condition will be specified by the user on the client side through
    > the browser. Most of the action will take place on the client side.
    > So, the interaction is:
    >
    > - user logs in
    > - user sees a list of columns
    > - with the browser, user enters simple "x=y" type conditions or combines
    > those simple ones into larger ones using parentheses, "and", "or", etc.
    > - user clicks on a button then, the whole condition gets processed, and
    > results returned to the user via the browser.
    >
    >
    > I guess the challenge is that we do not want to simply provide the user
    > with a large text field to type in. We want to simplify it so that they
    > can just click and enter a few data elements.
    >
    >
    > We can use HTML, CSS, Javascript and AJAX.


    Sorry, clientside databases are not my piece of cake.

    Perhaps David Mark, see the other post, can help you on?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Feb 24, 2009
    #5
  6. David Segall Guest

    wrote:

    >Hello,
    >
    >I am sure this has been done lots of times but I can't seem to find some
    >examples. I need to write an SQL interface that allows the user to
    >specify fairly straightforward conditional clauses. Like,
    >
    >
    >first_name='john' and age < 30
    >
    >
    >I imagine I would have a list of field names on one side and a list of
    >entry fields on the other where the user could specify the data. I
    >guess the trick is how to let the user specify the connectors like
    >"and", "or", or even put them in parentheses. I am thinking some
    >Javascript library would come in handy here.
    >
    >
    >Is there something like this that I can re-use or take as a starting point?


    Unless your users are similar to programmers, engineers or actuaries I
    think you should provide something much simpler. The filters in your
    news reader (Thunderbird) provide a good model. They have reduced the
    AND/OR/NOT and parentheses to a simple "match all" or "match any" of
    the following rules. The rules consist of a drop-down list of fields,
    a drop-down list of conditions and a value field. Augmented with a
    "search in results" facility I believe that you will satisfy any
    likely query. If anyone complains, provide the option to input the SQL
    :) I'm sorry, I don't know of any existing code that you can use to
    implement this.

    P.S. Are you aware that the cybersqatters at nospammers.com are
    dealing with the spam that this post might generate? If not, perhaps
    you should change your Usenet email address to conform with RFC2606
    <http://tools.ietf.org/html/rfc2606>.
    David Segall, Feb 25, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wildepiet
    Replies:
    0
    Views:
    1,850
    Wildepiet
    Jun 14, 2004
  2. cyberco
    Replies:
    8
    Views:
    480
    cyberco
    Feb 25, 2006
  3. Xah Lee
    Replies:
    15
    Views:
    573
    Sherm Pendley
    Mar 23, 2007
  4. Xah Lee
    Replies:
    15
    Views:
    620
    Sherm Pendley
    Mar 23, 2007
  5. ecoolone
    Replies:
    0
    Views:
    743
    ecoolone
    Jan 3, 2008
Loading...

Share This Page