Skip to content

SQL Parser Info #418

Answered by lovasoa
pchemguy asked this question in Q&A
Jun 18, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote
SELECT
    'dynamic' AS component,
    sqlpage.run_sql('footer_debug_post-get-set.sql') AS properties
WHERE $DEBUG OR $error IS NOT NULL;

Currently, this does not work the way you might expect. The run_sql is executed unconditionally, then the sql statement is executed and returns 0 rows, so the dynamic component is not invoked.

I am working on a smarter and more powerful function execution logic, you can have a look at opened pull requests if you are interested.

In the meantime, if you want to conditionally execute a sqlpage function, you need to pass it a variable that has been previously defined to either null or the value you need.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pchemguy
Comment options

Answer selected by pchemguy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants