Re: Help in using select ... where clauses

From: <mlanda_at_vnet.ibm.com>
Date: 1996/11/09
Message-ID: <562r06$10fc_at_watnews1.watson.ibm.com>#1/1


In <32837345.25E0_at_cdmi.com>, Carl Howard <choward_at_cdmi.com> writes:
>Please help. I'm a new Oracle user, using personal Oracle 7...
>I simply want to load values from an existing table to a new table but
>SQL keeps choking on such basic statements as
>
> where field1 = 'a_value'
>
>which seems like correct syntax from my reference books.
>This is my whole structure:
>
>create table t_list
>(
>p_name varchar2(80)
>p_text varchar2(80)
>);
>insert into t_list (p_name, p_text)
>select p_name, p_text
>from old_table
>where p_type = 'INI' ---or: "INI", (INI), INI, ('INI'), ---
>or like 'ini%', etc....
>and p_id != 141;
>
>P_type is a valid field in the source table, but SQL keeps flagging my =
>INI value, whether I use single quotes, double quotes, parenthesis or
>reconstruct the clause with a "like" rather than the "=" statement.
>These are the error messages I get:
>
> ORA-00904: invalid column name
> ORA-00911: invalid character
>
>Why doesn't SQL like this code?
>
>I would greatly appreciate any help. email me at choward_at_cdmi.com
> Carlos

insert into t_list (p_name, p_text)

select p_name, p_text
from old_table
where (p_type = 'INI' or p_type like 'ini%')
etc....
and p_id != 141;

M.Landa Received on Sat Nov 09 1996 - 00:00:00 CET

Original text of this message