OutSystems Advanced Queries

Use of comments (author: Marcel Lambrechts)

inSystems comments in code

I was creating an advanced query (see post OutSystems – Getting Database Information) for the DBCleaner application to display table space usage. When I executed the query in OutSystems Service Studio using the “Test” button, it gave a (the expected) result, so publish the application and go! Publishing the application went fine, but when I went to the page with the result of my query, it showed me an “Internal Error”.

Looking in ServiceCenter at the error, it told me that the error was ORA-00907: missing right parenthesis. Very strange to get an error on the syntax of the query, while testing the query in Service Studio worked like a charm.

Invalid commenting

After some puzzling it turned out that this error was due to some lines in the query I removed by commenting them using “–“. When I removed them the error disappeared. I started testing this with some other queries (a lot simpler) and whenever I use the “–” to comment something, Service Studio will gladly accept and run the query, but the platform will return with an internal error.

It turns out that the only acceptable way to add a comment in a query, for the OutSystems platform at least, is to use /* …. */.

So for example, the next query (using the — comment syntax) will result in an internal error:

SELECT
name,
— espace_id,
physical_table_name,
is_active
FROM ossys_entity;

And this query (using the /* */ comment syntax) will run fine:

SELECT
name,
/* espace_id, */
physical_table_name,
is_active
FROM ossys_entity;

Cause of the problem

The problem is caused by the fact that the OutSystems platform removes all Carriage Returns from the advanced querty, so the query with the “–” comment that I have listed above, will be translated by the runtime OutSystems platform to:

SELECT name, — espace_id, physical_table_name, is active FROM ossys_entity;

This way Oracle (and other database systems) will see everything after “–” as comment, thus including all other columns and the FROM clause.

Share this

Contact

Heb je vragen of opmerkingen? Aarzel niet om contact op te nemen. Dat kan via de algemene contactgegevens, rechtstreeks met de genoemde contactpersoon op een van de detailpagina’s, of via onderstaande knop.

29 juni 2026

Welke midlance regeling past bij mij?

Medium-lance / Midlance wint snel aan populariteit. Het combineert de zekerheid van een vast dienstverband met de mogelijkheid om een aanzienlijk hoger inkomen te verdienen wanneer je op mooie opdrachten wordt ingezet.

18 juni 2026

AI inspiratiesessie

AI is nauwelijks nog weg te denken uit het nieuws. Vrijwel dagelijks verschijnen er berichten over nieuwe AI-toepassingen. Dat roept vragen op. Wat is AI eigenlijk precies? Wat kunnen deze systemen wel en niet? Wat betekent dit voor mij?

Opdrachten uitgevoerd voor

CB Logistics
Leaseplan
Gemeente Gouda
Alphabet
TU Eindhoven
Greenchoice
Rijk Zwaan inSystems
RIGD LOXIA
MN Services
Ziggo
Allianz
Twinq
GVB
ASR Nederland
TenneT
UBR Uitvoeringsorganisatie Bedrijfsvoering Rijk
Universiteit Tilburg
Cannock
Ahold
Rabobank
Syntrus Achmea Real Estate & Finance
Rendo
CBR
Fokker
AgroEnergy
SVB
JUVA
Oracle University
VAA ICT Consultancy
IBM
Gemeente Den Haag
Rechtspraak
Holland Casino
BMW
Stratech Social
Altran
RAVU
Politie
inSystems Unive
Bank Mendes Gans
Multi Tank Card
inSystems KLM
Gemeente Apeldoorn
Arval BNP Paribas
VION Food Group
Belastingdienst
VTTI
Provincie Utrecht
Ministerie van Economische Zaken, Landbouw & Innovatie
DICTU
Van Iperen Groeispecialisten
Thales
ING Bank
Eneco
Telegraaf Media Groep
WVDB Adviseurs Accountants
Feenstra inSystems
Nederlandse Spoorwegen
PC Uitvaart
Alliance Healthcare
NVWA inSystems
Stedin
Darling