Hi all,
Can we create a report of this format using DB2.
Report#
Date:
column1 column2 column3
total
Field Name1 999 999 999
9999
Field Name 2 888 888 88
8888
Field Name 3 77 77 777
7777
Please suggest me a way to do... as of now I am using DB2 SQL in AIX
korn shell script... and we are not using any tool so is the problem...
thanks 11 1807
vp schrieb: Hi all,
Can we create a report of this format using DB2.
Report# Date:
column1 column2 column3 total Field Name1 999 999 999 9999
Field Name 2 888 888 88 8888
Field Name 3 77 77 777 7777
Please suggest me a way to do... as of now I am using DB2 SQL in AIX korn shell script... and we are not using any tool so is the problem...
thanks
are you trying to reformat a resultset (tabular-output) you are getting
with:
( only an example!)
db2 "select name,amount,remark from user_table"
NAME AMOUNT REMARK
--------------------------- --------------------
-----------------------------------------
Bush 10000.00 president
Schwarzenegger 20000.00 gouvernor
2 record(s) selected
to a report look-alike with header, footer, sum-ups ? or what are you
trying to achieve ?
use a perl-script to parse the output from the db2-command
joerg
Hi,
I have data coming from DB2 tables using EXPORT utility and on top of
it I have to include some text to identify every column and row with
some CAPTION.
thanks
vp wrote: Hi,
I have data coming from DB2 tables using EXPORT utility and on top of it I have to include some text to identify every column and row with some CAPTION.
Yes, you can. Another thread discussed this just last week. Have a look
there.
In short, you can add another row that contains the caption:
VALUES 'col1', 'col2', 'col3'
UNION ALL
SELECT ...
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Yes I am using
VALUES 'col1', 'col2', 'col3'
UNION ALL
SELECT.....
and I am getting something like
col1 col2 col3
12 78 90
34 87 45
But I need something like
col1 col2 col3
ROW1 12 78 90
ROW2 34 87 45
How should I add ROW1 and ROW2 names in this format...
vp wrote: Yes I am using
VALUES 'col1', 'col2', 'col3' UNION ALL SELECT.....
and I am getting something like col1 col2 col3 12 78 90 34 87 45
But I need something like col1 col2 col3 ROW1 12 78 90 ROW2 34 87 45
How should I add ROW1 and ROW2 names in this format...
VALUES '', 'col1', 'col2', 'col3'
UNION ALL
SELECT 'ROW' || CHAR(ROW_NUMBER() OVER()), ...
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Hi Knut,
I have caption in text for ROW1 and ROW2
Not sure how I could use ur idea ..
VALUES '', 'col1', 'col2', 'col3'
UNION ALL
SELECT 'ROW' || CHAR(ROW_NUMBER() OVER()), ...
thanks
vp wrote: Hi Knut,
I have caption in text for ROW1 and ROW2
Not sure how I could use ur idea ..
VALUES '', 'col1', 'col2', 'col3' UNION ALL SELECT 'ROW' || CHAR(ROW_NUMBER() OVER()), ...
I don't know what you mean with "caption in the text"
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
I am sorry for the confusion..
I want some thing like
member_id ssn total
INS_CD 2 5 7
DIS_CD 4 4 8
Can the above cross tab table be implemented using DB2 SQL??
What are the source table(s)?
Please show me DDL(s) and sample data that produced your example. INS_CD 2 5 7 DIS_CD 4 4 8
Hi,
I dont have a DDL yet... I have a single table were I am pulling data
for the fields...
men women total
INS_CD 2 5 7
DIS_CD 4 4 8
I have to add text like INS_CD and DIS_CD, men, women, total since I am
not getting it from the table. All i am pullng fromt eh table are
2,5,7,4,4,8...
thanks
For the top row, it can be added to the query with a UNION ALL. For the
side bar, a table can be constructed with a WITH statement, and JOINed
into the output table, assuming the correlation can be explained.
B. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Páll Ólafsson |
last post by:
Hi gurus...
Well my problem might be simple to some of you but I can't figure it out.
Im trying to export Report to pdf in code but I still getting the same
error;
"The process cannot access...
|
by: Andrea |
last post by:
I'm having some difficulty creating a report in Access and I need some
suggestions. My company issues "Return Authorizations" when customers
need to return products. A customer calls in and we...
|
by: longtim |
last post by:
I have been having endless difficulty creating reports/queries that
set any relevent parameters from controls in forms.
I am creating an application under access 2003 but will target access...
|
by: enak |
last post by:
I have found some code that shows how to convert an html
form to Word. The message said to simply put the following
in the Page_load:
Response.ContentType = "application/ms-word"...
|
by: John |
last post by:
I have 2 tables, one with dates and information about those dates, and
one with people information. I want to create a report listing each
date and the people who attended on that date (who have...
|
by: Tyranno.Lex |
last post by:
I am using Visual Studio .NET 2003 and have successfully deployed a
commercial web application written in C# and ASP.NET. I am now wanting
to add reporting using Crystal Reports and am having a...
|
by: erick-flores |
last post by:
Hello all
I am creating an Expense Report. There are to types of expenses:
Company expenses and Reimb Expeneses. The company expenses is under
"Expense Details Co" table and Reimb Expenses is...
|
by: KewlToyZ |
last post by:
Good day,
I am stuck in a strange situation. SQL 2000 Server, creating a stored procedure to use in Crystal Reports 11.
I am trying to build a report without creating a table or temprorary table in...
|
by: Andy |
last post by:
Hi guys
I having a problem creating a report in Access 2003 project talking to
a SQL database through and ODBC connect.
After hours of trying things from Access Help, MSDN and Google I still...
|
by: sklett |
last post by:
I've developed an ERP application that we use internally and works quite
well. I receiving more and more requests from users to print various
transactions, order forms, search results, etc. I...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
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
|
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...
|
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...
| |