Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> SQL statement works with SQL/Plus - but not with ODBC
try it without the BEGIN and END for ADO - just pass the SQL
> -----Original Message-----
> From: Christian Weyer [SMTP:christian.weyer_at_eyesoft.de]
> Posted At: Monday, April 09, 2001 6:37 AM
> Posted To: misc
> Conversation: SQL statement works with SQL/Plus - but not with ODBC
> Subject: SQL statement works with SQL/Plus - but not with ODBC
>
> Hi all,
> I have a rather complex SQL statement:
> ---
> BEGIN
> UPDATE ContentDataTable
> SET SYMBOLIC PATH PARENT = N'/Test',
> SYMBOLIC NAME = N'HAWK01.GIF',
> VERSION NUMBER = 1 +
> SELECT MAX(VERSION)
> FROM
> (SELECT MAX(VERSION NUMBER) AS VERSION
> FROM ContentDataTable WHERE
> SYMBOLIC PATH PARENT = N'/Test' AND
> SYMBOLIC NAME = N'HAWK01.GIF'
> UNION
> SELECT MAX(VERSION NUMBER) AS VERSION
> FROM RevisedContentDataTable WHERE
> SYMBOLIC PATH PARENT = N'/Test' AND
> SYMBOLIC NAME = N'HAWK01.GIF'))
> WHERE SYMBOLIC PATH PARENT = N'/Test' AND SYMBOLIC NAME =
> N'HAWK02.GIF' AND VERSION NUMBER = 1;
> END;
> ---
>
> It works fine in SQL/Plus or SQL Worksheet and does what it should do
> ;-)
>
> But when using it via ADO (the latest ODBC Driver!) I get the
> following error:
>
> ---
> PLS-00103 found 'SELECT' but expected one of the following:
> ( - + mod not null others <an identifier>
> <a double-quoted delimited-identifier> <a bind variable> avg
> count current exists max min prior sql stddev sum variance
> execute forall time timestamp interval date
> <a string literal with character set specification>
> <a number> <a single-quoted SQL string>
> ---
>
> Any ideas?
>
> Thanx,
> Christian
> --
>
> eYesoft We see your visions.
>
>
> Christian Weyer http://www.eyesoft.de
--Received on Mon Apr 09 2001 - 08:21:09 CDT