Home » Other » Client Tools » view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? (11g)
view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565399] Tue, 04 September 2012 04:26 Go to next message
oranooob
Messages: 88
Registered: May 2009
Member
Hi

Howto generate with SQL*Plus a *.csv that can be viewed with iPhone (iOS)? Don't wish to install additional app. Should be viewable in default app.

At the moment there is character garbage in iPhone, but on Windows with Excel the file opens fine.

generate_csv ()
{

sqlplus -S $USER/$PASSWD@$ORACLE_SID <<EOF > /opt/oracle/reports/service_report_.$(/bin/date '+%d%m%Y.%Hh')

set echo Off
set term On
set pages 0
set head off
set ver off
set feed off
set trims on
set linesize 20000

SELECT    serial
   || ';'
   || upd_time
   || ';'
   || MESSAGE
   || ';'
   || entity_table
   || ';'
   || action
   || ';'
   || rss_name
   || ';'
   || rss_type
   || ';'
   || admin
   || ';'
   || ess_user
   || ';'
   || origin
   || ';'
   || rss_user_name
   || ';'
   || ug_name
   || ';'
   || original_command
  FROM trans
[...]

exit
EOF
}

Re: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565403 is a reply to message #565399] Tue, 04 September 2012 04:36 Go to previous messageGo to next message
muralikri
Messages: 638
Registered: August 2011
Location: chennai
Senior Member

You mean to say "spooling the file"? if yes use spool option
Re: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565409 is a reply to message #565399] Tue, 04 September 2012 05:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And how is this an Oracle problem?

Regards
Michel
Re: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565417 is a reply to message #565409] Tue, 04 September 2012 06:03 Go to previous messageGo to next message
oranooob
Messages: 88
Registered: May 2009
Member
Michel Cadot wrote on Tue, 04 September 2012 05:15
And how is this an Oracle problem?

Regards
Michel


I need to send a report (data source is Oracle 11g) that is vievable in iPhone! Because I know only two languagaes Shell Scripts and SQL, the Code shoud be in one of those.

Dude, managers love their gadgets.
Re: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565419 is a reply to message #565417] Tue, 04 September 2012 06:14 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
This is still an IOS problem not an oracle one.
You're far more likely to get a useful answer on an IOS forum.
Re: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565427 is a reply to message #565419] Tue, 04 September 2012 07:00 Go to previous messageGo to next message
oranooob
Messages: 88
Registered: May 2009
Member
I found the solution myself. I used as field seperator ";" (semicolons). I tried with "," (comma) and you can open it on iOS. So it was not an iOS problem, it was a problem with my SQL/shell code.
Re: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv? [message #565436 is a reply to message #565427] Tue, 04 September 2012 07:41 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
So IOS requires a comma seperated file to actually be comma seperated.
Fair enough.
Previous Topic: Comment on Column with & symbol
Next Topic: listner configuration
Goto Forum:
  


Current Time: Thu Mar 28 05:18:22 CDT 2024