Re: Can a PLSQL script use a command line?

From: RK <rajxesh_at_hotmail.com>
Date: 2 Jul 2002 05:16:06 -0700
Message-ID: <86c750f4.0207020416.a8d895_at_posting.google.com>


Try

SELECT some_col
FROM some_table
WHERE other_col = &variable_name

The & is a subsitution variable. Read the manual for SQL*Plus. you will find more informastion about &

  • rajXesh

JSalomon_at_bn.com (Jacob Salomon) wrote in message news:<38b6a68e.0207011522.7b235fc_at_posting.google.com>...
> Hi all.
>
> I would like to write a PLSQL script that I can call from PLSQL but
> pass a parameter. I have not been able to locate information in the
> newsgroups or in the documentation. (Don't mean it ain't there, of
> course.)
>
> Of course, I could write a stored procedure but I don't want to save
> this script in the database. If I did that I'd have to propagate it to
> several databases and I want it to be a general script.
>
> It had occured to me that I could cheat a little and write a shell
> script to accept the command line parameters and wrap my SQL script
> within the shell script. The problem with that is that I'd have to
> embed the database name as well as a userid/password into the script,
> leaving me with the need for a different copy of the shell script for
> each database.
>
> No, the best way for me (I think) is a database-independent script.
> Since it will retrieve data from the data dictionary, it won't matter
> which database it's running on; those "tbles" exist in every database.
>
> Any ideas?
>
> Thanks.
>
> +---------- Jacob Salomon JSalomon_at_bn.com -- -------------- ------+
> | Conservative (n): A statesman who is enamored of existing evils,|
> | as distinguished from the Liberal, who wishes to replace them |
> | with others. |

 +---------------------- Amrose Bierce, The Devil's Dictionary ----+
Received on Tue Jul 02 2002 - 14:16:06 CEST

Original text of this message