--- title: "exists db-row()" slug: "basic-db-row-exists" updated: 2026-08-11T12:02:40Z published: 2026-08-11T12:02:40Z canonical: "docs.lobstersoftware.com/basic-db-row-exists" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # exists db-row() This function executes an SQL statement **a** on the database that alias **b** represents. Placeholders of the form `&paramNumber` in the statement are replaced by the values starting with parameter **c**. Characters needed for a valid syntax, such as quotes around strings, must be part of the statement already. If the database returns no result, the function returns `false`. Otherwise, it returns `true`. > [!WARNING] > **IMPORTANT:** > > In addition to the notation `&paramNumber`, you can use the notation for prepared statements, in the form `@parameterNumber:parameterType@`. Prefer this notation because it prevents SQL injection attacks. Within prepared statements, parameters replace single values only. SQL syntax such as value lists for `IN`, table or column names, operators, sort orders, or complete SQL fragments cannot be passed via placeholders. ## Parameters | Parameter | Description | | --- | --- | | a | SQL statement to be called. | | b | Database alias. | | c | (optional) Parameter `&1` of the statement. | | d | (optional) Parameter `&2` of the statement. | | e | (optional) Parameter `&3` of the statement. | | f | (optional) Parameter `&4` of the statement. | | g | (optional) Parameter `&5` of the statement. | | h | (optional) Parameter `&6` of the statement. | | i | (optional) Parameter `&7` of the statement. | | j | (optional) Parameter `&8` of the statement. | | k | (optional) `true` for the `read only` mode. Default: `false`. | | l | (optional) If `true`, the function ignores SQL errors reported by the database. Default: `<empty>` (== `false`). | ## Examples A table `zipcodes` containing all zip codes of Germany is given. | Parameter a | b | c | d | e…j | k | l | Result | | --- | --- | --- | --- | --- | --- | --- | --- | | select * from zipcodes | testdb | | | | | | true | | select * from zipcodes where zipcode = &1 | testdb | 80336 | | | | | true | | select * from zipcodes where city = '&2' | testdb | | Munich | | | | true | | select * from zipcodes where zipcode = &1 and city = '&2' | testdb | 12345 | Munich | | | | false | > [!NOTE] > **NOTE:** > > - The call automatically limits the database result to one row at maximum, independent of how many rows exist. It is therefore not necessary to add a `LIMIT` clause to the statement. > - If you need the actual values afterward, retrieve them directly with one of the select functions. Then check whether a returned value exists.