Recent

Author Topic: Execute a Oracle package with SQLScript  (Read 1423 times)

Hansvb

  • Hero Member
  • *****
  • Posts: 602
Execute a Oracle package with SQLScript
« on: February 13, 2016, 09:47:34 pm »
To execute SQL create query's and pl/sql scripts i use TSQLScript.
For example when i want to use a create query i use something like this:


Code: Pascal  [Select][+][-]
  1. begin
  2.         execute immediate
  3.         '
  4.                 create table tijd_ctrl_overlap
  5.                         (
  6.                                         BRON
  7.                                 ,       OBJECT_GUID
  8.                                 ,       ID
  9.                                 ,       STD_TYPE
  10.                                 ,       TYPE
  11.                                 ,       GEOMETRIE
  12.                         )
  13.                 as
  14.                         select
  15.                                         ''TABLE_A''
  16.                                 ,       object_guid
  17.                                 ,       id
  18.                                 ,       std_grtype
  19.                                 ,       grtype
  20.                                 ,       Geometrie
  21.                 from
  22.                         TABLE_A
  23.                 union all
  24.                         select
  25.                                         ''TABLE_B''
  26.                                 ,       object_guid
  27.                                 ,       id
  28.                                 ,       std_n_type
  29.                                 ,       nl_type
  30.                                 ,       Geometrie
  31.                         from
  32.                                 TABLE_B
  33.         ';
  34. exception
  35.         when others then
  36.         if sqlcode != -955 then
  37.                 raise;
  38.         end if;
  39. end;
  40. ^

Now i want to excecute the next sql statement which calls a package
(It works in Oracle)

Code: Pascal  [Select][+][-]
  1. BEGIN
  2.    pack_sp10.pr_register_spatial_layer('TIJD_CTRL_OVERLAP',28992);
  3. END;
  4. /


I tried this but is not working, the program stops working with no warning.

Code: Pascal  [Select][+][-]
  1. begin
  2.    execute immediate
  3.    '
  4.                 begin
  5.                 pack_sp10.pr_register_spatial_layer(''TIJD_CTRL_OVERLAP'',28992);
  6.                 end;
  7.         ';
  8. end;
  9. ^


 

TinyPortal © 2005-2018