Ask Your Question
0

handling of special characters in SQL

asked 2020-01-05 23:01:26 +0100

nexturejohn gravatar image

updated 2020-08-03 01:42:39 +0100

Alex Kemp gravatar image

Hi, for a utility program I am writing in Base 6.3.3.2 on Windows, I need to identify the names of all the tables in an odb file. I am using Firebird, and according to their site I can use the SQL query:

select rdb$relation_name from rdb$relations where rdb$view_blr is null and (rdb$system_flag is null or rdb$system_flag = 0);

I tried it in LibreOffice Base, Tools, SQL and effectively it works. When though I put this same request in the SQL content of a ComboBox, it always returns a Syntax error. I guess that the problem is the use of $ in the field rdb$relation_name. Any ideas how to get round this, or any other SQL-based suggestions to simply get the names of all tables?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-01-05 23:19:21 +0100

Ratslinger gravatar image

updated 2020-01-06 18:42:24 +0100

Hello,

Use SQL[Native] for Type of list contents or save as Query (turn on Run SQL command directly) and use that. Both work.

Edit 2020-01-06:

Run SQL command directly can be turned on from the toolbar icon:

image description

It is also available for selection from the menu item Edit.

Then for Type of list contents set as Query and List Content select the query name it was saved as.

edit flag offensive delete link more

Comments

Hi, Selecting "Sql Native" in the combobox solves the problem, thanks!

I would like to understand though what you mean by your other suggestion: "save as query (turn on SQL command directly)". Can you explain? Thanks again.

nexturejohn gravatar imagenexturejohn ( 2020-01-06 09:43:08 +0100 )edit

thankyou for your help Ratslinger! One final question on this topic: how can I write a Query to do this? Again the SQL gives me a syntax error.

nexturejohn gravatar imagenexturejohn ( 2020-01-06 20:52:38 +0100 )edit

What is shown in the answer is a query using the same syntax in your question. Simply select Create Query in SQL View from main Base screen under Query. Make sure to select Run SQL command directly (it's a toggle to turn on/off).

Ratslinger gravatar imageRatslinger ( 2020-01-06 21:08:22 +0100 )edit

thanks Ratslinger, it was this toggle that I was missing!! Thanks again for all your help, I am getting there!

nexturejohn gravatar imagenexturejohn ( 2020-01-07 01:15:40 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-01-05 23:01:26 +0100

Seen: 65 times

Last updated: Jan 06