[Solved] Error while creating a table with SQL statements

Discuss the database features
Post Reply
User avatar
Kartik Pachlodkar
Posts: 5
Joined: Thu Oct 27, 2022 2:48 pm

[Solved] Error while creating a table with SQL statements

Post by Kartik Pachlodkar »

To,
All members

Subject - Error while creating a table with SQL

Hi,
I tried to create a new table using SQL statements in OpenOffice Base. But, if I execute it, it displays an error like this - "The query cannot be executed. It is too complex". Please help me with this problem.
It displays an error like this.
It displays an error like this.
A.jpg (46.92 KiB) Viewed 3206 times
Thanks
Last edited by Kartik Pachlodkar on Sat Jan 21, 2023 6:58 am, edited 2 times in total.
OpenOffice Version - 4.1.13
Operating System - Windows 11
Mountaineer
Posts: 318
Joined: Sun Sep 06, 2020 8:27 am

Re: ERROR WHILE CREATING A TABLE WITH SQL STATEMENTS

Post by Mountaineer »

I never tried to use the sql-command window for this, as it can easily be done in the Tables-View of the GUI.

Two points to check first: What kind of database are you editing? HSQLDB embedded or something else?

Have you tried to use a name without special chars like '
I'm not sure, if this is valid as ' has its own special use in SQL. (And of habit I never try my luck with this kind of chars.) So try to create STUDENTS first.
OpenOffice 3.1 on Windows Vista
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: ERROR WHILE CREATING A TABLE WITH SQL STATEMENTS

Post by Villeroy »

I always use the SQL window for this, sometimes together with a text edtior having some CREATE skeletons as templates.
Avoid lengthy names with special characters. The apostrophe marks literal strings. It should not appear in an object name. You can give meaningful labels to your objects in the user interface (forms and reports).

The following works well without any quoting

Code: Select all

create table sg(
n varchar(30),
m numeric(2)
)
HSQL creates a table SG with columns N and M.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Kartik Pachlodkar
Posts: 5
Joined: Thu Oct 27, 2022 2:48 pm

[Solved] ERROR WHILE CREATING A TABLE WITH SQL STATEMENTS

Post by Kartik Pachlodkar »

I tried again as you said, but still, it displays the same error. Please help me with this problem.
Attachments
B.jpg
B.jpg (46.16 KiB) Viewed 3102 times
Last edited by Kartik Pachlodkar on Sat Jan 21, 2023 7:01 am, edited 1 time in total.
OpenOffice Version - 4.1.13
Operating System - Windows 11
UnklDonald418
Volunteer
Posts: 1549
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Error while creating a table with SQL statements

Post by UnklDonald418 »

I've seen weirdness like that when using an Embedded Base database.
I've never been able to track down the cause but the solution has been to create a new database and copy everything to it from the malfunctioning .odb file.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Error while creating a table with SQL statements

Post by Villeroy »

Create_Table.png
Create_Table.png (31.69 KiB) Viewed 2944 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Kartik Pachlodkar
Posts: 5
Joined: Thu Oct 27, 2022 2:48 pm

[Solved] Error while creating a table with SQL statements

Post by Kartik Pachlodkar »

I am really thankful to all who helped me with this problem. Now I am able to create tables with SQL statements without any errors. Thank You!
OpenOffice Version - 4.1.13
Operating System - Windows 11
Post Reply