Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Validating SQL ??
Matthew Green <matthewgreen_at_powersoft-services.co.uk> wrote:
>Is there a command which will let me validate SQL statements before
>applying them e.g..
>
>
>update contacts
>set name = 'ABC'
>
>
>so I want to check if the syntax is right before executing.
Hi Matthew,
you could use the DBMS_SQL package to do a syntax validation on DML statements (please note this won't work with DDL statements) by just parsing them and checking for any exception. There is also the function DBMS_SQL.LAST_ERROR_POSITION available which would give you the offset into the statement string in case of error.
HTH,
Peter
--
Peter Schneider
pschneider_at_knuut.de
Received on Wed Jan 06 1999 - 03:59:10 CST
![]() |
![]() |