Skip to content
Advertisement

From keyword not found where expected error in oracle

Need to create a temporary table employee by inserting values from already created table person which belongs to people database but getting error from keyword not found where expected

Advertisement

Answer

You’d then use CTAS (Create Table As Select), not an invalid INTO clause; it is used for different purposes.


Based on comment you posted, there are several options you might want to consider.

One is to create a permanent table (just like the above example shows). If you’ll reuse it, then – in your procedure – first delete its contents (or truncate the table as it is way faster), and then re-populate it:

Another option is to create a true temporary table, e.g.

Whenever you need data in it, just insert it:

Doing so, its contents will be visible only to you (and nobody else), while table’s contents will be kept during the transaction or session (it depends on how you created it – see the on commit preserve/delete rows clause).

What you should not do is to create the table, drop it, then create it again, and so on – in Oracle, we create table once and use it many times.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement