Selecting tables


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Selecting tables
# 1  
Old 07-30-2013
Selecting tables

Hi,
Can anyone help me that, How to see the table fields in Oracle database through shell script(ksh).
I have tried with the following:

Code:
sqlplus -s $user/$passwd@$sid << SQL >> session.log

Code:
 select * from Testtab.sql

I'm not able to see anything..


Thanks

Last edited by Scott; 07-30-2013 at 06:20 AM.. Reason: Please use code tags
# 2  
Old 07-30-2013
What do you see in the session log if you take out the -s option?
# 3  
Old 07-30-2013
Error

Hi Skrynesaver,

I can able to see the same response, after removing -s option
# 4  
Old 07-30-2013
Try the following
Code:
sqlplus  $user/$passwd@$sid << SQL 2>&1 >> session.log
select * from Testtab.sql
SQL

And let us know what appears in the session.log file
# 5  
Old 07-30-2013
Lightbulb

Hi,

when i tried with this I got the output as follows

Code:
sqlplus  $user/$passwd@$sid << SQL 2>&1 >> session.log
select * from Testtab.sql
SQL

ksh: user: 0403-041 Parameter not set.

and I tried the following and I got :

Code:
sqlplus  mqiuedev01/mqiuedev01@mwdbd1;

SQL> create table TestPurge(Name varchar2(50),RecordDate date,Details varchar2(100));

Table created.

SQL> select * from TestPurge

no rows selected

Thanks

Last edited by Scott; 07-30-2013 at 06:21 AM.. Reason: Removed formatting; added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Size Selecting rows

I have a rather convoluted script that I use to extract information from CSV files: sed '1d' PeakTable.txt | awk -F ',' '!/Ladder/{ if ( $4 > 430 && $4 < 490 && $5 > 45 ) print $2, $5; else print $2, 0 }' | awk '{a+=$2}END{for(i in a){print i, a}}' | sed 's/\(\)\(\) /\10\2 /' | sort | awk... (4 Replies)
Discussion started by: Xterra
4 Replies

2. Shell Programming and Scripting

Selecting groups

I have a file with contents like host1.domain.com:9090,host2.domain.com:9090,host3.domain.com:9090 I am looking for such an operation so that, the output should be host1.domain.com:9090 host2.domain.com:9090 host3.domain.com:9090 And also, if the number of entries are more, the... (1 Reply)
Discussion started by: anil510
1 Replies

3. Shell Programming and Scripting

selecting certain files

Hi, I have been working on a punch of codes and I got to a problem I hope to get help on. I have some files that I want to work with but the folder has other files in it. For example: The folder contains these files: path to files: /home/distribution/ ls: b.10; b.11; b.12; b.20; b.222;... (2 Replies)
Discussion started by: iconig
2 Replies

4. Shell Programming and Scripting

Selecting data between [ and ]

Hi Team, I am searching through log file using grep -i '<search_key>' <file_name>|awk '{print $18}' example outputs are I would like to select the data between and no other as I am getting some junk characters sometimes which chaging the o/p display format. Kindly assist.... (8 Replies)
Discussion started by: sanjaydubey2006
8 Replies

5. Shell Programming and Scripting

Selecting a range of Lines

Hi All, Is there a way to get a range of lines from a file??? I want to search through a set of scripts and need to select the group of lines which do the FTP. Say, Line1 Line2 ftp SERVER user UNAME PASS send FILE_TO_BE_SENT close Line3 Line4 Line5 ftp SERVER1 user USER1 PASS1... (6 Replies)
Discussion started by: beinthemiddle
6 Replies

6. Shell Programming and Scripting

about selecting lines

Hello , i got text file like that' C:\Users\Public\Pictures\Sample Pictures\aa.jpg C:\Users\Public\Pictures\Sample Pictures\thumb.jpg C:\Users\Public\Pictures\vv\cc.jpg C:\Users\Public\Pictures\Sample Pictures\ee.jpg C:\Users\Public\aa\Sample Pictures\cvswsr.jpg... (1 Reply)
Discussion started by: davidkhan
1 Replies

7. Shell Programming and Scripting

Selecting a string

Hi, I have a small question... Since i am new to Unix ksh scripting i am having this problem of understanding... Well the thing is that i just want a part of a line for example Data Set=ELIG_Member_20090126.dat Count Total= 8192 Actual Total= 8187 I just want the value of Actual Total... (4 Replies)
Discussion started by: bhagya2340
4 Replies

8. Shell Programming and Scripting

Selecting one file from a list

Hi, I am able to do this by brute force but I am just curious if there is a better way of handling things. Basically the scenario is something like this: There are a number of files in a directory: rib.20071224.1759.gz 24-Dec-2007 17:59 132K rib.20071224.1959.gz 24-Dec-2007... (7 Replies)
Discussion started by: Legend986
7 Replies

9. Shell Programming and Scripting

Selecting a line value

Hello, I just wanted to know if there is a way in UNIX to select a line value from a list of words. there is no line number before each word, hence could not use grep. (4 Replies)
Discussion started by: unibboy
4 Replies

10. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies
Login or Register to Ask a Question