Oracle Query

oracle India
  • 14 years ago

    Dear Developers,

    I'm having a Oracle Query Shown below

    select
    a.id id,
    a.name name,
    a.types types,
    b.mrstatetreet_id mrstatetreet_id
    from
    mrstatet a,
    mrstatetreemapt b
    where 
    a.types != '2'
    and
    a.ISUSE != 0
    and
    a.id = b.mrstatet_id
    and
    b.mrstatetreet_id = :mrstatetreet_id
















    In this Query what is the purpose of using : symbol.

    iF i RUN THAT IT GIVES THE ERROR 

     'Bind variable "MRSTATETREET_ID" not declared.'

     Can u clarify me.

    Thanks in advance

    Regards,

    RAJU

  • 14 years ago

    Hi Raju

      you are making  a simple but avoidable mistake

    "b.mrstatetreet_id = :mrstatetreet_id"

     

    this is wrong syntax

    use

    b.mrstatestreet_id = a.mrstatetreet_id

    ":mrstatetreet_id" is a bind variable which you are now done.

    follows my way you will get a right result


     

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The question of whether computers can think is just like the question of whether submarines can swim.” - Edsger W. Dijkstra