Sponsored Content
Top Forums Programming accessing unix variables in oracle Post 302164944 by ravi raj kumar on Wednesday 6th of February 2008 08:52:06 AM
Old 02-06-2008
accessing unix variables in oracle

Hi,
consider the following script.


ip='***.***.**.**'
user='****'
pw='******'
ftpresults=`ftp -nv $ip<<EOF
user $user $pw
cd /home/oracle/practice
size $1
bye
EOF`
fname=$1
echo $ftpresults
sqlplus -s tms/tms@dev45 <<"EOF"
insert into remote_file_sizes (file_name,file_size) values ($fname,$ftpresults);
commit;
EOF

In the above script i am getting the size of a remote file through and i am inserting it into oracle table.
But i am not able to access the filename($fname)and filesize ($ftpresults) in insert statement.

can anybody tell me how to access these unix variables in oracle insert statement.

cheers
RRK
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

accessing ksh variables from awk

hi everybody! i am running this ksh script for replacing a set of strings by another set of new ones. i am getting both these from a file. also, the strings that i want to replace, are sub-strings(can occur more than once in each chunk) in a big chunk of data that i have bulk-copied(bcp utility)... (1 Reply)
Discussion started by: trupti wagh
1 Replies

2. Shell Programming and Scripting

Accessing Variables from .conf file

I can't figure out how to access variables that are stored in a separate file. Can someone let me in on the secret? Please, and thank you. -Kevin (7 Replies)
Discussion started by: wayne1411
7 Replies

3. Shell Programming and Scripting

Problem in accessing variables outside shell

Hi, I have a shell script wherein i am doing some file operations and storing the data in some variables. I am exporting these variables as i need to use them outside shell. Then within the shell i am launching GDB session hoping that i will be able to access the exported variables in the GDB... (2 Replies)
Discussion started by: jsantosh
2 Replies

4. AIX

Problem accessing Oracle Directory on AIX

What are we doing ? 1) We ftp a PDF file to Oracle Directory which is on AIX server, using Business Object Server. The ftp account we use is prmtftdv. The oracle directory is owned by "oracle" account on aix. The default file permission is 640. 2) We are trying to read the PDF file using oracle... (1 Reply)
Discussion started by: ssatyaranga
1 Replies

5. AIX

Accessing Oracle DB via Shell possible ?

At work we are using AIX 4.2 for the client. On this system, there is Oracle and kron, Bash and C shell. Is it possible to access Oracle via the shell to create/update tables ? There is this hourly data that we accumulate on the AIX and we manually copy the infos to Excel for stats. I thought... (2 Replies)
Discussion started by: Browser_ice
2 Replies

6. UNIX and Linux Applications

Accessing Oracle via encrypted password

Actually in my application there is an XML file. The password and the user name for the database that I need to access the development box is stored there. But using some UNIX command I am able to access the raw content of the file and not the decrypted code for that password. When I am applying... (3 Replies)
Discussion started by: nandumishra
3 Replies

7. Shell Programming and Scripting

Accessing variables outside the function

I have the below code to find yesterdays date, In this I want to make MONTH, DAY and YEAR as global variableand use it outside the {}, but I am unable to do so , please assist: #!/usr/bin/ksh date '+%m %d %Y' | { read MONTH DAY YEAR DAY=`expr "$DAY" - $1` case "$DAY" in 0) ... (1 Reply)
Discussion started by: mohsin.quazi
1 Replies

8. Shell Programming and Scripting

Oracle Query results to be stored in variables using unix

I want to store the sql query output into a variable #!/bin/ksh ORACLE_SID=DB01; export ORACLE_SID; export FILE_PATH=/home/asg/Tmp # Order Checking echo " removing old files " rm $FILE_PATH/Malformed_Order.txt echo " Enter the Malformed Order ....!" read orders echo "Regrade... (5 Replies)
Discussion started by: Nareshp
5 Replies

9. Programming

Oracle accessing from remote host

i have installd oracle 10 on Solaris 10 now i want to access this database from remote machine. -bash-3.00$ tnsping 192.168.92.49 TNS Ping Utility for Solaris: Version 10.2.0.2.0 - Production on 17-DEC-2010 21:06:51 Copyright (c) 1997, 2005, Oracle. All rights reserved. Used parameter... (23 Replies)
Discussion started by: akhaliq22
23 Replies

10. Shell Programming and Scripting

Help Needed: UNIX shell variables to store Oracle table records

Hello Folks, I'm working on a requirement to automate the process of generating report(csv file) using metadata info stored in an Oracle table and E-mail it to respective people. Meta data table: Report_ID,Report_SUB_ID,Report_DB,Report_SQL,Report_to_email_Id 1,1,DEV,'select * From... (2 Replies)
Discussion started by: venkat_reddy
2 Replies
capture-schema(1m)					    Application Server Utility						capture-schema(1m)

NAME
capture-schema - stores the database metadata (schema) in a file for use in mapping and execution SYNOPSIS
capture-schema-dburl url-username name- password password-driver a_jdbc_driver [-schemaname name] [-table tablename]* [-out filename] Stores the database metadata (schema) in a file. You can also use the Sun Java System Studio IDE to capture the database schema. Run cap- ture-schema as the same database user that owns the tables, so that the -username and -schemaname options are given the same username. Additionally, you can grant the database user running the capture-schema command the ANALYZE ANY TABLE privilege. OPTIONS
-dburl JDBC URL expected by the driver for accessing a database. -username user name for authenticating access to a database. -password password for accessing the selected database. -driver JDBC driver classname in your CLASSPATH. -schemaname name of the user schema being captured. If not specified, the default will capture metadata for all tables from all the schemas accessible to this user. Specifying this parameter is highly recommended. If more than one schema is accessible to this user, more than one table with the same name may be captured which will cause problems. -table name of the table; multiple table names can be specified. -out output target; defaults to stdout. This parameter corresponds to the schema sub-element of the sun-cmp-mapping ele- ment in the sun-cmp-mapping_1_1.dtd file. EXAMPLES
Example 1: Using capture-schema capture-schema -dburl jdbc:oracle:thin:@sadbuttrue:1521:ora817 -schemaname cantiflas -username CANTIFLAS -password enigma -driver oracle.jdbc.driver.OracleDriver asadmin(1M) Sun Java System Application Server March 2004 capture-schema(1m)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy