Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Validating SQL ??

Re: Validating SQL ??

From: Peter Schneider <pschneider_at_knuut.de>
Date: Wed, 06 Jan 1999 09:59:10 GMT
Message-ID: <36933283.2169248@personalnews.de.uu.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US