MySql returns data on a record basis and you are asking it to take a line's
worth of data from two records (the column header output is like a record)
and display it and then take the next line's worth of data from the same two
records and display it and repeat until the data from those records has been
exhausted. It is not set up to do that. 

        If I was using Oracle I would make the line size the width of the
data (~320 chars) and the page size = 1 record. I would save the results to a
file and then write perl script to do the chopping as described above. I
don't know if mysql has similar features. I didn't find them in the manual.

Barry

-----Original Message-----
From: Asif Iqbal [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 12:10 PM
To: Thomas Spahni
Cc: [EMAIL PROTECTED]
Subject: Re: mysql query output get wrapped



Did not work

prompt > echo "select * from Tickets limit 1;" | mysql mydb > res
prompt > cat res

id      EffectiveId     Queue   Type    IssueStatement  Resolution
Owner   Subject InitialPriority FinalPriority   Priority        Status
TimeWorked      TimeLeft        Told    Starts  Started Due     Resolved
LastUpdatedBy   LastUpdated     Creator Created Disabled
5       5       4       ticket  NULL    NULL    16      RE: phonebook   10
80      10      resolved        0       NULL    1970-01-01 00:00:00
NULL    NULL    1970-01-01 00:00:00     NULL    1       2001-04-17
18:38:02     1       2001-04-17 18:26:46     0

Still wrapped :-)

On Tue, 3 Jun 2003, Thomas Spahni wrote:

> Asif,
>
> try this:
>
> prompt> echo "select * from Tickets limit 1;" | mysql mydb > result.file
>
> You get everything in ONE line.
>
> Cheers,
> Thomas
>
> On Tue, 3 Jun 2003, Asif Iqbal wrote:
>
> >
> > mysql> select * from Tickets limit 1;
> >
+----+-------------+-------+--------+----------------+------------+-------+--
-------------+-----------------+---------------+----------+----------+-------
-----+----------+---------------------+--------+---------+-------------------
--+----------+---------------+---------------------+---------+---------------
------+----------+
> > | id | EffectiveId | Queue | Type   | IssueStatement | Resolution | Owner
> > | Subject       | InitialPriority | FinalPriority | Priority | Status   |
> > TimeWorked | TimeLeft | Told                | Starts | Started | Due
> > | Resolved | LastUpdatedBy | LastUpdated         | Creator | Created
> > | Disabled |
> >
+----+-------------+-------+--------+----------------+------------+-------+--
-------------+-----------------+---------------+----------+----------+-------
-----+----------+---------------------+--------+---------+-------------------
--+----------+---------------+---------------------+---------+---------------
------+----------+
> > |  5 |           5 |     4 | ticket |           NULL |       NULL |    16
> > | RE: phonebook |              10 |            80 |       10 | resolved |
> > 0 |     NULL | 1970-01-01 00:00:00 | NULL   | NULL    | 1970-01-01
> > 00:00:00 | NULL     |             1 | 2001-04-17 18:38:02 |       1 |
> > 2001-04-17 18:26:46 |        0 |
> >
+----+-------------+-------+--------+----------------+------------+-------+--
-------------+-----------------+---------------+----------+----------+-------
-----+----------+---------------------+--------+---------+-------------------
--+----------+---------------+---------------------+---------+---------------
------+----------+
> > 1 row in set (0.00 sec)
> >
> > Is there a way I can get the output unwrapped
> >
> > something like this
> >
> > mysql> select * from Tickets limit 1 \G
> > *************************** 1. row ***************************
> >              id: 5
> >     EffectiveId: 5
> >           Queue: 4
> >            Type: ticket
> >  IssueStatement: NULL
> >      Resolution: NULL
> >           Owner: 16
> >         Subject: RE: phonebook
> > InitialPriority: 10
> >   FinalPriority: 80
> >        Priority: 10
> >          Status: resolved
> >      TimeWorked: 0
> >        TimeLeft: NULL
> >            Told: 1970-01-01 00:00:00
> >          Starts: NULL
> >         Started: NULL
> >             Due: 1970-01-01 00:00:00
> >        Resolved: NULL
> >   LastUpdatedBy: 1
> >     LastUpdated: 2001-04-17 18:38:02
> >         Creator: 1
> >         Created: 2001-04-17 18:26:46
> >        Disabled: 0
> > 1 row in set (0.00 sec)
> >
> > Except I want it Horizontally
> >
> > Thanks
> >
> > Asif
> >
> >
>
>

-- 
Asif Iqbal
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x8B686E08
There's no place like 127.0.0.1


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to