Re: Passing Parameters to Query in Query Builder

From: Chris <c.beltz_at_chartermichigan.net>
Date: Wed, 8 Oct 2003 17:53:00 -0400
Message-ID: <vo91kia8r029f4_at_corp.supernews.com>


Steve,
Bingo ... needed to prefix the parameter name with a colon in the condition box.

Thanks,

Chris

"Steven C. Kondolf" <skondolf_at_garbage.rochester.rr.com> wrote in message news:uqa6ov4mu5hton86b6cmpbaskan2bk94h3_at_4ax.com...
> I'm not at a pc w/query builder right now so I'm typing this from
> memory but a 'parameter' choice exists in one of the menu choices
> across the top of the window, I just can't remember which one. It may
> also matter if you have the query or results window highlighted. I
> have many queries created with parameters. You can also create the
> query and put in a parameter in the where clause which will
> automatically build the parameter. Then when you run the query you'll
> get a popup asking for the value. When you enter the parameter in the
> where clause you have to define it with a colon i.e. foo=:bar. This
> will create a parameter named bar. Once defined you can go in and
> enter some descriptive text and default values if you want.
>
> On Mon, 6 Oct 2003 21:03:29 -0400, "Chris"
> <c.beltz_at_chartermichigan.net> wrote:
>
> >"Hans Forbrich" <forbrich_at_yahoo.net> wrote in message
> >news:3F81FC9D.8B7D88BD_at_yahoo.net...
> >> Chris wrote:
> >>
> >> > All,
> >> > I'm new to Oracle, and I have been getting familiar with Query
Builder.
> >The
> >> > interface is pretty intuitive. The only thing I cannot figure out is
> >how to
> >> > create prompts for parameters to pass to the WHERE criteria. I have
> >> > discovered how to create the parameters (name, prompt and default
> >value),
> >> > but I cannot figure out how to add them to the WHERE criteria text
boxes
> >(in
> >> > the left pane of the Query window) without getting a syntax error.
> >> >
> >> > Valid syntax used in SQL*Plus:
> >> >
> >> > SELECT field FROM table WHERE field LIKE &parameter;
> >> >
> >> > does not seem to be valid in Query Builder, because I get a syntax
> >error,
> >> > with the ampersand highlighted.
> >>
> >> &parameter is used for 'substituting user parameters'. The actual
> >statement in
> >> pure SQL generally requires a string literal - but you can use wildcard
> >> characters (eg: % is multi-char wildcard). So you would use
> >>
> >> SELECT field FROM table WHERE field LIKE 'ABC%';
> >>
> >> to get anything starting with ABC (note case sensitivity).
> >>
> >> There is a lot more described in the docco
> >
> >I understand this. I think there is a disconnect ... I am talking
> >specifically about using the Query Builder GUI tool (not a statement at
the
> >SQL> prompt in SQL*Plus) which allows one to create parameters by giving
> >them a name, prompt and default value.
> >Using your SQL above, I want to be able to open the query in Query
Builder,
> >have it prompt me for a value, enter the value "ABC%" and have it
construct
> >the WHERE criteria just as you have written.
> >
> >>
> >> >
> >> > I cannot read the manual, because the help files have not been
> >installed,
> >> > and I could not find any documentation at http://otn.oracle.com. Can
> >anyone
> >> > help? Thank you greatly.
> >> >
> >>
> >> You didn't notice the 'Documentation' icon at the top of the page? In
any
> >case,
> >> you can jump right into the OTN Docs area using http://docs.oracle.com,
or
> >use
> >> http://tahiti.oracle.com for a slightly different access. (Both
require a
> >valid
> >> OTN userid).
> >
> >Of course, but I did not find any documentation for Query Builder. Did
you
> >try searching for documentation for Query Builder? If so, did you find
any?
> >If so, could you please post it?
> >
> >Chris
> >
> >> --
> >> /Hans
> >> [mailto:`echo $from" | sed "s/yahoo/telusplanet/g"`]
> >>
> >>
> >
>
> Peace,
> Steve
> skondolf_at_garbage.rochester.rr.com
Received on Wed Oct 08 2003 - 23:53:00 CEST

Original text of this message