Prevent the use of PetaPoco variables as input parameters

I am using PetaPoco.Core 4.0.3 in a C # application to access the MySql database.

I am trying to create a query that uses variables, but I do not want PetaPoco to handle them as input parameters. Here is a useless query to show what I mean:

SET @num := 0;

SELECT
  @num := @num + 1 AS row_number
FROM
  buzz
LIMIT 100;

When I do this, PetaPoco recognizes @num as an input parameter, and I get the following error:

The parameter '@num' is specified, but none of the arguments passed has a property with this name> (in 'SET @num: = 0; SELECT @num;')

I also tried to escape the @ character by doubling it

SET @@num := 0;

SELECT
  @@num := @@num + 1 AS row_number
FROM
  buzz
LIMIT 100;

but then i get

The '@num' parameter must be specified.

PetaPoco ?

+3
1
+3

All Articles