Re: avoid dynamic SQL

  • From: Randolf Geist <info@xxxxxxxxxxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 02 Jul 2009 12:06:59 +0200

A quite comprehensive example of such an eval function in PL/SQL can be found 
here:

http://forums.oracle.com/forums/thread.jspa?threadID=910384&tstart=0&messageID=3527468#3527468

I haven't tested it but I guess it should be sufficient for the simple formulas 
mentioned here in the thread provided that it works in general.

Regards,
Randolf

Oracle related stuff blog:
http://oracle-randolf.blogspot.com/

SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/

> Instead of constructing the select string every time and running it with
> execute immediate, create a function which:
> 
> 1) takes your expression as a bind variable parameter
> 2) tokenizes this expression into individual pieces
> 3) loops through the tokens and performs appropriate calculation (like CASE
> when token1 = '+' THEN result := result + token2 ... etc)
> 4) once looped through all tokens, return final result
> 
> This all can be done in PL/SQL...
> 
> --
> Tanel Poder
> http://blog.tanelpoder.com
________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/

--
//www.freelists.org/webpage/oracle-l


Other related posts: