Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2004
    Location
    Haaksbergen, Netherlands
    Posts
    69

    Unanswered: How to query a field with a value containing a character "&"

    Hi,

    When I make a simple query like:

    select * from table1 where field1 = 'A&B'

    Oracle asks me to enter a value for B.

    How to query a field with a value containing a character "&"

    Rgds,

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    It's not "Oracle" that asks you, but SQL*Plus.

    You need to turn off parameter replacement using the command "SET DEFINE OFF"

    More details are in the manual:
    http://download.oracle.com/docs/cd/B...htm#sthref1031
    http://download.oracle.com/docs/cd/B...htm#sthref2736

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If it is not SQL*Plus you are using (but some other (GUI) tool, such as TOAD or similar), there might be a (right-click) option named "Prompt for substitution variables" - you'd have to uncheck it.

  4. #4
    Join Date
    Jun 2004
    Location
    Haaksbergen, Netherlands
    Posts
    69
    Thanks,

    It is in SQL Nav.
    Deselecting the "& Scan Defines" by right clicking the mouse in the query pane helps.

    Thanks for your input.

    Wim Venema

  5. #5
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by Wim Venema View Post
    It is in SQL Nav.
    The next time you should include this important piece of information right from the start...

  6. #6
    Join Date
    Jun 2004
    Location
    Haaksbergen, Netherlands
    Posts
    69
    @shammat:

    Will do.
    Thanks anyway.

Posting Permissions

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