Re: SQL question - using LIKE

From: Lekan Busari <Lekan.Busari_at_DaytonOH.ATTGIS.COM>
Date: 1995/06/04
Message-ID: <D9nrqA.DM9_at_ranger.daytonoh.attgis.com>#1/1


Try this.
SELECT X.*
FROM schedules x, access y,field_access c WHERE USER IN
(SELECT ID

       FROM authorization a, member b
       WHERE  b.id = USER
        AND a.groupname = b.groupname
        AND a.object = 'SCHEDULES'
        AND a.function = 'SELECT')

AND y.object = 'SCHEDULES'
AND y.function = 'SELECT'
AND field_name = 'FISCAL_YR'
 AND function = 'SELECT'
 AND object = 'SCHEDULES'
AND x.fiscal_yr LIKE value||'%'

==========Pamela Miller, 6/2/95========== I'm trying to write a query using several subqueries. When using IN or '=' before the subquery, I get results. When using LIKE, Oracle comes back with ORA-00936: missing expression. Is there a way to use LIKE with a subquery? Thanks.

Here is the SQL statement.

SELECT X.*
FROM schedules x, access y
WHERE USER IN
(SELECT ID

       FROM authorization a, member b
       WHERE  b.id = USER
        AND a.groupname = b.groupname
        AND a.object = 'SCHEDULES'
        AND a.function = 'SELECT')
AND y.object = 'SCHEDULES'

AND y.function = 'SELECT'
AND x.fiscal_yr LIKE (SELECT value
  • - - the error message appears here
                                    FROM field_access
                                    WHERE field_name = 'FISCAL_YR'
                                    AND function = 'SELECT'
                                    AND object = 'SCHEDULES');
Received on Sun Jun 04 1995 - 00:00:00 CEST

Original text of this message