0

In IBM SQL Query, simple table creation query is not working, its give error - No viable alternative at input 'CREATE TABLE'

No viable alternative at input 'CREATE TABLE'

I take query(for create table) from official site and its also give the same error.

Attached below (official site query) screenshot url
https://i.ibb.co/n78BrPd/officalsiteexample.png

Community
  • 1
  • 1
Gaurav Sharma
  • 51
  • 1
  • 11
  • Please provide a [mcve]. – Yunnosch Jun 09 '19 at 05:40
  • i already attached link for more clarification https://i.stack.imgur.com/BwoMb.png – Gaurav Sharma Jun 09 '19 at 05:48
  • 1
    Ah sorry. I should have been more specific. Please provide a MCVE here directly, as text, not as a picture of text. That makes helping you easier. Be sure to double check that the text you use is free of any "funny" characters. As far as I can tell, it is valid SQL. So errors for it are surprising (obviously that is why you are asking...). Double check that you have no unusual characters in there, e.g. non-printables or Unicode lookalikes. – Yunnosch Jun 09 '19 at 05:53
  • 1
    Keeping the picture might be a good idea however. I think it might help others (with experience in that GUI) to spot possible problems in how you use the SQL. So I made it visible for you. – Yunnosch Jun 09 '19 at 05:55
  • Possible duplicate of [Amazon Athena: no viable alternative at input](https://stackoverflow.com/questions/40912086/amazon-athena-no-viable-alternative-at-input) – Yunnosch Jun 09 '19 at 05:58
  • I proposed a duplicate with many alternative answers. Please check an explain whether/why none of them is helpful. – Yunnosch Jun 09 '19 at 05:59
  • even I did same as official website in mention IBM, also have the same error [screenshot link =>] https://i.ibb.co/L1TdJdm/Ibm-site-create-table.png – Gaurav Sharma Jun 09 '19 at 06:02
  • Sure, but in a place where it looks like it's explicitly for "queries" rather than generic statements? – nitind Jun 09 '19 at 11:56
  • I do not understand "attached second screenshot query that is offical site in given also give same error". I don't get what you are saying. And since you formatted it as quote I'd normally guess that you are quoting from somewhere. But it somehow seems more your posting style than anythig quote-worthy. Could you rephrase that? I think even without perfect grammar, it might get much clearer if you use more than one sentence. Maybe separate the sentences using some punctuation. Is there anybody nearby who could help with the language difficulties? – Yunnosch Jun 09 '19 at 18:48
  • By the way. It would not be possible that the field/GUI-part you are using is only for actually querying for data - i.e. not for changing or adding to the database structure? – Yunnosch Jun 09 '19 at 18:50
  • @Yunnosch, I put everything with all clarification and there is no language specific difficulties. Ibm cloud is not your field that's the only reason. you do not understand technical term. – Gaurav Sharma Jun 10 '19 at 07:22
  • Hmmm. Then it is probably my language skills that hinder me. Please help me out. Do you mean "I attached a screenshot of my attempt to use a table-creating query in the same way and with the same error. The query I got from the official site." I am not sure what keeps me from seeing the URL or any other reference to show which part of which official site you are referring to. Maybe that is a detail you could add, on top of "all clarification" you already provided. – Yunnosch Jun 10 '19 at 07:31
  • And I stay with what I said: Providing clarification and detailed information is of course good. Even better though would be to provide all textual information as text, not as picture. If you think that a picture carries information on top of the text shown in it (e.g. GUI elements...) then of course keep the picture. But text is simply better recevied in this community, because it can much more conveniently be used for making answers. And it is the effort of people trying to help you which you want to minimise, not your own. – Yunnosch Jun 10 '19 at 07:36

1 Answers1

0

The IBM SQL Query service allows you to run queries (SELECT statements) against data. The syntax reference only has SELECT, not CREATE TABLE. Thus, seeing the syntax error is expected.

data_henrik
  • 16,724
  • 2
  • 28
  • 49