Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Unanswered: loop sql query and export data to xlsx format

    Hi

    i have the below query. by using the below query on changing vehicle nos i have to download the data to excel(xlsx) format. i have to download close to 1000 files in short duration. so please help me in automatin the query. i am very new to this. each file ahas to be saved on the vehicle no name like "7383.xlsx". vehicle nos are in ascending order.

    SELECT
    record_type,
    CUSTOMER_ID,
    VEHICLE_NO,
    FLEET_NO,
    FAULT_CODE,
    FAULTDESC,
    OCCUR_DATE,

    ENGINE_HP_AVAILABLE

    FROM gets_dw_eoa_tier2_dccca_v

    Where customer_id = 'BNSF'
    AND fleet_no like'SFX29'
    AND vehicle_no ='7383' AND occur_date > '01-JAN-06'

    AND basic_gps_lat <> '0:0:0.0'
    AND basic_gps_lat <> 'NULL'

    AND FAULTDESC <> 'NULL'
    AND FAULTDESC NOT LIKE 'BCC%'
    AND FAULTDESC NOT LIKE 'Checking For Ground On TM%'

    AND FAULT_CODE NOT LIKE 'PP%'
    AND FAULT_CODE NOT LIKE '0B%'
    AND FAULT_CODE NOT LIKE '44%'

    AND FAULT_CODE <> 'LC75-02'
    AND FAULT_CODE <> 'H00000'
    AND FAULT_CODE <> 'ANM'
    And FAULT_CODE <> 'OILFLT'

    ORDER BY OCCUR_DATE ASC;

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    > i have to download the data to excel(xlsx) format.
    UP & DOWN are relative & I am unclear which way is up.
    Oracle does not know how to write XLSX files; so what is acceptable alternative?

    post results of following SQL

    SELECT * FROM V$VERSION;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •