VB.NET(APP) - SQL problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nexusbr
    New Member
    • Dec 2007
    • 15

    VB.NET(APP) - SQL problem

    Hello all,

    i have Vb.net 2005 and firebird working perfectly.

    everything works fine, but this sql command:

    update y010new set cot_cus = (select cotacao_wrk2.pr ecoc from cotacao_wrk2 where cotacao_wrk2.co digo = y010new.codigo) where exists (select cotacao_wrk2.pr ecoc from cotacao_wrk2 where cotacao_wrk2.co digo = y010new.codigo)

    i've tried this on Ib Expert and it hang up forever, just like in .net..

    the table y010new have 18500 regs. and table cotacao_wrk2 have around 7k regs..

    what i'm trying to do is get some data from table cotacao_wrk2 and update table y010new with that data.
    hope someone can help me with this.. this is making me crazy..

    thanks in advance.
    Last edited by nexusbr; Dec 13 '07, 12:40 PM. Reason: Title Change
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Execute the inner query only and check if that executes and returns only one record.

    Comment

    • nexusbr
      New Member
      • Dec 2007
      • 15

      #3
      no, it returns all records that match the where clause.

      i use similar sql statements in other parts of the code and they work perfectly, only that one is not working, or taking too much time to complete. (i have waited for more then 5 minutes and nothing happened)...

      Comment

      • nexusbr
        New Member
        • Dec 2007
        • 15

        #4
        please, i'm still with that problem..

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Try debugging your query in Query Analyzer before trying to use it in your VB.NET code. It'll be easier to debug using this tool.

          Comment

          Working...