SV: sqlplus extract question...

  • From: Jesper Haure Norrevang <jhn.aida@xxxxxx>
  • To: cstephens16@xxxxxxxxx
  • Date: Fri, 07 Jan 2005 11:26:04 +0100

Chris,

I know, that you did not ask, but anyway ...

Aren't you missing the very first quote and
the very last quote. All the quotes in between
is OK.

I think it shoud read:

select '"' || h.FAC_ID ||'","'||

and

a.INDICATOR_CD || '"'

Regards
Jesper Haure Norrevang


-----Oprindelig meddelelse-----
Fra: oracle-l-bounce@xxxxxxxxxxxxx =
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] P=E5
vegne af Chris Stephens
Sendt: 6. januar 2005 14:56
Til: Mercadante, Thomas F
Cc: oracle-l@xxxxxxxxxxxxx
Emne: Re: sqlplus extract question...


sure, the titles stop at h.NAICS_CODE||'","'||....

SET LINESIZE  32767
SET PAGES 10000
SET LINES 1024

ACCEPT fac_id NUMBER PROMPT 'Enter fac_id:'

spool c:\FAC_CHAR.txt

select h.FAC_ID ||'","'||=20
h.ORIS_CODE||'","'||
h.FACILITY_NAME||'","'||
h.DESCRIPTION||'","'||
h.STATE||'","'||
h.COUNTY_CD||'","'||
h.SIC_CODE||'","'||
h.EPA_REGION||'","'||
h.NERC_REGION||'","'||
h.NAICS_CODE||'","'||
h.SOURCE_CAT||'","'||
to_char(h.AIRSID)||'","'||
h.FINDSID||'","'||
h.STATEID||'","'||
h.LATITUDE||'","'||
h.LONGITUDE||'","'||
h.USERID||'","'||
h.ADD_DATE||'","'||
h.UPDATE_DATE||'","'||
h.FRS_ID||'","'||
h.PAYEE_ID||'","'||
h.PERMIT_EXP_DATE||'","'||
h.LATLON_SOURCE||'","'||
i.UNIT_ID||'","'||
i.ACCOUNT||'","'||
i.UNIT_DESCRIPTION||'","'||
i.FAC_ID||'","'||
i.OP_STATUS||'","'||
i.UNITID||'","'||
i.STATEID||'","'||
i.BLRSEQ||'","'||
i.RETIRE_DATE||'","'||
i.COMM_OP_DATE||'","'||
i.COMM_OP_DATE_CD||'","'||
i.COMR_OP_DATE||'","'||
i.COMR_OP_DATE_CD||'","'||
i.USERID||'","'||
i.ADD_DATE||'","'||
i.UPDATE_DATE||'","'||
f.UNT_PPL_ID||'","'||
f.UNIT_ID||'","'||
f.PPL_ID||'","'||
f.RESPONSIBILITY_ID||'","'||
f.PRG_ID||'","'||
f.BEGIN_DATE||'","'||
f.END_DATE||'","'||
f.USERID||'","'||
f.UPDATE_DATE||'","'||
f.ADD_DATE||'","'||
g.first_name||'","'||
g.last_name||'","'||
e.comp_name||'","'||
d.BEGIN_DATE||'","'||
d.END_DATE||'","'||
d.USERID||'","'||
d.ADD_DATE||'","'||
d.UPDATE_DATE||'","'||
d.RELATIONSHIP||'","'||
d.UON_ID||'","'||
d.OWN_ID||'","'||
d.UNIT_ID||'","'||
d.ONT_TYPE_CD||'","'||
c.UP_ID||'","'||
c.PRG_ID||'","'||
c.UNIT_ID||'","'||
c.BEGIN_DATE||'","'||
c.REPOWER_FLG||'","'||
c.APP_STATUS||'","'||
c.PRG_CODE||'","'||
c.EXEMPT_TYPE||'","'||
c.REPORT_FREQ||'","'||
c.CLASS||'","'||
c.END_DATE||'","'||
c.OPTIN_IND||'","'||
c.DEF_IND||'","'||
c.DEF_END_DATE||'","'||
c.STATE_REG||'","'||
c.EX_END_DATE||'","'||
c.EX_BEGIN_DATE||'","'||
c.OPHOUR_LIMIT||'","'||
c.SO2_AFFECT_YEAR||'","'||
c.SO2_PHASE||'","'||
c.NOX_PHASE||'","'||
c.NOX_GROUP||'","'||
c.NOX_STAN_LIMIT||'","'||
c.NOX_YEAR||'","'||
c.EE_IND||'","'||
c.EE_TERMYEAR||'","'||
c.USERID||'","'||
c.ADD_DATE||'","'||
c.UPDATE_DATE||'","'||
c.EE_LIMIT||'","'||
c.EX_REC_DATE||'","'||
b.UNIT_ID||'","'||
b.BEGIN_DATE||'","'||
b.FUEL_TYPE||'","'||
b.INDICATOR_CD||'","'||
b.ACT_OR_PROJ_CD||'","'||
b.END_DATE||'","'||
b.OZONE_SEAS_IND||'","'||
b.DEM_SO2||'","'||
b.DEM_GCV||'","'||
b.USERID||'","'||
b.ADD_DATE||'","'||
b.UPDATE_DATE||'","'||
b.SULFUR_CONTENT||'","'||
b.UF_ID||'","'||
a.CTL_ID||'","'||
a.UNIT_ID||'","'||
a.CONTROL_CD||'","'||
a.CE_PARAM||'","'||
a.INSTALL_DATE||'","'||
a.OPT_DATE||'","'||
a.ORIG_CD||'","'||
a.SEAS_CD||'","'||
a.RETIRE_DATE||'","'||
a.USERID||'","'||
a.UPDATE_DATE||'","'||
a.ADD_DATE||'","'||
a.INDICATOR_CD
FROMl a,
         b,
         c,
         d,
         e,
         f,
         g,
         h,
         i
