troubleshooting Question

ORA-00923: FROM keyword not found where expected?

Avatar of tech_question
tech_question asked on
Oracle Database
7 Comments1 Solution3981 ViewsLast Modified:
Can someone point out where the error is ? I am stumped , just migrated from MS Sql to Oracle !

The following error has occurred:

ORA-00923: FROM keyword not found where expected
ORA-06512: at "BANK.CORP_BANK_MASTER_REPORTS", line 337
ORA-06512: at line 11


PROCEDURE get_Lob_Detail_RPT
      (
            p_lobCode IN varchar2,
            p_selFormat IN varchar2,
            io_cursor                out t_cursor
      )
IS

  vSQL varchar2(4000);

BEGIN

      vSQL := ' SELECT '       ||                                                                                             
              ' bank_accounts.bank_account_id, '                                                             ||
              ' bank_accounts.account_no, '                                                                    ||
              ' bank_accounts.account_title as account_name, '                                                             ||
              ' bank_orgs.org_code,       '                                                                           ||
              ' bank_orgs.NAME as org_name,  '                                                             ||
              ' business_accounts.bid as depository_account_id, '                                           ||
              ' bank_accounts.bank_id, '                                                                          ||
              ' banks.bank_name as BRANCH_NAME, '                                                                   ||
              ' LOBS.name as lob_name,  '                                                             ||
              ' LOBS.LOB as legacy_lob_code, '                                                             ||
              ' status_codes.description, '                                                                    ||
              ' bank_orgs.component_no as component, '                                                                         ||
              ' ''deprecated'' as loc_imprest_amount, '                                           ||
              ' ''deprecated'' as max_threshold_amount, '                                           ||
              ' bank_accounts.comments, '                                                             ||
              ' status_codes.description as curr_status '                                           ||
            ' to_char(bank_accounts.BM_open_date, ''mm/dd/yy'') as open_date, '             ||
            ' to_char(bank_accounts.BM_close_date, ''mm/dd/yy'') as close_date, '             ||
               CHR(39) || UPPER(p_selFormat)  || CHR(39) || ' as format '                  ||
            ' FROM '                                                                                                    ||
            ' Business_Accounts, Bank_Branches, Bank_Accounts, Banks, Bank_Orgs, '             ||
             '  Holding_Companies, Account_Types, Corporations, Calendar_Types, '             ||
            '  Transfer_Methods, Reconciliation_Methods, Analysis_Groups, Couriers, '       ||
            '  Currency_Codes, Localities, Status_Codes, LOBs, Business_Units '             ||
            ' WHERE  '       ||
                ' Business_Accounts.BANK_BRANCH_ID = Bank_Branches.BANK_BRANCH_ID '                    ||
               ' AND Business_Accounts.BANK_ACCOUNT_ID = Bank_Accounts.Bank_Account_ID '                    ||
               ' AND Bank_Accounts.Bank_ID = Banks.Bank_ID '                    ||
               ' AND Banks.HOLDING_COMPANY_ID = Holding_Companies.Holding_Company_ID '                    ||
               ' AND Bank_Accounts.Account_Type = Account_Types.ACCOUNT_TYPE '                    ||
               ' AND Bank_Accounts.Corporation_ID = Corporations.Corporation_ID '                    ||
               ' AND Bank_Accounts.CALENDAR_TYPE_ID = Calendar_Types.Calendar_Type_ID '                    ||
              ' AND Bank_Accounts.Transfer_Method_ID = Transfer_Methods.Transfer_Method_ID '                    ||
               ' AND Bank_Accounts.RECONCILIATION_METHOD_ID = Reconciliation_Methods.RECONCILIATION_METHOD_ID '                    ||
               ' AND Bank_Accounts.ANALYSIS_GROUP_ID = Analysis_Groups.ANALYSIS_GROUP_ID '                    ||
               ' AND Bank_Accounts.CURRENCY_CODE = Currency_Codes.CURRENCY_CODE '                    ||
               ' AND Business_Accounts.LOCALITY_CODE = Localities.LOCALITY_CODE '                    ||
               ' AND Business_Accounts.Status_Code = Status_Codes.STATUS_CODE '                    ||
               ' AND Business_Accounts.Courier_ID = Couriers.Courier_ID '                    ||
               ' AND Business_Accounts.Org_Code = Bank_Orgs.Org_Code '                    ||
               ' AND Bank_Orgs.LOB = LOBs.LOB '                    ||
               ' AND LOBs.BUSINESS_UNIT = Business_Units.BUSINESS_UNIT ';

                  vSQL := vSQL || ' AND LOBs.LOB  ='
                               || chr(39) || p_lobCode || chr(39)  ;



            insert into debug_code2 values(vSQL);
            commit;
            OPEN io_cursor FOR vSQL;

END;
ASKER CERTIFIED SOLUTION
ggridley

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros