Sponsored Content
Top Forums Shell Programming and Scripting set oracle variable in function Post 302707833 by amitlib on Sunday 30th of September 2012 05:21:48 AM
Old 09-30-2012
set oracle variable in function

Hi,

I have a function that is suposed to generate a AWR report:

Code:
#-----------------------#
gen_awr()
#-----------------------#
{
	sqlplus -s admin/admin@OCEAN11<<ENDOFSQL
	define num_days = ''
	define report_type = "html"
	define begin_snap =$snap1
	define end_snap =%snap2
	define report_name =/export/home/ctemeabm/amit/test.HTML
	@?/rdbms/admin/awrrpt
	ENDOFSQL
}


When I try to run it I get the following error:

sql_test1.ksh[49]: syntax error at line 52 : `<<' unmatched





Thanks,
Amit
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Set Oracle Environmental Variable !!

Can someone send me a shell script to set all Oracle environment variable which is working. I have the following script which works but not 100%. Please advice what you think is wrong. if # Command executed from a terminal then ORACLE_SID="" ... (4 Replies)
Discussion started by: uuser
4 Replies

2. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

3. Shell Programming and Scripting

Help to set the oracle environment????

Hi, I am trying to set the environment for my oracle database. I have 5 database in an unix box. My idea is to create 5 files for each database with the following script on it. After logging into the unix box ...just by typing the database name....the enviornment for the database... (2 Replies)
Discussion started by: castlerock
2 Replies

4. Shell Programming and Scripting

Passing global variable to a function which is called by another function

Hi , I have three funcions f1, f2 and f3 . f1 calls f2 and f2 calls f3 . I have a global variable "period" which i want to pass to f3 . Can i pass the variable directly in the definition of f3 ? Pls help . sars (4 Replies)
Discussion started by: sars
4 Replies

5. HP-UX

What is the use of command set -- and set - variable?

Hi, I am using hp unix i want to know the use of the following commands set -- set - variable thanks (4 Replies)
Discussion started by: gomathi
4 Replies

6. Shell Programming and Scripting

set -o noglob in a function

I don't understand noglob. I have a function: function no_globb () { set -o noglob echo "$1" set +o noglob echo "$@" } When I run the function like this noglobb *.txt The ouput is: file01.txt file01.txt file02.txt file03.txt Shouldn't it be *.txt file01.txt file02.txt file03.txt (1 Reply)
Discussion started by: AlphaLexman
1 Replies

7. Shell Programming and Scripting

Pass a variable string in To_Date Oracle function in shell script

Hello, I am trying to execute an SQL query from shell script. A part of script is something like this: fromDate=`echo $(date +"%F%T") | sed "s/-//g" | sed "s/://g"` $ORACLE_HOME/sqlplus -s /nolog <<EOD1 connect $COSDBUID/$COSDBPWD@$COSDBSID spool... (4 Replies)
Discussion started by: sanketpatel.86
4 Replies

8. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies

9. Shell Programming and Scripting

Passing variable value in a function to be used by another function

Hello All, I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and put the variables in " ". Is there another way I can do this? Thank you in advance. readtasklist() { while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies

10. Shell Programming and Scripting

How to pass variable from one function to another function?

updateEnvironmentField() { linewithoutquotes=`echo $LINE | tr -d '"'` b() } I want to pass variable named $linewithoutquotes to another method called b(), which is called from updateEnvironmentField() method. How to do the above requirement with shell script (1 Reply)
Discussion started by: pottic
1 Replies
shares-admin(1) 						   User Commands						   shares-admin(1)

NAME
shares-admin - Enables the configuration of shared NFS / SMB directories. SYNOPSIS
shares-admin [--add-share=PATH] [gnome-std-options] DESCRIPTION
shares-admin enables a user to configure the sharing of directories / filesystems. These can be shared using either NFS or SAMBA. This is linked to the ability to right-click on a directory in Nautilus and select "Share folder". OPTIONS
The following options are supported: -a, --add-share=PATH Configure a share for the specified PATH. gnome-std-options Standard options available for use with most GNOME applications. See gnome-std-options(5) for more informa- tion. EXAMPLES
Example 1: Running the main application. example% shares-admin Example 2: Sharing a specific directory. example% shares-admin --add-share=/export/home/shared EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/shares-admin Executable for directory sharing configuration. /var/spool/setup-tool-backends/backup/shares Backup directory for files that are modified. /var/run/setup-tool-backends/debug/shares Debug logs can be found under here. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-system-tools | +-----------------------------+-----------------------------+ |Interface stability |Uncommitted | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. users-admin(1), network-admin(1), services-admin(1), time-admin(1), gnome-std-options(5), attributes(5) NOTES
Written by Darren Kenny, Sun Microsystems Inc., 2006. SunOS 5.11 6 Nov 2006 shares-admin(1)
All times are GMT -4. The time now is 06:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy