Shell Script to Parse PLSQL code?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script to Parse PLSQL code?
# 1  
Old 01-27-2009
Data Shell Script to Parse PLSQL code?

Hi All,

I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not necessarily though Smilie ) ?

Any help / advice would be greatly appreciated.

regards
Gaurav
# 2  
Old 01-27-2009
You can describe packages etc at the sql prompt, e.g...
Code:
SQL> desc sys.dbms_job;
Element            Type      
------------------ --------- 
ANY_INSTANCE       CONSTANT  
ISUBMIT            PROCEDURE 
SUBMIT             PROCEDURE 
REMOVE             PROCEDURE 
CHANGE             PROCEDURE 
WHAT               PROCEDURE 
NEXT_DATE          PROCEDURE 
INSTANCE           PROCEDURE 
INTERVAL           PROCEDURE 
BROKEN             PROCEDURE 
RUN                PROCEDURE 
USER_EXPORT        PROCEDURE 
BACKGROUND_PROCESS FUNCTION  
IS_JOBQ            FUNCTION  
 
SQL> desc sys.dbms_job.submit;
Parameter Type           Mode Default? 
--------- -------------- ---- -------- 
JOB       BINARY_INTEGER OUT           
WHAT      VARCHAR2       IN            
NEXT_DATE DATE           IN   Y        
INTERVAL  VARCHAR2       IN   Y        
NO_PARSE  BOOLEAN        IN   Y        
INSTANCE  BINARY_INTEGER IN   Y        
FORCE     BOOLEAN        IN   Y        
 
SQL>

# 3  
Old 01-27-2009
: https://www.unix.com/shell-programmin...#post302280756
XXX wrote:
> present the documentation for PLSQL. Any script which can ...
> generate document[ation] -- preferrably HTML....

Hello Gaurav,

Your query has an <unhappy emoticon> next to it because
it is difficult to answer a technical question when _all_
information is not clearly provided and presented.

While it is true that Dana French wrote a ksh93 script
that implements a SQL (not PL/SQL!) database, I doubt this
is what you intend.

shql, kshSQL, kshSQL:
! Dana French Unix Korn Shell Curses Javascript Menu


What you want is presumably not a script or app, but
a software tool that can be invoked by a shell command.

"Parsing" is a very specific concept, and while _I_ have used
shellscript to parse language constructs, it is unlikely you
mean a parser, but probably a "prettyprinter," a "documentation
system," or a "literate programming" tool.

If what you desire is the first alternative, to have and
use a software tool to present a preformatted listing of a
given PL/SQL script, then you may investigate Genji

One of many, many documents that discusses this, (have
you done a search?) is:

PL/SQL, Java, JSP, and Javascript Code 'Beautifiers' (Reformatters)

("Formatter+" is now rolled into TOAD, which is now
commercialware; but, have you considered using the 30-
day trial versions of PL/SQL IDEs?)

My personal links collection contains these unchecked
entries:

"documentor.plsql": "generate HTML-type documentation for Oracle objects"
http://www.orafaq.com/scripts/plsql/documentator.zip

"Instant SQL Formatter": "SQL prettyprinter"
Instant SQL Formatter

"Instant SQL Formatter",2.6.2,Instant SQL Formatter

"SQLinForm.{class,exe}": "SQL & PL/SQL prettyprinter"
SQL Formatter / SQLFormatter formats SQL Statements

"PL/Formatter": "PL/SQL prettyprinter"

"SQL and PL/SQL Code Formatter": "prettyprint PL/SQL etal"
Online SQL and PL/SQL Formatter
^ http://www.orafaq.com/cgi-bin/sqlfor...lformatter.tpl
^ Instant SQL Formatter

"documentor.plsql": generate HTML-type documentation for Oracle objects"
http://www.orafaq.com/scripts/plsql/documentator.zip

As for options (2) and (3), Google the respective keywords
for many, many such choices.

BTW, why not have PL/SQL parse and generate its _own_
prettyprinted code into either HTML or PDF? I have not had
success finding the free and available packages I know are
available, but they should be findable through a dedicated search.

=Brian

Last edited by vbe; 02-04-2009 at 02:30 PM.. Reason: Removed some URLs for approval
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating IN list in PLSQL script dynamically by using shell script

Hi all, I have a PLSQL script which has a IN list where it takes some ids as input. For example SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID IN (comma separated list ) I want to run this quest inside a shell script but I would like to prepare the IN list dynamically where the employee ids... (1 Reply)
Discussion started by: LoneRanger
1 Replies

2. Shell Programming and Scripting

calling a plsql procedure through shell script

I have a plsql procedure inside a package which is having one IN parameter .I want to call that procedure through a shell script and that IN parameter is a column of a table in the database. So my requirement is that i need to loop all the entries of that IN parameter from the table through shell... (4 Replies)
Discussion started by: rspnf
4 Replies

3. Shell Programming and Scripting

Bash Shell Script to parse file

Raw Results: results|192.168.2|192.168.2.1|general/udp|10287|Security Note|For your information, here is the traceroute from 192.168.2.24 to 192.168.2.1 : \n192.168.2.24\n192.168.2.1\n\n results|192.168.2|192.168.2.1|ssh (22/tcp)|22964|Security Note|An SSH server is running on this port.\n... (2 Replies)
Discussion started by: jroberson
2 Replies

4. Shell Programming and Scripting

Execute shell script from plsql trigger

Hi, I have been assigned a job which requires me to send mails from unix(Mailx) upon on certain actions triggered in the database. On insert/update of a certain field into one of the database tables the shell script present in Unix box responsible to send mail though mailx needs to be triggered... (7 Replies)
Discussion started by: hemant.bs11
7 Replies

5. Programming

Executing shell script from PLSQL

Hi All, I have a requirement to mv a file in unix from plsql procedure. for that i have created a java host procedure, a host_command, given all grants as per ORACLE-BASE - Oracle8i Shell Commands From PL/SQL but i am getting an error ""Process err :/bin/sh: mv Not Found"" kindly let me... (1 Reply)
Discussion started by: aryan_styles
1 Replies

6. Programming

running PLSQL scripts through shell script

I am running the following ealth checks on my server there are two databases in my server . MODEL1 and MODEL2 i connect with the first database as sqlplus model1/password Then i exceute a query select x from table (4 Replies)
Discussion started by: asalman.qazi
4 Replies

7. UNIX for Advanced & Expert Users

shell script to parse html file

hi all, i have a html file something similar to this. <tr class="evenrow"> <td class="data">added</td><td class="data">xyz@abc.com</td> <td class="data">filename.sql</td><td class="modifications-data">08/25/2009 07:58:40</td><td class="data">Added TK prof script</td> </tr> <tr... (1 Reply)
Discussion started by: sais
1 Replies

8. Shell Programming and Scripting

Parse for errors shell script

All, I have a shell script which parses the /var/adm/messages file for errors every 15 minutes as a cron job. The script runs at 01, 16, 31, and 46 minutes every hour. The problem is if the error is encountered any time during the beginning of hour I can get paged three times. I would like to... (2 Replies)
Discussion started by: bubba112557
2 Replies

9. Programming

UNIX Shell Script to Create a Document of a PLSQL code.

Hi All, I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not... (1 Reply)
Discussion started by: gauravsachan
1 Replies

10. Shell Programming and Scripting

Shell Script Needed to Parse Results

Raw Results: results|192.168.2|192.168.2.1|general/udp|10287|Security Note|For your information, here is the traceroute from 192.168.2.24 to 192.168.2.1 : \n192.168.2.24\n192.168.2.1\n\n results|192.168.2|192.168.2.1|ssh (22/tcp)|22964|Security Note|An SSH server is running on this port.\n... (2 Replies)
Discussion started by: jroberson
2 Replies
Login or Register to Ask a Question