Parameters for a TSQLScript run? lazarus / 16-Databases ---------------------------------------------------------------------- Mario · 2024-07-24 08:57 Hi, I have a nice SQL script which does tons of stuff. I would like to have parameters in some of the statements, like in a regular TSQLQuery. Is there a simple way to do that? I was thinking of something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i XScript.Script := ScriptText;XScript.SomethingSomething.ParamByName('foo', 42);XScript.Execute; Is there something similar? ---------------------------------------------------------------------- Mario · 2024-07-24 12:40 Ok after some research and thought, I'll answer myself. If you have SQL that is complex enough you want it in a script, and it needs parameters, you are better off installing a stored procedure in your SQL server, whatever its flavor. SQLite doesn't have stored procedures, but apparently you can fake them like this https://www.cafe-encounter.net/p3300/pretending-that-sqlite-has- stored-procedures-and-functions ---------------------------------------------------------------------- Zvoni · 2024-07-24 12:46 Looking at the the Inheritance-Tree of TSQLScript and its Methods and Properties, i think it's the wrong "tool" (Component) to use with Parameters. 1) TSQLScript is not returning a Result (Like for a SELECT) 2) It uses the Execute(Direct)-Method of its Database/Connection- Object, which in itself should only be used for non-Result Statements i Think TSQLScript is useful for, say, reimporting a SQLDump. All said: If you have (to use) Parameters, use TSQLQuery. Period! Or as you said: Stored procedures if the DBMS supports it EDIT: I was just reading that Link. If you need help with registering your own Procedure/Function give a shout