473,379 Members | 1,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

concise SQL results

I'm writing a shellscript where I'm performing some SQL queries and
assigning the results to variables. The problem is that the query produces
a column heading, some underline characters and '1 record(s) selected' as
well as the result. All of this text is being assigned to my variable.

Is there any way of just getting the result itself without all the
surrounding stuff ?

Thanks

Ross
Nov 12 '05 #1
4 3467
Roos,

use db2 -x

regards,
Joachim Müller

"Ross Morton" <x@xxx.com> schrieb im Newsbeitrag
news:c8**********@singer.cent.gla.ac.uk...
I'm writing a shellscript where I'm performing some SQL queries and
assigning the results to variables. The problem is that the query produces a column heading, some underline characters and '1 record(s) selected' as
well as the result. All of this text is being assigned to my variable.

Is there any way of just getting the result itself without all the
surrounding stuff ?

Thanks

Ross

Nov 12 '05 #2
"Ross Morton" <x@xxx.com> wrote in message
news:c8**********@singer.cent.gla.ac.uk...
I'm writing a shellscript where I'm performing some SQL queries and
assigning the results to variables. The problem is that the query produces a column heading, some underline characters and '1 record(s) selected' as
well as the result. All of this text is being assigned to my variable.

Is there any way of just getting the result itself without all the
surrounding stuff ?
db2 -x

i..e in ksh
a=`db2 -x values current timestamp`
echo $a

2004-05-13.11.11.357301
Regards
Paul Vernon
Business Intelligence, IBM Global Services
Nov 12 '05 #3
Use
db2 -x
see:
http://publib.boulder.ibm.com/infoce...e/c0010412.htm
"-x This option tells the command line processor to return data without
any headers, including column names."

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4
Thanks to all of you - db2 -x works perfectly !

Ross

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
2
by: Dean Arnold | last post by:
I checked the 7.4 PL/pgSQL docs but couldn't find a concise grammar description e.g. a BNF diagram...is any such thing available online ? I'm looking to possibly port a stored procedure debugger...
3
by: kim | last post by:
Does anyone know of concise c# & .NET study materials...like all the keywords in one place, etc?
2
by: mark4asp | last post by:
Hello, I am converting an app from JavaScript to ASP.NET I have the following JavaScript 'associative array'. Is there a concise way to create an analogous structure in .NET Framework using...
1
by: Don | last post by:
I am new to Indexing Services, have been researching the MS Site as well as web articles on DevHood, etc. I have set up a seperate catalog ("KnowledgeBase") on Win XP with a number of files. I am...
0
by: Rob | last post by:
I doubt this is the best way to do it, but what I came up with was to hide the XML in an HTML Comment then edit the file deleting the HTML stuff and keep the XML results. If anyone has a better...
4
by: jaYPee | last post by:
I have downloaded some source code but I want this to convert the results into datagrid. dr = cmd.ExecuteReader() '**************************************** ' SHOW THE RESULTS...
1
by: oaklander | last post by:
Is it okay to keep creating queries with the same ResultSet Object reference (results)? Here is what I am currently using in my Database statements with Oracle and everything works but was wondering...
4
by: Kurien Mathew | last post by:
Hello, What will be a concise & efficient way to convert a list/array.array of n elements into a hex string? For e.g. given the bytes I would like the formatted string 0x74 0x6f 0x6e 0x67...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.