Re: Trying to run a SELECT...INTO SQL Command

From: marc bowden <marc_at_otbbb.demon.co.uk>
Date: Sun, 11 Oct 1998 06:00:35 GMT
Message-ID: <362047ce.77062960_at_news.demon.co.uk>


Hi Peter

>When I run this SQL Command through the SQL tool in Oracle, I get the error
>below it:
>
>SELECT tsp.TSP_COMPONENTS.ID AS LEVEL0ID, tsp.TSP_COMPONENTS.NAME AS
>LEVEL0NAME, tsp.TSP_COMPONENTS.ABBREVIATION AS LEVEL0Abbreviation INTO
>tsp.Level_0
>FROM tsp.TSP_COMPONENTS
>WHERE (((tsp.TSP_COMPONENTS.COMPONENT_LEVEL)=0));
>
>
>Error Message.
>
>ORA-00905: missing keyword
>
>This syntax works correctly with Ms SQL and Access, why should Oracle work
>differently...
>
>I want the INTO command to put INTO a new table called TSP.LEVEL_0.

Why should one manufacturer's product not be compatible with another's?? I am just trying to choose a hifi amp and CD player and am asking myself the same question. Why are some amps black, others grey and some are cylindrical while others have no phono socket ........ haven't you heard the expression '... variety is the spice ... ' ......? :-;

Anyway, the answer to your q. is when you want to create and simultanepusly populate 1 table from another do something of the form:

  create newtablename
  as
  select columnlist
  from oldtablename
  where validwhereclause | invalidwhereclause.

Using a normal whereclause will populate the table; using a deliberately invalid cluaes ( where 1=2 eg ) will create the table without population.

A Bientot
Marc Received on Sun Oct 11 1998 - 08:00:35 CEST

Original text of this message