WHERE h.fac_id =3D &fac_id
  and h.fac_id =3D i.fac_id
  and i.unit_id =3D a.unit_id (+)
  and i.unit_id =3D b.unit_id (+)
  and i.unit_id =3D c.unit_id (+)
  and i.unit_id =3D d.unit_id (+)
  and d.own_id =3D e.comp_id  (+)
  and i.unit_id =3D f.unit_id (+)
  and f.ppl_id =3D g.ppl_id (+)
  and f.responsibility_id IN ('PRM','ALT',NULL);

spool off



On Thu, 6 Jan 2005 08:39:14 -0500, Mercadante, Thomas F
<thomas.mercadante@xxxxxxxxxxxxxxxxx> wrote:
> Chris,
>=20
> Can you show us the Sql you are running?
>=20
> Tom
>=20
>=20
> -----Original Message-----
> From: Chris Stephens [mailto:cstephens16@xxxxxxxxx]
> Sent: Wednesday, January 05, 2005 7:35 PM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: sqlplus extract question...
>=20
> I'm creating an extract of some data that will be qa'd in an excel
> spreadsheet.  I'm creating a comma delimited file and am including the
> column headings.  There are about 60 columns from 5 or 6 tables.
> After (approximately) the fifteenth column, the headings become blank
> and I can't figure out why.  The data is fine but the headings are
> missing.  I'm not giving the columns any aliases or anything.  Is this
> a setting in sqlplus?  A quick look through my O'reilly sqlplus book
> didn't do me any good.  Before I spend some significant time trying to
> figure out what is causing this, i thought i'd start here.
>=20
> any ideas?
>=20
> tia!
>=20
> ...sarcastism welcome (expected)! :)
> --
> //www.freelists.org/webpage/oracle-l
>
--
//www.freelists.org/webpage/oracle-l

--
//www.freelists.org/webpage/oracle-l

Other related posts:

  • » SV: sqlplus extract question...