What are the challenges you face when working across database platforms? Take the survey

Laying out SQL from code

stevehurcombestevehurcombe Posts: 22
edited May 15, 2008 9:45AM in SQL Prompt Previous Versions
A common task for me is to take an SQL query from code (which is always on one line) and format it.

Then when the query is OK it's converted back to a single line to be pasted back into the code.

SQL Prompt was going to be my saviour but it trips up with syntax errors.

Specifically it doesn't like the following constructs:

"select * from table where field=" & clause

Let's ignore the SQL injection risk here for a moment as this is a contrived example.

The second more serious problem is:

select * from table where field=?

It's doesn't like the replaceable parameters.

Best regards


  • Options
    Hi Steve,

    Layout needs valid SQL syntax before formatting your code. The question marks used as replaceable parameter values are treated as invalid characters and therefore the error is thrown.
    However, I will log this as a feature request if you may wish and will keep you posted with updates on this feature?

    I am sorry but this is how the product is currently designed to work.

    Many thanks,
Sign In or Register to comment.