-2

As in I just want to execute a query with a comment.

Example:

/*Selects all columns and rows*/
SELECT * FROM "SNAPLOGIC"."CUSTCOMM1"

or

-- comment
select * from "SNAPLOGIC"."CUSTCOMM1"

Can we execute in Oracle SQL?

Note: These statements can be executed in tools like DBeaver.

Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58
  • Madhu, was the `or` supposed to be included in the code or not? – jarlh Apr 15 '19 at 13:30
  • 3
    Do you have a reason to think you can't have a comment immediately before a statement? Have you experienced a problem in a specific client (and version)? (I wonder if you're seeing a variaion [of this behaviour](https://stackoverflow.com/a/43113278/266304) maybe?) – Alex Poole Apr 15 '19 at 13:36
  • What happened when you tried? –  Apr 15 '19 at 13:44
  • I got this error message if i execute in an application-- SQL operation failed, Reason: invalid batch command: invalid SELECT batch command 0, error code: 17080 – Madhu Pasham Apr 16 '19 at 06:18
  • "in an application" - which application, and how are you executing it? The comment isn't part of the statement, and it sounds like whatever you're using isn't expecting to see it. Context is everything though... – Alex Poole Apr 16 '19 at 13:14

1 Answers1

0

The first line is a comment above your query.

If there is an error message displaying, the lack of spaces could be the cause.

/* Selects all columns and rows */
SELECT * FROM "SNAPLOGIC"."CUSTCOMM1"
  • Iam getting this error message when executed:-- SQL operation failed, Reason: invalid batch command: invalid SELECT batch command 0, error code: 17080 – Madhu Pasham Apr 16 '19 at 06:19