Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Posts
    8

    Unanswered: Stored Procedure

    STORED PROCEDURE to update H1 if the first query is true H2 if second query is true correspondingly the H3 and H4


    H1
    select client_input.CLIENTINPUTID from Client_input inner join Client_Temp on Client_input.SOURCE=Client_Temp.SOURCE
    where Client_input.ITEM=Client_Temp.ITEM and
    Client_input.[DESC]=Client_Temp.[desc] and
    Client_input.[mfg]=Client_Temp.[mfg] and
    Client_input.[mfgid]=Client_Temp.[mfgid] and
    Client_input.[pack]=Client_Temp.[pack] and
    Client_input.[uom]=Client_Temp.[uom] and
    Client_input.[cost]=Client_Temp.[cost]

    h2
    select client_input.CLIENTINPUTID from Client_input inner join Client_Temp on Client_input.SOURCE=Client_Temp.SOURCE
    where Client_input.ITEM<>Client_Temp.ITEM and
    Client_input.[DESC]<>Client_Temp.[desc] and
    Client_input.[mfg]=Client_Temp.[mfg] and
    Client_input.[mfgid]=Client_Temp.[mfgid] and
    Client_input.[pack]=Client_Temp.[pack] and
    Client_input.[uom]=Client_Temp.[uom] and
    Client_input.[cost]=Client_Temp.[cost]



    H3
    select client_input.CLIENTINPUTID from Client_input inner join Client_Temp on Client_input.SOURCE=Client_Temp.SOURCE
    where Client_input.ITEM=Client_Temp.ITEM and
    Client_input.[DESC]=Client_Temp.[desc] and
    Client_input.[mfg]<>Client_Temp.[mfg] and
    Client_input.[mfgid]<>Client_Temp.[mfgid] and
    Client_input.[pack]<>Client_Temp.[pack] and
    Client_input.[uom]<>Client_Temp.[uom] and
    Client_input.[cost]=Client_Temp.[cost]



    H4
    select client_input.CLIENTINPUTID from Client_input inner join Client_Temp on Client_input.SOURCE=Client_Temp.SOURCE
    where Client_input.ITEM=Client_Temp.ITEM and
    Client_input.[DESC]=Client_Temp.[desc] and
    Client_input.[mfg]<>Client_Temp.[mfg] and
    Client_input.[mfgid]<>Client_Temp.[mfgid] and
    Client_input.[pack]<>Client_Temp.[pack] and
    Client_input.[uom]<>Client_Temp.[uom] and
    Client_input.[cost]<>Client_Temp.[cost]

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    I have no idea what are you trying to accomplish. Anyway, what do you mean by "a query is true"?
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •