1 Reply Latest reply on May 30, 2006 1:28 PM by Newsgroup_User

    arca database xtra problem

    goth73
      i am using arca database xtra in director mx2004, for database utility and i want to join query and select data from table.
      i will try this query in arca database browser's execute sql tab and it's work proper but i don't understand which way i use this query in lingo.
      my script is in browser.....
      (select * from quiz where tpindex like "%2%" and qpath like "%Std06%")
      this command return data in browser.
      but how to use in lingo ?
      i have lingo script for single query is work fine that is as......
      --termToSearch = "%" & member("searchterm").text & "%"
      --sqlString = "select * from quiz where" && member("searchfield").text && "like ?"
      --currentSelection = gDb.createselection(sqlString,[termToSearch])
        • 1. Re: arca database xtra problem
          Level 7
          > i am using arca database xtra in director mx2004, for database utility and i
          > want to join query and select data from table.
          > i will try this query in arca database browser's execute sql tab and it's work
          > proper but i don't understand which way i use this query in lingo.
          > my script is in browser.....
          > (select * from quiz where tpindex like "%2%" and qpath like "%Std06%")
          > this command return data in browser.
          > but how to use in lingo ?
          > i have lingo script for single query is work fine that is as......
          > --termToSearch = "%" & member("searchterm").text & "%"
          > --sqlString = "select * from quiz where" && member("searchfield").text &&
          > "like ?"
          > --currentSelection = gDb.createselection(sqlString,[termToSearch])

          Though I'd like to help, I'm not sure I understand your problem. Can't
          you use something like:
          tSQL = "SELECT * FROM quiz WHERE tpIndex LIKE '%2%' AND qPath LIKE
          '%Std06%';"
          tSelection = gDb.createSelection( tSQL )

          Or perhaps, since you have 2 fields you're searching with LIKE clauses
          (and presumably 4 input sprites/members on your stage where your users
          can choose/enter these elements):
          tSQL = "SELECT * FROM quiz WHERE "
          tSQL = tSQL & member("searchField1").text & " LIKE '%"
          tSQL = tSQL & member("searchTerm1").text & "%' AND "
          tSQL = tSQL & member("searchField2").text & " LIKE '%"
          tSQL = tSQL & member("searchTerm2").text & "%';"
          tSelection = gDb.createSelection( tSQL )