Parameter in a Query???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Reshmi Jacob
    New Member
    • Sep 2006
    • 50

    Parameter in a Query???

    Hello

    I am a beginner in Oracle!!!

    I would like to know....I have a table

    STOCK
    -----------
    Branch varchar2(2)
    TrnType number
    KEYNo varchar2(2)
    Quantity number

    In the above primary key is Branch + TrnType + KeyNo

    I have a query

    SELECT Branch,TrnType, KEYNo,Quantity from STOCK where Branch = 'IND';

    My problem is the value for Branch ie. IND is known at runtime only and I need to store this query in Database. If I store it as a view I can only select records with branch code IND.

    What method I can use to retrieve the records which satify the above condition....(P ROCEDURES, CURSOR if so how????)


    Thanks & Regards
    Reshmi
  • saravanankm
    New Member
    • Jul 2006
    • 47

    #2
    Hi!

    Procedure is better For u. Because Passing value in parametter Branch
    u can Select multiple branch Through Executing This procedure....


    By
    Captain

    Comment

    • Reshmi Jacob
      New Member
      • Sep 2006
      • 50

      #3
      Hi Captain!!!

      Thanks and I will try with it!!!

      Regards
      Reshmi

      Comment

      Working...