Re: Query Builder Syntax Help Needed

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Wed, 02 Feb 2005 09:51:55 -0800
Message-ID: <1107366552.656514_at_yasure>


SteveOz wrote:

> Hi from a newbie,
>
> I hope I'm in the right place. I build queries in Query Builder and, in
> general, have no resources to compare my syntax and would love to find a
> resource (maybe with actual examples).
>
> Specifically, I am trying to find a way to search a field (char (500) or
> something) for a string that arrives by prompt. I've defined a query
> parameter that accepts a keyword for searching but can't get the syntax
> straight. This is where I am:
>
> db.application.project_title LIKE :keyword
>
> I don't know what function to use or how to incorporate the wildcard '%' on
> either end. Can you help?
>
> :) Steve

Well my first suggestion would be to get out of Query Builder so that you really have a learning experience. My second would be that a CHAR(500) is a horrible idea and should be remodeled as a VARCHAR2. That said ... what you want is to learn to use the SUBSTR and INSTR built-in functions. Demos of them are available by going to http://www.psoug.org
click on Morgan's Library
click on SUBSTR or INSTR (as both are on the same web page)

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Feb 02 2005 - 18:51:55 CET

Original text of this message