SQL copy-paste problem?

I’ve tagged this as “Base”, although it might actually be website related.

In this thread I received a helpful SQL query that works perfectly.

The author of the query listed among its advantages that
“it’s easy to add or delete fields/calculations according to preference.”

So I thought I’d try that out by modifying the query to run for networks instead of countries. I pasted the query into Notepad++, did a global search and replace for “country” to “network”, changed the relevant table from “tCountries” to “tNetworks” , pasted it into a new Base SQL query and got “syntax error”

This got me curious, so I went back to the thread, copied the SQL query directly from that thread, pasted it straight into Base as is, and ALSO got a “syntax error”. Since the query saved in my odb works fine, I was puzzled by this, and decided to do a comparison. The screenshot shows a document comparison of the SQL from my odb (left) and the text copied/pasted from the thread above(right).

The changes history shows them identical, the word count for both versions shows exactly the same word count and “characters including spaces” count. The only difference is that the version on the right does have a higher “characters including spaces” count.

I’m trying to figure out this problem because I use Notepad++ for writing any SQL, both from here and as I work through the LO Base video tutorials at thefrugalcomputerguy.com.

I can easily grasp that my attempt to replace the “country” of the original with “network” might have introduced errors (and I’m kicking myself for giving a field a name with a space in it!), but I’m genuinely puzzled why a query that I copied, pasted ran and saved works fine, while copying the same query now and pasting it into Base’s SQL editor generates a syntax error.

Nothing on your topic, but look at the status < 2status < 4 line with underline and strokes first.
.
Your problem may be introduced by interpreting text as markdown…

Thanks for taking the time to reply - the text you mention shows up only as part of the version history. That’s why it’s shown struck through. It’s not in either version, but is present in the history of both, further confirming that they are identical.

Syntax error in SQL statement
.
this error message is thrown by Base which suggests that the parser is enabled.
.
is it possible that you failed to use direct mode i.e. 'menu:>Edit>Run SQL command directly.

1 Like

Thank you very much.