Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: <...>
PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: <...> [message #124900] Wed, 22 June 2005 03:50 Go to next message
arwdab
Messages: 5
Registered: May 2005
Junior Member
Hi all

Using Delphi and ADO I'm trying to execute this code but I get the error message:
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: <...>

Any ideas how to solve this? I want to make as few roundtrips to the database as possible.

Thanks
Stefan Olofsson

begin
create table tmp131F2BE063034E201DEFA31C
 (Id varchar(24) not null,
  Object varchar(24) not null,
  HighestVersion integer not null);

alter table tmp131F2BE063034E201DEFA31C add constraint x131F2BE063034E201DEFA31C primary key (Id);

insert into tmp131F2BE063034E201DEFA31C
select distinct 
  V.Id,
  V.Object,
  case when V.Superseded = 2958465 then 1 else 0 end HighestVersion
from
  advSv_131F2BE063013020312BB55B, 
  advVer V
where
  advSv_131F2BE063013020312BB55B.NodeAddress = '131F2BE06302DAE02EBBE870' and
  advSv_131F2BE063013020312BB55B.LvShow = 1 and
  V.Id = advSv_131F2BE063013020312BB55B.Version;
end;
Re: PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: <.. [message #124904 is a reply to message #124900] Wed, 22 June 2005 04:24 Go to previous message
Frank Naude
Messages: 4596
Registered: April 1998
Senior Member
Use EXECUTE IMMEDIATE as explained in the PL/SQL User's Guide and Reference (see the chapter about Native Dynamic SQL):

"You need dynamic SQL in the following situations:

1. You want to execute a SQL data definition statement (such as CREATE), a data control statement (such as GRANT), or a session control statement (such as ALTER SESSION). In PL/SQL, such statements cannot be executed statically..."

Example:

EXECUTE IMMEDIATE 'CREATE ....';


Best regards.

Frank
Previous Topic: Converting date to float
Next Topic: directory problem
Goto Forum:
  


Current Time: Mon Aug 04 14:11:12 CDT 2025