Difference between revisions of "Talk:SqlDBHowto"

From Lazarus wiki
Jump to navigationJump to search
(response: you're more than welcome to update the wiki article & please use the forums for questions)
(prepare)
Line 1: Line 1:
== John's question ==
+
== Prepare ==
Following the example here - specifically (Variable):= TSQLTransaction.Create; - doesn't work for me. I get a compile error "Wrong number of parameters". Unfortunately I can't at the moment find any other documentation to check the syntax, which is frustrating.
+
Thanks for the recent edits, but:
 +
* We are talking about the db server parsing/preparing the query, not so much (or at all) sqldb.
 +
* IIRC, the server prepares at first run if .Prepare hasn't been called manually. Please indicate the relevant sqldb code if that's not the case
 +
* Unprepare should be called by .close. If that is not done, it's a bug.
 +
* If a db server does not support parameters, sqldb will emulate them. So no need to go into which dbs support what
  
Edit: it seems we need to add the parameter (Nil) to TSQLTransaction.Create and TSQLQuery.Create.
+
Thanks, --[[User:BigChimp|BigChimp]] 10:26, 24 October 2014 (CEST)
 
 
:Hi John, welcome to the wiki ;)
 
:Thanks for posting, but questions on the wiki are rarely looked at. You'd be better of asking on the forum.
 
:Having .Creates with an object as parameter is very common. You can use tools like ctrl-space (code completion), go to defintion (right click, go to defnition or something like ctrl-shift-up - can't remember) to find out what is expected.
 
:Also, corrections to the wiki are always welcome - please feel free!
 
:Thanks,
 
:--[[User:BigChimp|BigChimp]] 14:48, 6 April 2013 (UTC)
 

Revision as of 10:26, 24 October 2014

Prepare

Thanks for the recent edits, but:

  • We are talking about the db server parsing/preparing the query, not so much (or at all) sqldb.
  • IIRC, the server prepares at first run if .Prepare hasn't been called manually. Please indicate the relevant sqldb code if that's not the case
  • Unprepare should be called by .close. If that is not done, it's a bug.
  • If a db server does not support parameters, sqldb will emulate them. So no need to go into which dbs support what

Thanks, --BigChimp 10:26, 24 October 2014 (CEST)