I am writing a DTS package that'll acquire data from an Oracle database to make SQL updates. The first step is a data-transformation into an existing SQL table. I used a SQL statement as the source (one source table with 8 left joins).
My problem: no matter how I write it, I get an error about a misplaced FROM clause. (error "ORA-00923") I have never used anything Oracle before...
My SELECT statement:
SELECT empl.GLOBAL_ID, Upper(PREFIX) || Foreign_ID AS OPT_ID, empl.FIRST_NAME, empl.LAST_NAME,
empl.DATE_OF_BIRTH, empl.ADDRESS1, empl.ADDRESS2, empl.ADDRESS3, empl.EMAIL,
empl.CITY,
afil.AFFILIATE_CODE, afil.AFFILIATE_DESCRIPTION,
emaf.ORIGINAL_HIRE_DATE, emaf.JOB_TITLE, emaf.JOB_GRADE, emaf.TERM_DATE,
emaf.LAST_DATE_WORKED, emaf.ANNUALIZED_SALARY
ctry.SAP_COUNTRY_CODE, ctry.SAP_COUNTRY_DESCRIPTION,
term.TERM_REASON_CODE,
payp.PAYPOINT_CODE, payp.PAYPOINT_DESCRIPTION,
curr.SAP_CURRENCY_CODE, curr.SAP_CURRENCY_DESCRIPTION, curr.EXCHANGE_RATE,
divi.DIVISION_CODE,
divc.DIV_CODE_CODE
FROM GECS_DBA_EMPLOYEE empl,
GECS_DBA_EMPLOYEE_AFFILIATE emaf,
GECS_DBA_AFFILIATE affi,
GECS_DBA_SAP_COUNTRY ctry,
GECS_DBA_SAP_CURRENCY curr,
GECS_DBA_DIVISION divi,
GECS_DBA_DIV_CODE divc,
GECS_DBA_PAYPOINT payp,
GECS_DBA_TERM_REASON term
WHERE empl.EMPLOYEE_TK = emaf.EMPLOYEE_TK (+)
AND emaf.AFFILIATE_TK = afil.AFFILIATE_TK (+)
AND afil.COUNTRY_TK = ctry.SAP_COUNTRY_TK (+)
AND afil.CURRENCY_TK = curr.SAP_CURRENCY_TK (+)
AND afil.DIVISION_TK = divi.DIVISION_TK (+)
AND afil.DIV_CODE_TK = divc.DIV_CODE_TK (+)
AND afil.PAYPOINT_TK = payp.PAYPOINT_TK (+)
AND emaf.TERM_REASON_TK = term.TERM_REASON_TK (+)
Thanks to any and all that can help me!
By the way, did I get the concatenation idea correctly, using "||" instead of SQL's "+"?
___CP___
My problem: no matter how I write it, I get an error about a misplaced FROM clause. (error "ORA-00923") I have never used anything Oracle before...
My SELECT statement:
SELECT empl.GLOBAL_ID, Upper(PREFIX) || Foreign_ID AS OPT_ID, empl.FIRST_NAME, empl.LAST_NAME,
empl.DATE_OF_BIRTH, empl.ADDRESS1, empl.ADDRESS2, empl.ADDRESS3, empl.EMAIL,
empl.CITY,
afil.AFFILIATE_CODE, afil.AFFILIATE_DESCRIPTION,
emaf.ORIGINAL_HIRE_DATE, emaf.JOB_TITLE, emaf.JOB_GRADE, emaf.TERM_DATE,
emaf.LAST_DATE_WORKED, emaf.ANNUALIZED_SALARY
ctry.SAP_COUNTRY_CODE, ctry.SAP_COUNTRY_DESCRIPTION,
term.TERM_REASON_CODE,
payp.PAYPOINT_CODE, payp.PAYPOINT_DESCRIPTION,
curr.SAP_CURRENCY_CODE, curr.SAP_CURRENCY_DESCRIPTION, curr.EXCHANGE_RATE,
divi.DIVISION_CODE,
divc.DIV_CODE_CODE
FROM GECS_DBA_EMPLOYEE empl,
GECS_DBA_EMPLOYEE_AFFILIATE emaf,
GECS_DBA_AFFILIATE affi,
GECS_DBA_SAP_COUNTRY ctry,
GECS_DBA_SAP_CURRENCY curr,
GECS_DBA_DIVISION divi,
GECS_DBA_DIV_CODE divc,
GECS_DBA_PAYPOINT payp,
GECS_DBA_TERM_REASON term
WHERE empl.EMPLOYEE_TK = emaf.EMPLOYEE_TK (+)
AND emaf.AFFILIATE_TK = afil.AFFILIATE_TK (+)
AND afil.COUNTRY_TK = ctry.SAP_COUNTRY_TK (+)
AND afil.CURRENCY_TK = curr.SAP_CURRENCY_TK (+)
AND afil.DIVISION_TK = divi.DIVISION_TK (+)
AND afil.DIV_CODE_TK = divc.DIV_CODE_TK (+)
AND afil.PAYPOINT_TK = payp.PAYPOINT_TK (+)
AND emaf.TERM_REASON_TK = term.TERM_REASON_TK (+)
Thanks to any and all that can help me!
By the way, did I get the concatenation idea correctly, using "||" instead of SQL's "+"?
___CP___