#1 2025-11-04 10:56:19

anouri
Member
Registered: 2024-02-11
Posts: 133

bind parameter by name in sql?

is it possible to bind parameter by name?

Lsql := 'select invoice_no,tran_date from fin_invoice where cust_code=:cust_code';
dbStmt := dbConn.NewStatementPrepared(LSql, True);
dbStmt.BindTextU(1, '1');


  dbStmt.BindByName('cust_code') := '1';

Last edited by anouri (2025-11-04 10:56:49)

Offline

#2 2025-11-04 16:10:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,261
Website

Re: bind parameter by name in sql?

No it is not supported.

The parameter naming is done by the SQL class itself, from indexed properties.
You use ? as place holder, and the mormot client will name the parameter as expected.

Offline

Board footer

Powered by FluxBB