Recent

Author Topic: TSQLScript (sqlDB)  (Read 2100 times)

Mlaue

  • Newbie
  • Posts: 2
TSQLScript (sqlDB)
« on: August 03, 2020, 01:06:28 am »
Wie kann ich programmseitig der Eigenschaft script ein sql-Statement zuweisen und dies ausführen (TSQL.execute oder ähnlich)

TRon

  • Hero Member
  • *****
  • Posts: 2496
Re: TSQLScript (sqlDB)
« Reply #1 on: August 03, 2020, 01:20:51 am »
https://wiki.freepascal.org/TSQLScript

But... your question seem to suggest you are referring to a sql query, instead of a sql script ?

Because German is not my native tongue and I do not trust translators in such matters you are the only one who is able to tell that for certain :)

Mlaue

  • Newbie
  • Posts: 2
Re: TSQLScript (sqlDB)
« Reply #2 on: August 03, 2020, 02:52:39 am »
Ich beziehe mich auf das SQL-Script. Ich möchte das SQL-Script im Programm generieren.

TRon

  • Hero Member
  • *****
  • Posts: 2496
Re: TSQLScript (sqlDB)
« Reply #3 on: August 03, 2020, 03:22:58 am »
Ok thank you for clarifying Mlaue.

Just an administrative note:

in case you are not able to write in English then it is preferred that you use a translation service to translate your native language to English and post both messages.

It is frowned upon to not use English, unless you are writing in one of the language specific subforums. Unfortunately there isn't a German subforum here.

Also unfortunate is the fact that the wiki page I referred to is not available in German.

The actual TSQLScript script seems nothing more than TStrings. And for that there is a German page: https://wiki.freepascal.org/TStringList-TStrings_Tutorial/de

so for example (assuming that you placed the sqlscript component on your form and named it FBScript):
Code: Pascal  [Select][+][-]
  1.   ..
  2.   FBScript.Script.Clear;
  3.   FBScript.Script.Add('sql statement 1');
  4.   FBScript.Script.Add('sql statement 2');
  5.   FBScript.Execute;
  6.   ...
  7.  

Similar as was showed in the wikipage from my first reply that I linked to (except in the wiki example the statements were loaded into a stringlist first then copied to the SQLScript strings and the component was created at runtime).
« Last Edit: August 03, 2020, 03:28:02 am by TRon »

 

TinyPortal © 2005-2018