pl sql script lazarus / 16-Databases ---------------------------------------------------------------------- Hansvb · 2014-12-06 20:18 Is it Possible to run a PL/SQL script in Lazarus. I use ZEOSLIB components to run sql query's. ---------------------------------------------------------------------- cpalx · 2014-12-07 03:25 Pl sql and pl pgsql works creat. The easy way todo use it isla lke any query ---------------------------------------------------------------------- Hansvb · 2014-12-07 08:13 I use TZQuery and want to start the pl sql script with Query.open This gives an error on the ":=" in the script. (I will post the error later on) example, this will not work (And works fine i sql developer) Code: [Select]declare   V_test number; begin  v_test := 10; end; / ---------------------------------------------------------------------- tudi_x · 2014-12-07 12:05 I think you should try with Query.ExecSQL. Open is more for datasets. I would also be cautios about the '/'. ---------------------------------------------------------------------- Hansvb · 2014-12-20 10:43 The slah "/"  is nessecary. It runs the pl/ sql block ---------------------------------------------------------------------- Hansvb · 2014-12-20 21:24 I can't get zoes lib to run a simle emtpy test pl/sql block I use 7.14 stable pl/sql (This runs fine in sqlplus and TOAD).: Code: [Select]declare   v_test Number; begin   NULL; END; /  i get an error on line 1 position 8. error message: SQL Error: OCI_ERROR: ORA-06550; Line 1, column 8: PLS-00103: Symbol "" encounterd when i change de pl/sql code to: Code: [Select]declare v_test Number; begin NULL; END; / then i get the same warning but at line 1 position 22. So  it seems to me that the return in the first code and "end of line" in the second code is not excepted. What is wrong? ---------------------------------------------------------------------- miab3 · 2014-12-20 22:12 @Hansvb, Probably the idea is: http://sourceforge.net/p/zeoslib/tickets/93/ Correct or use ZEOS 7.2: http://zeoslib.sourceforge.net/viewtopic.php?f=40&t=3795&p=36341#p3634 1 http://svn.code.sf.net/p/zeoslib/code-0/branches/testing-7.2/ Michal ---------------------------------------------------------------------- Hansvb · 2014-12-21 07:49 I tried zeos 7.2. Got it from sourceforge yesterday. I installed lazarus compete fresh. I get an acces violation when i start a query. When i replace the zoes component to 7.14 the accea violation is gonne. So it seems i cant install 7.2 right to test the pl/sql ---------------------------------------------------------------------- miab3 · 2014-12-21 10:51 @Hansvb, Quote from: Hansvb on December 21, 2014, 08:49:36 amI tried zeos 7.2. Got it from sourceforge yesterday. I installed lazarus compete fresh. I get an acces violation when i start a query. That's weird.  To me it never happened. You write about the version downloaded from the address?: http://svn.code.sf.net/p/zeoslib/code-0/branches/testing-7.2/ What is your development environment? (My I list here: http://zeoslib.sourceforge.net/viewtopic.php?f=40&t=3795&p=36341#p3634 1) Michal ---------------------------------------------------------------------- Hansvb · 2014-12-21 14:24 i got it with: svn checkout svn://svn.code.sf.net/p/zeoslib/code-0/trunk zeoslib- code-0 it is rev 3561 ---------------------------------------------------------------------- Hansvb · 2015-01-09 21:31 I am still trying to get pl/sql code to work. At the end of the sql statement i get a warning: "Symbol '''' found. This warning always shows at the end of a statement. Code: [Select]  with DataModule1.ZQuery_Adress do       begin         Close;         SQL.Clear;         sql.Add('declare v_test Number; begin NULL; END;' + #13#10);         ExecSQL;       end; Without the #13#10 i get the same warning. ---------------------------------------------------------------------- tudi_x · 2015-01-09 21:40 @Hansvb - do you have a pl/sql script that returns something? maybe something like a small stored procedure that is called by the pl/sql script so I can see a returned value on the screen. I am having Zeos 7.1.4 and 11g and could also test. ---------------------------------------------------------------------- Hansvb · 2015-01-12 08:21 I don't have stored procedures. it is just a pl/sql block wtih no functions to test it. Code: [Select]declare v_test Number; begin NULL;  --just for testing END; /