Defining variables for queries

The first type of query example to discuss is regarding query variables or parameters. Query variables or parameters are important because the correct parameters in the query will greatly increase the query flexibility and the query intelligence. One query with variables may mean hundreds of hard-coded queries. If you input different data for the variables, you can have pertinent information just related to what you are interested in.

If you have read the previous chapters, you will remember [%0], [%1], etc. That is the way SAP Business One defines variables.

Tip

Remember, you must define an alias for the table in order to use these variables. If you omit the table alias, you will get an error message when you include ...

Get Mastering SQL Queries for SAP Business One now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.