Re: SQL 'Like' operator

From: Bob Morrison <rmorrison_at_cahners.com>
Date: 1996/08/02
Message-ID: <320283BB.2F7C_at_cahners.com>#1/1


Atul Batra wrote:
>
> Hi all --
>
> Is it possible to use the LIKE operator using a host variable in
> PRO*C ?? I need to search VARCHAR fields with just the first few letters.
> Something like -
>
> SELECT ename
> FROM emp_table
> WHERE ename LIKE :host_variable ;
> /* 'host_variable' contains the string 'stev' and it should pull out
> 'steven'
> */
>
> Thanks in advance,
>
> Atul Batra
> abatra_at_unix1.sncc.lsu.edu

Try:

SELECT ename
FROM emp_table
WHERE ename LIKE :host_variable||'%' ;

Bob Morrison Received on Fri Aug 02 1996 - 00:00:00 CEST

Original text of this message