Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9223761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:09:00+00:00 2026-06-18T04:09:00+00:00

I’ve almost got the query below working, however the two fields qcare_end and warranty_end

  • 0

I’ve almost got the query below working, however the two fields qcare_end and warranty_end both generate an invalid identifier error when executing the script
Also – i’m hoping to use this script (and a couple like it) to generate a series of operations that will take a subset of data from our oracle contract and part management database and squirt it into a mysql database which we use in support when logging incidents

    Select
    'Insert Into mysqldbtable (system_id, customer_code,, serial_no, system_type, description, qcare_end, warranty_end) Values (''' 
    || system_id || ''',''' || customer_code || ''',''' || serial_no || ''',''' || system_type || ''',''' || description ||  ''')'
  FROM (SELECT SYSTEMS.SYSTEM_ID
               --            ,SYSTEMS.SITE_NAME
              , CUSTOMER_ADDRESSES.CUSTOMER_CODE
               --            , CUSTOMER_ADDRESSES.NAME
              , SYSTEMS.SERIAL_NO
              , SYSTEMS.SYSTEM_TYPE
              , PM.DESCRIPTION
               --            ,MAX(EI.END_DATE)
              , TO_DATE(NULL) AS "qcare_end"
              , MAX(systems.warranty_end) AS "warranty_end"
        --            ,systems.warranty_code
          FROM LEO.CUSTOMER_ADDRESSES CUSTOMER_ADDRESSES
               -- , LEO.CUSTOMERS CUSTOMERS
              , LEO.SYSTEMS SYSTEMS
               -- , LEO.EXHIBIT_ITEMS EI
              , LEO.PART_MASTER PM
         WHERE SYSTEMS.ADDRESS_CODE = CUSTOMER_ADDRESSES.ADDRESS_CODE
              -- AND CUSTOMER_ADDRESSES.CUSTOMER_CODE = CUSTOMERS.CUSTOMER_CODE 
              -- AND SYSTEMS.SYSTEM_ID = EI.SYSTEM_ID
           AND SYSTEMS.SYSTEM_TYPE = PM.PART_NO
         GROUP BY SYSTEMS.SYSTEM_ID,
                  SYSTEMS.SERIAL_NO,
                  CUSTOMER_ADDRESSES.CUSTOMER_CODE,
                  CUSTOMER_ADDRESSES.NAME,
                  SYSTEMS.SITE_NAME,
                  SYSTEMS.SYSTEM_TYPE,
                  PM.DESCRIPTION
        HAVING(SYSTEMS.SYSTEM_TYPE NOT IN('COMPLETE', 'ESSENTIAL', 'LOAN DEMO', 'LOAN CUSTOMER', 'MISC', 
        'ORPH-CHILD-SYS', 'ORPH_CHILD_SYS', 'PROD-BOM', 'QCARE', 'QSUPPORT', 'SPARES', 'STANDARD', 'WARRANTY', 'SOFT CARE')) 
        AND (SYSTEMS.SITE_NAME NOT LIKE '%DO NOT USE%' AND CUSTOMER_ADDRESSES.NAME NOT LIKE 'QUANTEL%' AND CUSTOMER_ADDRESSES.NAME NOT LIKE '%LOCATION NOT KNOWN%')
       UNION SELECT SYSTEMS.SYSTEM_ID
               --            ,SYSTEMS.SITE_NAME
              , CUSTOMER_ADDRESSES.CUSTOMER_CODE
               --            , CUSTOMER_ADDRESSES.NAME
              , SYSTEMS.SERIAL_NO
              , SYSTEMS.SYSTEM_TYPE
              , PM.DESCRIPTION
               --            ,MAX(EI.END_DATE)
              , MAX(EI.END_DATE) AS "QCare_End"
              , TO_DATE(NULL) "Warranty_End"
        --            ,MAX(systems.warranty_end)
        --            ,systems.warranty_code
          FROM LEO.CUSTOMER_ADDRESSES CUSTOMER_ADDRESSES
               -- , LEO.CUSTOMERS CUSTOMERS
              , LEO.SYSTEMS       SYSTEMS
              , LEO.EXHIBIT_ITEMS EI
              , LEO.PART_MASTER   PM
         WHERE SYSTEMS.ADDRESS_CODE = CUSTOMER_ADDRESSES.ADDRESS_CODE
              -- AND CUSTOMER_ADDRESSES.CUSTOMER_CODE = CUSTOMERS.CUSTOMER_CODE 
           AND SYSTEMS.SYSTEM_ID = EI.SYSTEM_ID
           AND SYSTEMS.SYSTEM_TYPE = PM.PART_NO
         GROUP BY SYSTEMS.SYSTEM_ID,
                  SYSTEMS.SERIAL_NO,
                  CUSTOMER_ADDRESSES.CUSTOMER_CODE,
                  CUSTOMER_ADDRESSES.NAME,
                  SYSTEMS.SITE_NAME,
                  SYSTEMS.SYSTEM_TYPE,
                  PM.DESCRIPTION
        HAVING(SYSTEMS.SYSTEM_TYPE NOT IN('COMPLETE',  'ESSENTIAL', 'LOAN DEMO', 'LOAN CUSTOMER'
        , 'MISC', 'ORPH-CHILD-SYS', 'ORPH_CHILD_SYS', 'PROD-BOM', 'QCARE', 'QSUPPORT', 'SPARES', 'STANDARD', 'WARRANTY', 'SOFT CARE')) 
        AND (SYSTEMS.SITE_NAME NOT LIKE '%DO NOT USE%' AND CUSTOMER_ADDRESSES.NAME NOT LIKE 'QUANTEL%' AND CUSTOMER_ADDRESSES.NAME NOT LIKE '%LOCATION NOT KNOWN%'))
where ROWNUM <= 10 ORDER BY SERIAL_NO;

This just returns 10 results, and it seems pretty sane – but if I re-add the qcare and warranty end dates, it fails with the following error:

65 where ROWNUM <= 10 ORDER BY SERIAL_NO;
|| system_id || ”’,”’ || customer_code || ”’,”’ || serial_no || ”’,”’ || system_type || ”’,”’ || description || ”’,”’
||qcare_end|| ”’,”’ ||warranty_end|| ”’)’
* ERROR at line 3: ORA-00904: “WARRANTY_END”: invalid identifier

SQL>

I’m not sure why table aliases wouldn’t work – it seems to be fine in regular queries, but not when I’m trying to generate the import statements that I can then pipe into mysql periodically.

Any thoughts on what I’m missing?
Cheers
Scott

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:09:01+00:00Added an answer on June 18, 2026 at 4:09 am

    Scott,

    The aliases don’t work because you’ve put them in double quotes and in mixed case (hint: don’t do that). That means you have to reference them that way:

    SELECT "qcare" FROM (your_query)
    

    You probably want this instead, which makes your aliases all upper case:

    , TO_DATE(NULL) AS qcare_end
    , MAX(systems.warranty_end) AS warranty_end
    

    And

    , MAX(EI.END_DATE) AS QCare_End
    , TO_DATE(NULL) Warranty_End
    

    Technically, you don’t need the aliases in the second half of the union anyway, it’s the first half of the union that drives the column names for the in-line view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
i got an object with contents of html markup in it, for example: string
I am writing an app with both english and french support. The app requests
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.