In my SQL query, I used the WITH clause to construct a Common Table Expression (CTE)

1 Answer 143 Views
Data Source
jhonson
Top achievements
Rank 1
Iron
Iron
jhonson asked on 26 Apr 2023, 01:46 PM
I once noticed the error code "ORA-00933: SQL command not properly ended" while working on a project that required creating SQL queries in an Oracle database.

The problem occurred when I attempted to utilise the WITH clause in my SQL query to construct a Common Table Expression (CTE). The inquiry was written as follows:
WITH my_cte AS (
  SELECT *
  FROM my_table
)
SELECT *
FROM my_cte
WHERE id = 1;
When I attempted to run the query, however, I received the following error message:
ORA-00933: SQL command not properly ended
This error notice perplexed me because the syntax of my query appeared correct to me. So, I read this, which suggested changing the query in order to avoid utilizing the column alias in that subquery. Is that correct? I don't think this could work. Can someone help me out?

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 01 May 2023, 07:15 AM

Hello,

The described issue does not seem related to the Kendo components.

I would suggest taking a look at the following threads where such an issue is discussed:

https://stackoverflow.com/questions/41771967/sql-command-not-properly-ended-with-where-statement

- https://stackoverflow.com/questions/52073106/oracle-ora-00933-sql-command-not-properly-ended

https://confluence.atlassian.com/bitbucketserverkb/ora-00933-sql-command-not-properly-ended-error-while-starting-bitbucket-server-1086416714.html

I remain at your disposal in case you have any additional questions related to the Kendo components.

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Data Source
Asked by
jhonson
Top achievements
Rank 1
Iron
Iron
Answers by
Neli
Telerik team
Share this question
or