Hi,

What is the benefit of this syntax over having a simple function that
takes one argument, interpolating variables from CALLER::?

for sql 'SELECT * FROM table WHERE id=$id' { ... }

The difference is between compile time parsing and runtime parsing. This expression can be transformed to a prepare statement plus a call, which is not just faster, but more safer, if $id contains aposthropes or other characters.


Maybe other abstraction would be possible, too.

What about this (I'm not really sure, if it's ok):

INSERT INTO table (col1, col2) VALUES %row;

And it will be:

INSERT INTO table (col1, col2) VALUES (?,?)

  and

%row.col1, %row.col2 will be insert as values.

Bye,
  Andras

Reply via email to