Questions tagged [ora-00928]

ORA-00928: missing SELECT keyword

Error: ORA-00928: missing SELECT keyword

Cause: A SELECT subquery must be included in a CREATE VIEW statement.

Action: Correct the syntax. Insert the required SELECT clause after the CREATE VIEW clause and then retry the statement.

Useful links:

13 questions
17
votes
1 answer

Oracle -- WITH CLAUSE => MERGE? (Syntax error, )

I'm trying to get the WITH clause to work with merge in Oracle, but for some reason I can't get it working. I'm sure it is something obvious, but I just haven't seen it. -- behold, the wonders of fake data WITH X AS ( SELECT 'moo' AS COW, …
cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
12
votes
3 answers

Oracle DELETE statement with subquery factoring

Trying to do this (works in SQL Server): WITH X AS (), Y AS (), Z AS () DELETE FROM TBL WHERE TBL.ID IN (SELECT ID FROM Z); This works in Oracle: WITH X AS (), Y AS (), Z AS () SELECT * FROM TBL WHERE TBL.ID IN (SELECT ID FROM Z); But the DELETE…
Cade Roux
  • 88,164
  • 40
  • 182
  • 265
9
votes
5 answers

"ORA-00928: missing SELECT keyword" error while using sequence function

Sorry I am new to SQLPlus stuffs! So here, I have a table called iowe, i have a four records pre-loaded into it. This is how it looks like: NAME AMOUNT Serial Number ---------- ---------- ------------- Praveen 20500 …
Anonymous Person
  • 1,437
  • 8
  • 26
  • 47
8
votes
6 answers

java.sql.SQLException: ORA-00928: missing SELECT keyword. when inserting record to DB using JDBC

I get an error when I try to insert some rows to a db. so here is the code try { String insertStmt = "INSERT into " + "MY_TABLE('RECORD_TYPE', 'FILE_TYPE', 'DATE', 'BATCH_NO', 'RECORD_COUNT')" + …
chip
  • 3,039
  • 5
  • 35
  • 59
5
votes
1 answer

Oracle CTE Merge

I am trying a simple merge statement using a CTE(Common table expression) . But it gives an error MERGE INTO emp targ USING ( * ERROR at line 4: ORA-00928: missing SELECT keyword Is the CTE not allowed in a merge statement? My Sql is below: WITH…
josephj1989
  • 9,509
  • 9
  • 48
  • 70
2
votes
0 answers

Using ORGANIZATION EXTERNAL to load a dataset from csv on sql developer (oracle)

I am following a course and I got this script below that I should execute: ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY extdir ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE SKIP 1 BADFILE…
Catarina Nogueira
  • 1,024
  • 2
  • 12
  • 28
2
votes
1 answer

Using "WITH AS" keywords when migrating data in SQL

Is it possible to do this in SQL? If I remove the INSERT statement the SELECT works, if I have the insert Oracle complains that "missing SELECT keyword". WITH tmpdata AS ( //SOME arbitrary select statement ) INSERT INTO myTable (someId, somevalue,…
benstpierre
  • 32,833
  • 51
  • 177
  • 288
1
vote
3 answers

ORA-00928: missing SELECT keyword while referencing other tables

I am trying to run this code: ` with cart_amount as (select customer_id, count(customer_id) "Count" from in_cart group by customer_id) with order_amount as (select customer_id, count(customer_id) "Count" from in_order group by customer_id) select…
Tom
  • 11
  • 1
0
votes
2 answers

Is the following code valid? I am getting errors.

CREATE OR REPLACE VIEW POINTS AS DECLARE avgDurationOurFault number(5); avgDurationCustomersFault number(5); avgDuration number(5); BEGIN (select ceil(avg(abs(total_time))) into avgDuration from inquiry); select…
indolent
  • 3,053
  • 5
  • 23
  • 21
0
votes
3 answers

ORA-00928: missing SELECT keyword

In MYTABLE there are courses and their predecessor courses. What I am trying to is to find the courses to be taken after the specified course. I am getting missing SELECT keyword error. Why I am getting this error although I have SELECT statement in…
asdfg
  • 89
  • 4
  • 17
0
votes
1 answer

Getting Error trying to do "horizontal partitioning"

CREATE TABLE "Ticket_particije" ( ticket_id number, datum_kreiranja_ticketa date, zalba_id number, prodavac_id number, pristupni_ugovor_id number, constraint pk_ticketparticije primary key (ticket_id), constraint…
0
votes
3 answers

Java - output array without its formatting

I am writing an app that allows the user to create custom SQL queries with user input. I add the falue from each JTextFields to the array using for(JTextField field : fields){ if (!field.getText().equals("")){ rows.add(field.getText()); …
slex
  • 855
  • 2
  • 10
  • 20
-4
votes
1 answer

ORA-00928: missing SELECT keyword when inserting data

I am trying to insert data into database but I am getting this exception: java.sql.SqlException:[Oracle][ODBC]ORA-00928:missing SELECT keyword
Deepa
  • 27
  • 1
  • 1
  • 2