Overview
Features
Download
Documentation
Community
Add-Ons & Services

SQL Statement Placeholders

Please post support and help requests here.

SQL Statement Placeholders

Postby DougE » 24 Oct 2008, 16:53

Is there any advantage, performance or feature, that would provide a reason to use the ? or :holder format?

ex 1:

ses << "INSERT INTO Student (sFirst, sLast, sID) VALUES( ?, ?, ?)",
use(first), use(last), use(id), now;
-or-

ses << "INSERT INTO Student (sFirst, sLast, sID) VALUES(:first, :last, :id)",
use(first), use(last), use(id), now;

ex 2:

ses << "SELECT sFirst, sLast, sID FROM Student where sLast = ?",
use(lastlookup), into(first), into(last), into(id), now;
-or-

ses << "SELECT sFirst, sLast, sID FROM Student where sLast = :last",
use(lastlookup), into(first), into(last), into(id), now;

Thanks,
Doug
DougE
 
Posts: 13
Joined: 15 Jul 2008, 17:44

Re: SQL Statement Placeholders

Postby alex » 24 Oct 2008, 23:28

> Is there any advantage, performance or feature, that would provide a reason to use the ? or :holder format?

'?' is the only portable (i.e. standard) way. ':holder' is convenient, but not all DB backends support it.
alex
 
Posts: 1130
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron