Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-09-2004, 04:37 AM   #1
Registered: Feb 2004
Posts: 41

Rep: Reputation: 15
Shell script to run pl/sql script.

I would seriously apperciate an answer to these questions. Please Help.

I am using a shell script which starts SQLPlus and runs a file with pl/sql in it.
Should my pl/sql file have a sql or a pl extension.
When exiting sql to use perl do I use similar tags to php such as
<?php ...code... ?> or do I use anything.

Will the SQLPlus reject the script if it has a pl extension or will the perl not work if it has an sql extension?

Please help if anybody knows answer to any of these questions.
Old 09-09-2004, 06:49 AM   #2
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Unlike Windows, Linux doesn't use extensions to control function. So a perl script can be .pl, .c, .sql or nothing at all. What is important is that the script have permission to execute (see man chmod if you need help here) and that the first line point to the perl interpreter. So you will usually see the first line have something like:

#! /usr/bin/perl

That indicates that the script needs to be interpreted by perl. Now if you want to use extensions so that you know what the file is, go ahead. It just doesn't make any difference to how the program is run. The same will go for SQLPlus. I can't imagine that it gives a hoot what extenstion the file has as long as the contents are SQL.

When exiting sql to use perl do I use similar tags to php such as
You're going to have to do some serious reading here. Usually I do things the other way around, I have a perl program running that then executes SQL code. I'm not sure that SQLplus has the ability to escape, run a perl program, then return to running SQL, however I may be wrong about that.

Last edited by Hangdog42; 09-09-2004 at 06:52 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare records in two tables in seperate My Sql database using shell script sumitarun Programming 5 04-14-2005 09:45 AM
How to run SHELL script pito Linux - Newbie 4 12-17-2004 03:05 AM
how do i run shell script? krt47 Linux - Newbie 4 08-02-2004 09:29 AM
how to run a shell script oasisbhrnw99 Linux - Newbie 1 05-05-2004 01:21 PM
How do I run an .sql script? vous Programming 6 08-07-2003 10:11 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration