Create view throwing an error

Hello guys, I am trying to create a view from the result set of a sql query. The sql when run independently works fine, but when I try to create a view on it it throws an error saying that the table does not exist. below is the create view I am using.
create view ops$oracle.pci_view as SELECT
     (select name from v$database@dwdev) database_name,
      (select host_name from v$instance) host_name,
      (select version from v$instance) dbversion,
       o.owner,
       o.object_name table_name,
       o.CREATED table_created,
       o.last_ddl_time table_last_ddl_time,
       t.tablespace_name,
       t.last_analyzed,
       t.partitioned,
       t.num_rows,
       T.COMPRESSION,
       t.compress_for,
       t.read_only,
       tb.status tablespace_status,
       tb.encrypted tablespace_encrypted,
       tb.compress_for tablespace_compress,
       tb.contents,
       TC.COLUMN_NAME,
       tc.data_type,
       TC.DATA_LENGTH,
       tc.data_precision,
       tc.data_scale,
       tc.nullable,
       tc.column_id,
       tc.num_distinct,
       tc.avg_col_len,
       tc.density,
       tc.num_nulls,
       tc.low_value,
       tc.high_value,
       tc.last_analyzed col_last_analyzed,
       ec.encryption_alg,
       ec.salt,
       ec.integrity_alg,
       (SELECT tcm.comments
          FROM dba_tab_comments tcm
         WHERE tcm.owner = T.OWNER AND tcm.table_name = t.table_name)
          table_comments,
       (SELECT ccm.comments column_comments
          FROM dba_col_comments ccm
         WHERE     ccm.owner = TC.OWNER
               AND ccm.table_name = tc.table_name
               AND ccm.column_name = tc.column_name)
          column_comments
  FROM dba_objects o,
       dba_tables T,
       dba_tablespaces tb,
          dba_tab_columns tc  
        LEFT JOIN
          dba_encrypted_columns ec      ***********************************************
       ON     ec.owner = TC.OWNER
          AND ec.table_name = tc.table_name
          AND ec.column_name = tc.column_name
WHERE o.owner NOT IN
          ('APPQOSSYS',
           'DBSNMP',
           'EXFSYS',
           'GGAPP',
           'OPS$ORACLE',
           'ORACLE_OCM',
           'OUTLN',
           'SYS',
           'SYSTEM',
           'WMSYS',
           'XDB')
       AND o.object_type = 'TABLE'
       AND NOT EXISTS
                  (SELECT 1
                     FROM dba_mviews mv
                    WHERE mv.owner = o.owner
                          AND mv.container_name = o.object_name)
       AND t.owner = o.owner
       AND t.table_name = o.object_name
       AND tb.tablespace_name = t.tablespace_name
       AND tc.owner = o.owner
       AND tc.table_name = o.object_name
       AND tc.owner = t.owner
       AND tc.table_name = t.table_name
       AND tc.data_length > 15
       AND tc.data_type NOT LIKE ('TIMESTAMP%')
       AND (tc.data_precision IS NULL OR tc.data_precision > 15);(The line containing the string of astrixes, that is the table that the error says does not exist)
can someone help me where I am going wrong.
Thanks

969224 wrote:
what if I create the view in SYS for few minutes until i can complete the task i was assigned and after that drop the view I created in SYS schema, would that have any effect on the database?Uh, yeah .. SYS isn't any better an option than SYSTEM.
Those schemas are "off limits" to us ... ignore them .. pretend they do not exist. (seriously ..)
Sounds like you need a new schema to store your application objects.

Similar Messages

  • Simple Create procedure throws compile error

    I have a table MyTable with two fields key and value. The table has few records with some number values.
    I want to increment this number value and return the updated number value from a procedure.
    Below is the procedure that I wrote. When I try to run this, I get this error from the SQLPlus prompt.
    Warning: Procedure created with compilation errors.
    Here is the procedure.
    CREATE OR REPLACE PROCEDURE GetNextValue
         (v_key IN VARCHAR2(25), v_value OUT NUMBER DEFAULT -1) AS
    BEGIN
         UPDATE MyTable SET value=value+1 WHERE key=v_key;
         SELECT value INTO v_value FROM MyTable WHERE key=v_key;
    END GetNextValue;
    I stored this in a .sql file.
    Also is there any way that I can write the body in single query to both update the value and return it in the return variable?
    Appreciate your help.

    Hi,
    When creating a PL/SQL procedure, always say SHOW ERRORS on a separate line right after the /. That will geive you more detailed error messages.
    In this case, you'll probably get "OUT and IN OUT formal parameters may not have default expressions".
    If you want v_value set to -1 in the event that there is no row with key=v_key, then you can say:
    CREATE OR REPLACE PROCEDURE GetNextValue
    (   v_key    IN   VARCHAR2
    ,   v_value  OUT  NUMBER
    AS
    BEGIN
        UPDATE MyTable
            SET value=value+1
            WHERE key=v_key;
        SELECT value
            INTO v_value
            FROM MyTable
            WHERE key=v_key;
    EXCEPTION
        WHEN  NO_DATA_FOUND  THEN
            v_value := -1;
        WHEN OTHERS  THEN
            RAISE;
    END GetNextValue;
    SHOW ERRORS

  • Creating CreditNote throw  Internal error -5002

    Hi experts,
    I have a problem creating CreditNote via DI.
    thorw error: "Returncode: -5002:: Se produjo un error interno (-5002)"  (internal error)
    Anybody could help me? Its extrange this error because the same code had work fine times ago
    My code is:
    oAbono.CardCode = oDev.CardCode
                        oAbono.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
                        oAbono.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
                        oAbono.DocumentSubType = SAPbobsCOM.BoDocumentSubType.bod_None
                        oAbono.DocDate = oDev.DocDate
                        oAbono.SalesPersonCode = oDev.SalesPersonCode
                        'amm 20081014 forzar % a cero oAbono.DiscountPercent = oDev.DiscountPercent
                        oAbono.Comments = "Viene del albarán: " + oDev.DocNum.ToString
                        oAbono.UserFields.Fields.Item("U_FGIMAR").Value = oDev.UserFields.Fields.Item("U_FGIMAR").Value
                        oAbono.UserFields.Fields.Item("U_FGIDEMAR").Value = oDev.UserFields.Fields.Item("U_FGIDEMAR").Value
                        oAbono.UserFields.Fields.Item("U_FGIName2").Value = oDev.UserFields.Fields.Item("U_FGIName2").Value
                        strProducto = "Select [U_FGIVIAB] as Via, [U_FGICONB] as Cond from [@FGIPAR]"
                        orecordset.DoQuery(strProducto)
                        oAbono.PaymentMethod = orecordset.Fields.Item("Via").Value
                        oAbono.PaymentGroupCode = orecordset.Fields.Item("Cond").Value
                        oAbono.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO
                        'Linea de factura
                        oAbono.Lines.SetCurrentLine(0)
                        strProducto = "Select [U_FGIPRD] as Prod, [U_FGIPRD1] as Prod1,[U_FGIPRD2] as Prod2, [U_FGIPRD3] as Prod3 from [@FGIPAR]"
                        orecordset.DoQuery(strProducto)
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "101" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "103" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod1").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "104" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod2").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "102" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod3").Value.ToString
                        End If
                        strIva = "Select [U_FGIIVAR] as Iva from [@FGIPAR]"
                        orecordset.DoQuery(strIva)
                        oAbono.Lines.VatGroup = orecordset.Fields.Item("Iva").Value.ToString
                        ' Para los albaranes  tomamos el total del albarán.
                        oAbono.Lines.Quantity = 1
                        Dim precio As Double
                        precio = (oDev.DocTotal - oDev.VatSum)
                        Dim neto As Double
                        neto = precio
                        oAbono.Lines.Price = CDbl(neto)
                        lRetCode = oAbono.Add()
                        If lRetCode <> 0 Then
                            vCompany.GetLastError(lErrCode, sErrMsg)
                            GuardarLog("InsertarOfertaEspecialAbono: Failedu2026; Returncode: " + CStr(lErrCode) + ":: " + sErrMsg)
                            Return False
                        End If

    Solved problem!.
    The Origin of then problem is a PaymentMethod.
    My AddOn set PaymentMethod ='C' and this paymentMethod is not set in BP Card.
    I hope this trhead would be useful for the future for another person
    Regards

  • Create materialized view throws insufficient privileges in single schema

    I'm trying to create a complex materialized view in my own schema, using only tables from my own schema:
    CREATE MATERIALIZED VIEW MYSCHEMA.MYMVIEW AS
        SELECT
            A.ONE_THING,
            B.ANOTHER_THING,
            C.A_THIRD_THING
        FROM MYSCHEMA.TABLEA A
        JOIN MYSCHEMA.TABLEB B
            ON A.COL1 = B.COL1
        JOIN MYSCHEMA.TABLEC C
            ON A.COL2 = C.COL2The line JOIN MYSCHEMA.TABLEB B throws an ORA-01031: insufficient privileges error, highlighting TABLEB.
    I understand that grants need to be explicit on tables when creating objects across schemas, but this code is operating within my own schema only; i created and own all the tables in this schema.
    What's going on?
    Thanks!

    Perhaps it is the tool that i am using that highlights the wrong item, because as it turns out, i don't have the CREATE MATERIALIZED VIEW permission after all (the permission was mistakenly granted to a different user instead of to me).
    SELECT * FROM SESSION_PRIVS;returns CREATE VIEW, but does not return CREATE MATERIALIZED VIEW.
    Sorry to have wasted your time.

  • Error while creating view

     Hello,
    I am trying to create view which is based on multiple source tables and I am receiving following error 
    Internal error: An expression services limit has been reached. Please look for potentially complex expressions in your query, and try to simplify them.
    Can anyone know how to resolve this.
    Thanks,

    See MS Support for how to solve it:
    Error message when you run a query in SQL Server 2005: "Internal error: An expression services limit has been reached"
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Error while creating view in component - BT115H_SLSO

    Hi All,
    When I am creating view in the BSP Component workbench(T/code: BSP_WD_CMPWB), I
    am getting the error "Invalid GUI INPUT DATA :INVALID XMLBLOB DATA" shot and suggest me how to come out of this error.
    Component: BT115H_SLSO
    Regards,
    Praveen

    Hello,
    The problem could be a SAPGUI related problem... Whats the current sapgui patch level ? Does it work when you try on another wokstation with the same user ?
    Could you please use SAPGUI 720 and update your patch level to 7 ? Then check the behaviour again.
    Best regards
    Rene

  • Non-sense error message trying to create view

    Greetings All,
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production on Windows 2008R2
    I am getting an error while trying to create a view. The error makes no sense in that no attempt to change a user name or password as the error message being produced suggests.
    I can execute the entire select statement fine, I get results back.
    If I comment out the line indicated as being in error, the problem moves to the line prior to the one commented out. The 4 lines prior to the line indicated by the error message are similar. The error is occurring on the last of the 5 similar lines of code.
    If I move all 5 lines further up in the code the error moves accordingly.
    The function validate_number (near where the error is identified) under certain conditions will issue a execute immediate 'alter session set nls_numeric_characters = ''.,''';
    The column number identified in the error message is 2 spaces prior to the validate_number function call.
    Below is the syntax for the creation of the view, the error message is at the bottom.
    The numbers to the far left indicate the line number. I put 2 blank lines before and after the line of code identified by the error message.
    The error points to the 2-spaces in front of the VALIDATE_NUMBER function call on line 350. just before the sql code ==> validate_number(Spend_Qty,'')),0) <==
    Thanks for your time,
    Bob
    CREATE OR REPLACE VIEW REPORT_STAGING_V AS
    -  SELECT
    -    SPEND_STAGING.INPUT_FILE_ID,
    -    SPEND_STAGING.SPEND_ID,
    -    SPEND_STAGING.SPEND_DOC_NUM,
    -    SPEND_STAGING.SPEND_DOC_ITM_NUM,
    -    SPEND_STAGING.SPEND_DOC_YR_NUM,
    -    SPEND_STAGING.ACCT_PYBL_INV_DOC_NUM,
    -    SPEND_STAGING.ACCT_PYBL_INV_FSCL_YR_NUM,
    -    SPEND_STAGING.COMPANY_CODE,
    -    SPEND_STAGING.ACCT_PYBL_INV_LN_ITM_NUM,
    -    SPEND_STAGING.SPEND_DOC_TYPE_CD,
    -    SPEND_STAGING.SPEND_MTHD_TXT,
    -    NVL(SPEND_STAGING.SRC_SYS_CD, '<BLANK>') SRS_SYS_CD,
    -    SPEND_STAGING.SPEND_SAVING_DT,
    -    SPEND_STAGING.SPEND_SAVING_FSCL_WK_NUM,
    -    SPEND_STAGING.SPEND_SAVING_FSCL_MTH_NUM,
    -    SPEND_STAGING.SPEND_SAVING_FSCL_QTR_NUM,
    -    SPEND_STAGING.SPEND_SAVING_FSCL_YR_NUM,
    -    SPEND_STAGING.MTRL_GRP_CD,
    -    SPEND_STAGING.MTRL_GRP_DESC_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_1_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_2_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_3_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_4_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_5_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_6_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_7_TXT,
    -    SPEND_STAGING.MTRL_GRP_LVL_8_TXT,
    -    SPEND_STAGING.GL_ACCT_NUM,
    -    SPEND_STAGING.GL_ACCT_DESC,
    -    SPEND_STAGING.COST_CENTR_CD,
    -    SPEND_STAGING.PRFT_CENTR_CD,
    -    SPEND_STAGING.FUNCNL_AREA_CD,
    -    SPEND_STAGING.PURCH_GRP_CD,
    -    SPEND_STAGING.PURCH_GRP_NAM,
    -    SPEND_STAGING.PURCH_ORG_CD,
    -    SPEND_STAGING.PURCH_ORG_NAM,
    -    SPEND_STAGING.REGION_CODE,
    -    SPEND_STAGING.VNDR_ACCT_ROOT_NUM,
    -    SPEND_STAGING.VNDR_CORP_NAM,
    -    SPEND_STAGING.VNDR_CORP_TICKER_SYMBL_CD,
    -    SPEND_STAGING.BUYPOINT_VNDR_ACCT_NUM,
    -    SPEND_STAGING.BUYPOINT_VNDR_FIRST_NAM,
    -    SPEND_STAGING.PAYPOINT_VNDR_ACCT_NUM,
    -    SPEND_STAGING.PAYPOINT_VNDR_FIRST_NAM,
    -    SPEND_STAGING.SPEND_PYMNT_TERM_CD,
    -    SPEND_STAGING.SPEND_PYMNT_TERM_DESC,
    -    SPEND_STAGING.SPEND_PYMNT_BSLN_DT,
    -50  SPEND_STAGING.SPEND_PYMNT_CLRNG_DT,
    -    SPEND_STAGING.CONTRACTUAL_PYMNT_TERM_DY_CNT,
    -    SPEND_STAGING.VNDR_MTRL_NUM,
    -    SPEND_STAGING.MTRL_ID_1280,
    -    SPEND_STAGING.MTRL_DESC,
    -    SPEND_STAGING.BAT_NUM,
    -    SPEND_STAGING.SPCL_STOCK_IND,
    -    SPEND_STAGING.INVTY_MVMNT_TYPE_CD,
    -    SPEND_STAGING.GOODS_RCPNT_NAM,
    -    SPEND_STAGING.MFG_PART_NUM,
    -    SPEND_STAGING.PLANT_CD,
    -    SPEND_STAGING.PLANT_DESC,
    -    SPEND_STAGING.STORAGE_LOC_CD,
    -    SPEND_STAGING.STORAGE_LOC_DESC,
    -    SPEND_STAGING.UNLOADING_PT_DESC,
    -    SPEND_STAGING.PO_NUM,
    -    SPEND_STAGING.PO_LN_ITM_NUM,
    -    SPEND_STAGING.PO_LN_ITM_LAST_CHNG_DT,
    -    SPEND_STAGING.PO_DOC_DT,
    -    SPEND_STAGING.PO_TYPE_CD,
    -    SPEND_STAGING.PO_TYPE_DESC,
    -    SPEND_STAGING.PO_UOM_CD,
    -    SPEND_STAGING.PO_PYMNT_TERM_CD,
    -    SPEND_STAGING.ASGND_ACCT_CTGRY_TYPE_CD,
    -    SPEND_STAGING.PO_SHORT_TXT,
    -    SPEND_STAGING.GR_MTRL_DOC_TXT,
    -    SPEND_STAGING.ACCT_PYBL_INV_ITM_TXT,
    -    SPEND_STAGING.PO_RCPT_INV_HST_DOC_POST_DT,
    -    SPEND_STAGING.APPRTN_NUM,
    -    SPEND_STAGING.REQTN_TRK_NUM,
    -    SPEND_STAGING.REQTN_LN_NUM,
    -    SPEND_STAGING.REQTN_LN_ITM_NUM,
    -    SPEND_STAGING.REQTN_PERSN_ACCT_ID,
    -    SPEND_STAGING.NTWRK_NUM,
    -    SPEND_STAGING.NTWRK_CTGRY_CD,
    -    SPEND_STAGING.PROJ_NAM,
    -    SPEND_STAGING.WBS_ELMNT_NAM,
    -    SPEND_STAGING.CPTL_PO_IND,
    -    LU_GAC_STAGING.TIER_SUPPLIER,
    -    CASE
    -      WHEN SPEND_STAGING.PRCRMNT_RPTNG_LVL_3_TXT = 'GAC'
    -      AND LU_GAC_STAGING.PO_SHORT_TXT            = SPEND_STAGING.PO_SHORT_TXT
    -      AND SPEND_STAGING.SRC_SPLR_NAM            IS NULL
    -      THEN LU_GAC_STAGING.TIER_SUPPLIER
    -      ELSE SRC_SPLR_NAM
    -    END SRC_SPLR_NAM,
    -    SPEND_STAGING.TAX_CD,
    -    SPEND_STAGING.TAX_CD_DESC,
    -    SPEND_STAGING.TAX_JURISDICTION_TXT,
    -    SPEND_STAGING.MTRL_DOC_PRCS_UOM_QTY,
    -100 SPEND_STAGING.MTRL_DOC_UNIT_OF_ENTRY_QTY,
    -    SPEND_STAGING.PO_LN_ITM_QTY,
    -    SPEND_STAGING.PO_LN_ITM_NET_PRC_UNIT_QTY,
    -    SPEND_STAGING.PO_LN_ITM_NET_PRC_USD_AMT,
    -    SPEND_STAGING.PO_LN_ITM_NET_PRC_DC_AMT,
    -    SPEND_STAGING.PO_LN_ITM_NET_PRC_BDGT_USD_AMT,
    -    SPEND_STAGING.PO_LN_ITM_TOT_USD_AMT,
    -    SPEND_STAGING.SPEND_USD_AMT,
    -    SPEND_STAGING.SPEND_DOC_CURNCY_AMT,
    -    SPEND_STAGING.SPEND_LOCAL_CURNCY_AMT,
    -    SPEND_STAGING.SPEND_BDGT_USD_AMT,
    -    SPEND_STAGING.SPEND_QTY,
    -    SPEND_STAGING.SPEND_QTY_UOM_CD,
    -    SPEND_STAGING.SPEND_UNIT_OF_ENTRY_QTY,
    -    SPEND_STAGING.SPEND_UNIT_OF_ENTRY_UOM_CD,
    -    SPEND_STAGING.SPEND_DC_FX_MTH_CNVRSN_FCT_VAL,
    -    SPEND_STAGING.SPEND_DC_FX_BDG_CNVRSN_FCT_VAL,
    -    SPEND_STAGING.CMPNY_LOCAL_CURNCY_CD,
    -    SPEND_STAGING.DOC_CURNCY_CD,
    -    SPEND_STAGING.TRANSTN_TYPE_CD,
    -    SPEND_STAGING.ACCT_ASGNMT_SEQ_NUM,
    -    SPEND_STAGING.GLPCA_LN_ITM_REC_NUM,
    -    SPEND_STAGING.PCA_REF_DOC_NUM,
    -    SPEND_STAGING.CO_DOC_NUM,
    -    SPEND_STAGING.CO_FSCL_YR_NUM,
    -    SPEND_STAGING.CO_LN_ITM_NUM,
    -    SPEND_STAGING.VNDR_REF_DOC_NUM,
    -    SPEND_STAGING.SAVING_MTHD_TXT,
    -    SPEND_STAGING.SAVING_CMNT_TXT,
    -    SPEND_STAGING.SAVING_COND_NUM,
    -    SPEND_STAGING.SAVING_COND_ITM_NUM,
    -    SPEND_STAGING.SAVING_COND_TYPE_CD,
    -    SPEND_STAGING.SAVING_COND_TYPE_DESC,
    -    SPEND_STAGING.SAVING_COND_CURNCY_CD,
    -    SPEND_STAGING.SAVING_COND_PRC_UNIT_UOM_CD,
    -    SPEND_STAGING.SAVING_COND_PRC_UNIT_QTY,
    -    SPEND_STAGING.SAVING_COND_RTE_USD_AMT,
    -    SPEND_STAGING.SAVING_COND_CURNCY_CNVRSN_VAL,
    -    SPEND_STAGING.SAVING_COND_CURNCY_BDGT_CNVRSN,
    -    SPEND_STAGING.PO_TRANSTN_COND_DC_AMT,
    -    SPEND_STAGING.PO_TRANSTN_COND_USD_AMT,
    -    SPEND_STAGING.SAVING_RTE_PER_USD_AMT,
    -    SPEND_STAGING.SAVING_PER_USD_AMT,
    -    SPEND_STAGING.SAVING_PER_BDGT_USD_AMT,
    -    SPEND_STAGING.AVOIDANCE_USD_AMT,
    -    SPEND_STAGING.AVOIDANCE_BDGT_USD_AMT,
    -    SPEND_STAGING.SAVING_USD_AMT,
    -    SPEND_STAGING.SAVING_BDGT_USD_AMT,
    -    SPEND_STAGING.NO_FX_SAVING_USD_AMT,
    -    SPEND_STAGING.NO_FX_AVOIDANCE_USD_AMT,
    -150 SPEND_STAGING.TOT_REDUCTN_USD_AMT,
    -    SPEND_STAGING.TOT_REDUCTN_BDGT_USD_AMT,
    -    SPEND_STAGING.TOT_NO_FX_REDUCTN_USD_AMT,
    -    SPEND_STAGING.PAYMENTNET_TRANSTN_NUM,
    -    SPEND_STAGING.PAYMENTNET_TRANSTN_LN_ITM_NUM,
    -    SPEND_STAGING.ROW_CRTE_GMT_DTTM,
    -    SPEND_STAGING.ROW_MODIFY_GMT_DTTM,
    -    SPEND_STAGING.ROW_CRTE_MST_DTTM,
    -    SPEND_STAGING.ROW_MODIFY_MST_DTTM,
    -    SPEND_STAGING.PRCRMNT_DIRECTOR_NAM,
    -    SPEND_STAGING.PRCRMNT_PLANT_DSGNTN,
    -    SPEND_STAGING.PRCRMNT_RPTNG_LVL_1_TXT,
    -    SPEND_STAGING.PRCRMNT_RPTNG_LVL_2_TXT,
    -    SPEND_STAGING.PRCRMNT_RPTNG_LVL_3_TXT,
    -    SPEND_STAGING.SPEND_CAT_ID,
    -    SPEND_STAGING.SPEND_RULE_ID,
    -    SPEND_STAGING.TRANSACTION_DATE,
    -    SPEND_STAGING.SPEND_AMOUNT,
    -    SPEND_STAGING.ITEM_DESCRIPTION,
    -    SPEND_STAGING.SUPPLIER_ID,
    -    CASE
    -      WHEN SPEND_STAGING.SOURCE ='SPEND'
    -      THEN 'Spend and Savings'
    -      WHEN SPEND_STAGING.SOURCE ='TRAVEL'
    -      THEN 'Travel'
    -      ELSE NULL
    -    END SOURCE,
    -    SPEND_STAGING.SUPPLIER_NUMBER,
    -    SPEND_STAGING.TRAVEL_PERSNO,
    -    SPEND_STAGING.TRIP,
    -    SPEND_STAGING.TRAVEL_DOC,
    -    SPEND_STAGING.TRAVEL_EXPTY,
    -    SPEND_STAGING.TRAVEL_EXP_TYPE_DESC,
    -    SPEND_STAGING.TRAVLE_CREDIT_CARD_TRAN_DESC TRAVEL_CREDIT_CARD_TRAN_DESC,
    -    SPEND_STAGING.COUNTRY_CODE,
    -    SPEND_STAGING.TRAVEL_INFO,
    -    SPEND_STAGING.TRAVEL_ID,
    -    SPEND_STAGING.TRAVEL_DOCUMENT_NUMBER,
    -    SPEND_STAGING.TRAVEL_LAST_NAME_FIRST_NAME,
    -    SPEND_STAGING.TRAVEL_TRIP_REASON,
    -    SPEND_STAGING.TRAVEL_TRIP_STATUS,
    -    SPEND_STAGING.TRAVEL_RATE,
    -    SPEND_STAGING.FINANCE_ORG,
    -    SPEND_STAGING.ASSOCIATED_MG_CODE,
    -   SPEND_STAGING.COUNTRY_DESC,
    -   SPEND_STAGING.TRAVEL_ID_DESC_BANKCARD,
    -    SPEND_STAGING.COMPANY_CODE_DESC,
    -    SPEND_STAGING.COST_CENTER_DESC,
    -    'Q'||TO_CHAR(SPEND_STAGING.TRANSACTION_DATE,'Q') QUARTERNAME,
    -    TO_CHAR(SPEND_STAGING.TRANSACTION_DATE,'YYYY') YEARNAME,
    -200 CASE
    -      WHEN SPEND_STAGING.SRC_SYS_CD = 'P-CARD'
    -      THEN SS2.CLEANSED_PARENT_NAME
    -      ELSE SS1.CLEANSED_PARENT_NAME
    -    END CLEANSED_PARENT_NAME,
    -    CASE
    -      WHEN SPEND_STAGING.SRC_SYS_CD = 'P-CARD'
    -      THEN SS2.cleansed_name_1
    -      ELSE SS1.cleansed_name_1
    -    END CLEANSED_NAME1,
    -    CASE
    -      WHEN SPEND_STAGING.MTRL_ID_1280 IS NULL
    -       AND SPEND_STAGING.VNDR_MTRL_NUM IS NOT NULL
    -      THEN SPEND_STAGING.VNDR_MTRL_NUM
    -      WHEN SPEND_STAGING.MTRL_ID_1280 IS NULL
    -       AND SPEND_STAGING.VNDR_MTRL_NUM IS NULL
    -       AND SPEND_STAGING.MFG_PART_NUM  IS NOT NULL
    -      THEN SPEND_STAGING.MFG_PART_NUM
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -       AND SPEND_STAGING.PO_TYPE_CD         = 'ZAR'
    -       AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280||'-MIX'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -       AND SPEND_STAGING.PO_TYPE_CD          = 'ZAR'
    -       AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-MIX'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZSA'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ASMBLY'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZSA'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ASMBLY'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZST'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-TEST'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZST'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-TEST'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZBI'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -250   THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-BURN-IN'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZBI'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-BURN-IN'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZRJ'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-REJECT'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZRJ'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-REJECT'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZPR'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-PROBE'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZPR'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-PROBE'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEF'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENG'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEF'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENG'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEM'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENG'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEM'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENG'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEU'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -300   THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENGWFR'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEU'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENGWFR'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZSF'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-WFR'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZSF'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-WFR'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEF'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENG'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.PO_TYPE_CD          = 'ZEF'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-ENG'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EFM'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-POTypeCode'
    -      WHEN SPEND_STAGING.MTRL_GRP_LVL_4_TXT = 'EWM'
    -      AND SPEND_STAGING.MTRL_ID_1280       IS NOT NULL
    -      THEN SPEND_STAGING.MTRL_ID_1280
    -        ||'-POTypeCode'
    -      ELSE SPEND_STAGING.MTRL_ID_1280
    -    END ReportingPartNum,
    -    LU_PCARD_STAGING.COST_CENTR_CD PCARD_COST_CENTR_CD,
    -    LU_PCARD_STAGING.CTY_NAM PCARD_CTY_NAM,
    -    LU_PCARD_STAGING.DISABLE_LINE PCARD_DISABLE_LINE,
    -    LU_PCARD_STAGING.DISABLED_OWNED_BIZ_FLG PCARD_DISABLED_OWNED_BIZ_FLG,
    -    LU_PCARD_STAGING.DIVERSITY_VNDR_FLG PCARD_DIVERSITY_VNDR_FLG,
    -    LU_PCARD_STAGING.FIELD PCARD_FIELD,
    -    LU_PCARD_STAGING.GL_ACCT_NUM PCARD_GL_ACCT_NUM,
    -    LU_PCARD_STAGING.HUB_ZONE_SMALL_BIZ_CONCERN_FLG PCARD_HUB_ZONE,
    -    LU_PCARD_STAGING.MINORITY_OWNED_BIZ_FLG PCARD_MINORITY_OWNED_BIZ_FLG,
    -    NVL(validate_number(Po_Ln_Itm_Net_Prc_Usd_Amt,'')/DECODE(validate_number(Po_Ln_Itm_Net_Prc_Unit_Qty,''),0,1,validate_number(Po_Ln_Itm_Net_Prc_Unit_Qty,'')),0) po_unit_price_per_1_usd,
    -    NVL(validate_number(Po_Ln_Itm_Net_Prc_Dc_Amt,'') /DECODE(validate_number(Po_Ln_Itm_Net_Prc_Unit_Qty,''),0,1,validate_number(Po_Ln_Itm_Net_Prc_Unit_Qty,'')),0) po_unit_price_per_1_doc_cur,
    -    NVL(validate_number(Spend_Bdgt_Usd_Amt,'')       /DECODE(validate_number(Spend_Qty,''),0,1,                 validate_number(Spend_Qty,'')),0)                  spend_up_per_1_usd_budgt_rate,
    -    NVL(validate_number(Spend_Usd_Amt,'')            /DECODE(validate_number(Spend_Qty,''),0,1,                 validate_number(Spend_Qty,'')),0)                  spend_up_per_1_usd_mon_rate,
    -350 NVL(validate_number(Spend_Doc_Curncy_Amt,'')     /DECODE(validate_number(Spend_Qty,''),0,1,                 validate_number(Spend_Qty,'')),0)                  Spend_UP_per_1_Doc_Curr,
    -    TO_CHAR(TRANSACTION_DATE,'MM-YYYY') MONTH_YEAR,
    -    LU_PCARD_STAGING.MTRL_GRP_CD PCARD_MTRL_GRP_CD,
    -    LU_PCARD_STAGING.PAYMENTNET_TRANSTN_LN_ITM_NUM PCARD_PAY_TRANSTN_LN_ITM_NUM,
    -    LU_PCARD_STAGING.PAYMENTNET_TRANSTN_NUM PCARD_PAY_TRANSTN_NUM,
    -    LU_PCARD_STAGING.PAYMENTNET_TRANSTN_POST_DT PCARD_PAY_TRANSTN_POST_DT,
    -    LU_PCARD_STAGING.PCARD_INV_AMT PCARD_INV_AMT,
    -    LU_PCARD_STAGING.PCARD_INV_CURNCY_CD PCARD_INV_CURNCY_CD,
    -    LU_PCARD_STAGING.PCARD_INV_DT PCARD_INV_DT,
    -    LU_PCARD_STAGING.PCARD_INV_LN_ITM_AMT PCARD_INV_LN_ITM_AMT,
    -    LU_PCARD_STAGING.PCARD_INV_LN_ITM_TAX_AMT PCARD_INV_LN_ITM_TAX_AMT,
    -    LU_PCARD_STAGING.PCARD_INV_LN_ITM_TAX_CD PCARD_INV_LN_ITM_TAX_CD,
    -    LU_PCARD_STAGING.PCARD_INV_REF_NUM PCARD_INV_REF_NUM,
    -    LU_PCARD_STAGING.PCARD_INV_TAX_AMT PCARD_INV_TAX_AMT,
    -    LU_PCARD_STAGING.PCARD_MERCHANT_NAM PCARD_MERCHANT_NAM,
    -    LU_PCARD_STAGING.PCARD_OWNR_ID PCARD_OWNR_ID,
    -    LU_PCARD_STAGING.PCARD_SHORT_TXT PCARD_SHORT_TXT,
    -    LU_PCARD_STAGING.PCARD_SRC_FILE_NAM PCARD_SRC_FILE_NAM,
    -    LU_PCARD_STAGING.PLANT_CD PCARD_PLANT_CD,
    -    LU_PCARD_STAGING.PURCH_GRP_CD PCARD_PURCH_GRP_CD,
    -    LU_PCARD_STAGING.RCPNT_ID PCARD_RCPNT_ID,
    -    LU_PCARD_STAGING.REQTN_CRTE_BY_ID PCARD_REQTN_CRTE_BY_ID,
    -    LU_PCARD_STAGING.REQTN_LN_ITM_NUM PCARD_REQTN_LN_ITM_NUM,
    -    LU_PCARD_STAGING.REQTN_NUM PCARD_REQTN_NUM,
    -    LU_PCARD_STAGING.SERV_DISABLE_VETERAN_BIZ_FLG PCARD_SERV_DIS_VET_BIZ_FLG,
    -    LU_PCARD_STAGING.STATE_CD PCARD_STATE_CD,
    -    LU_PCARD_STAGING.STATE_CD,
    -    LU_PCARD_STAGING.VETERAN_OWNED_BIZ_FLG PCARD_VETERAN_OWNED_BIZ_FLG,
    -    LU_PCARD_STAGING.VNDR_ACCT_NUM PCARD_VNDR_ACCT_NUM,
    -    LU_PCARD_STAGING.WOMAN_OWNED_BIZ_FLG PCARD_WOMAN_OWNED_BIZ_FLG2,
    -    DENSE_RANK() OVER (ORDER BY NVL(TO_CHAR(TRANSACTION_DATE, 'YYYYMM'),'190010') DESC) AS DATE_RANK,
    -    LU_PRICE_BY_UNIT_STAGING.MTRL_GRP PBU_MTRL_GRP,
    -    LU_PRICE_BY_UNIT_STAGING.MTRL_GRP_DES PBU_MTRL_GRP_DES,
    -    LU_PRICE_BY_UNIT_STAGING.MTRL_ID PBU_MTRL_ID,
    -    LU_PRICE_BY_UNIT_STAGING.PLANT PBU_PLANT,
    -    LU_PRICE_BY_UNIT_STAGING.PLANT_DESC PBU_PLANT_DESC,
    -    LU_PRICE_BY_UNIT_STAGING.SUPPLIER PBU_SUPPLIER,
    -    LU_PRICE_BY_UNIT_STAGING.DESCRIPTION PBU_DESCRIPTION,
    -    LU_PRICE_BY_UNIT_STAGING.UOM PBU_UOM,
    -    LU_PRICE_BY_UNIT_STAGING.CONTENT_VOLUME PBU_CONTENT_VOLUME,
    -    LU_PRICE_BY_UNIT_STAGING.UOM_CONTENT_VOLUME PBU_UOM_CONTENT_VOLUME,
    -    LU_PRICE_BY_UNIT_STAGING.CONTENT_WEIGHT PBU_CONTENT_WEIGHT,
    -    LU_PRICE_BY_UNIT_STAGING.UOM_CONTENT_WT PBU_UOM_CONTENT_WT,
    -    LU_PRICE_BY_UNIT_STAGING.PRICE__PACKAGE PBU_PRICE__PACKAGE,
    -    LU_PRICE_BY_UNIT_STAGING.PRICE_PER_UOM_WT PBU_PRICE_PER_UOM_WT,
    -    LU_PRICE_BY_UNIT_STAGING.PRICE_PER_UOM_VOL PBU_PRICE_PER_UOM_VOL,
    -    LU_PRICE_BY_UNIT_STAGING.COMMON_NAME PBU_COMMON_NAME,
    -    LU_GAC_UOM_REFERENCE_STAGING.LU_GAC_UOM_REFERENCE_ID,
    -    LU_GAC_UOM_REFERENCE_STAGING.FSL_PART_NUMBER,
    -    LU_GAC_UOM_REFERENCE_STAGING.SUPPLIER LU_GAC_SUPPLIER,
    -400 LU_GAC_UOM_REFERENCE_STAGING.DESCRIPTION LU_GAC_DESCRIPTION,
    -    LU_GAC_UOM_REFERENCE_STAGING.GAC_MAT_SUBGROUP LU_GAC_MAT_SUBGROUP ,
    -    LU_GAC_UOM_REFERENCE_STAGING.ACTUAL_FILL LU_GAC_ACTUAL_FILL,
    -    LU_GAC_UOM_REFERENCE_STAGING.COMMON__UOM LU_GAC_COMMON_UOM,
    -    LU_GAC_UOM_REFERENCE_STAGING.PACKAGE LU_GAC_PACKAGE
    -  FROM
    -    SPEND_STAGING,
    -    SUPPLIER_STAGING SS1,
    -    SUPPLIER_STAGING SS2,
    -    LU_GAC_STAGING,
    -    lu_card_code_staging,
    -    LU_PCARD_STAGING,
    -    LU_PRICE_BY_UNIT_STAGING,
    -    LU_GAC_UOM_REFERENCE_STAGING
    -  WHERE SS1.SUPPLIER_ID(+)                     = SPEND_STAGING.SUPPLIER_ID
    -  AND SS2.PCARD_INV_REF_NUM(+)             = SPEND_STAGING.PCARD_INV_REF_NUM
    -  AND SS2.PAYMENTNET_TRANSTN_NUM(+)        = SPEND_STAGING.PAYMENTNET_TRANSTN_NUM
    -  AND SS2.PAYMENTNET_TRANSTN_LN_ITM_NUM(+) =
    -    SPEND_STAGING.PAYMENTNET_TRANSTN_LN_ITM_NUM
    -  AND lu_card_code_staging.card_code(+)          = spend_staging.travel_id
    -  AND lu_gac_staging.po_short_txt(+)             = spend_staging.po_short_txt
    -  AND LU_PCARD_STAGING.PCARD_INV_REF_NUM(+)      = SPEND_STAGING.PCARD_INV_REF_NUM
    -  AND LU_PCARD_STAGING.PAYMENTNET_TRANSTN_NUM(+) =
    -    SPEND_STAGING.PAYMENTNET_TRANSTN_NUM
    -  AND LU_PCARD_STAGING.PAYMENTNET_TRANSTN_LN_ITM_NUM(+) =
    -    SPEND_STAGING.PAYMENTNET_TRANSTN_LN_ITM_NUM
    -  AND LU_PRICE_BY_UNIT_STAGING.MTRL_ID(+)             = SPEND_STAGING.MTRL_ID_1280
    -  AND LU_PRICE_BY_UNIT_STAGING.PLANT(+)               = SPEND_STAGING.PLANT_CD
    -  AND lu_gac_uom_REFERENCE_STAGING.fsl_part_number(+) =
    -431 SPEND_STAGING.MTRL_ID_1280;Error at Command Line:350 Column:112
    Error report:
    SQL Error: ORA-01031: insufficient privileges
    01031. 00000 - "insufficient privileges"
    *Cause:    An attempt was made to change the current username or password
    without the appropriate privilege. This error also occurs if
    attempting to install a database without the necessary operating
    system privileges.
    When Trusted Oracle is configure in DBMS MAC, this error may occur
    if the user was granted the necessary privilege at a higher label
    than the current login.
    *Action:   Ask the database administrator to perform the operation or grant
    the required privileges.
    For Trusted Oracle users getting this error although granted the
    the appropriate privilege at a higher label, ask the database
    administrator to regrant the privilege at the appropriate label.
    Edited by: Snyds on May 24, 2012 7:46 AM

    Checking for privileges was the first thing I did.
    User has create view and create any view.
    Also has alter session privilege which is needed within the validate_number function (see below).
    I was able to create the view you suggested.
    I believe there is a privilege problem, just cant figure which.
    create or replace function validate_number(p_number      in varchar2,
                                               p_format_mask in varchar2)
    return number
    AUTHID CURRENT_USER is
      v_number number;
      v_mask   varchar2(100) := '999999999999999999999.00000000000000000000';
      cursor get_number_masks is
      select mask,upper(is_i18n) is_i18n from cm_master.format_mask
      where type = 'NUMBER' order by sequence, is_i18n; 
    begin
      if p_format_mask is not null then
        begin
          return to_number(p_number, p_format_mask);   
        exception
          when others then null;
        end;
      end if;
      for a in get_number_masks
      loop
        if a.is_i18n = 'Y' then
          -- We are applying an international number format mask
          begin
            -- Attempt #1
            -- Set the decimal to a ',' and the group separator to a '.'
            execute immediate 'alter session set nls_numeric_characters = '',.''';
            v_number := to_number(ltrim(rtrim(to_char(to_number(p_number, a.mask),v_mask))),v_mask);
            execute immediate 'alter session set nls_numeric_characters = ''.,''';
            return v_number;
          exception
            when others then
              -- First Attempt Failed - Attempt #2
              -- Set the decimal to a ',' and the group separator to a ' '
              begin
                execute immediate 'alter session set nls_numeric_characters = '', ''';
                v_number := to_number(ltrim(rtrim(to_char(to_number(p_number, a.mask),v_mask))),v_mask);
                execute immediate 'alter session set nls_numeric_characters = ''.,''';
                return v_number;
              exception
                when others then
                  -- Second Attempt Failed - Attempt #3
                  -- Set the decimal to a '.' and the group separator to a ' '
                  begin
                    execute immediate 'alter session set nls_numeric_characters = ''. ''';
                    v_number := to_number(ltrim(rtrim(to_char(to_number(p_number, a.mask),v_mask))),v_mask);
                    execute immediate 'alter session set nls_numeric_characters = ''.,''';
                    return v_number;
                  exception
                    when others then null;
                  end;
              end;
          end;
        else
          begin
            return to_number(p_number, a.mask);
          exception
            when others then null;
          end;
        end if;
      end loop;
      return null;
    exception
      when others then return null;
    end validate_number;Edited by: Snyds on May 24, 2012 7:48 AM

  • Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created". What's the problem?

    Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created".
    What's the problem?
    Any help in finding a solution is greatly appreciated.
    Thank you,

    Installed AcrobatXI PRO 11.0.09  on seven computers and laptops. Two of them gives an error when you try to save a document in WORD, EXCEL, Power Point, or when exporting to... error: Save failed to process this document. No File was created.
    But all good saves in the format of TXT and jpg.
    I have uninstalled and restored and re-installed and updated and registry cleaned and removed using the special utility Cleaner Tool for Acrobat, but nothing helps.
    On one notebook with Windows 8.1 and Microsoft office 2013, on another laptop with Windows 7 and Microsoft office 2010, the same problem, although there are computers with Windows 7 and Microsoft office 2010 and everything works.
    Tell me where to find the problem and how to solve it.
    Thank you.

  • DB6 Installation - error on phase VIEW (CREATE VIEW "/BEV1/LAVMVA1_V)

    Dear all,
    I install LNX X86_64, DB6 - ERP 6.0 EHP4, during phase IMPORT ABAP I've got error in SAPVIEW.log:
    usr/sap/SID/SYS/exe/run/R3load: sccsid @(#) $Id: //bas/701_REL/src/R3ld/R3load/R3ldmain.c#8 $ SAP
    /usr/sap/SID/SYS/exe/run/R3load: version R7.01/V1.4 [UNICODE]
    Compiled Dec 25 2009 23:46:01
    /usr/sap/SID/SYS/exe/run/R3load -i SAPVIEW.cmd -dbcodepage 4103 -l SAPVIEW.log -stop_on_error -loadprocedure fast LOAD
    (DB) INFO: connected to DB
    (DB) ERROR: DDL statement failed
    ( DROP VIEW "/BEV1/LAVMVA1_V" )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (IMP) INFO: a failed DROP attempt is not necessarily a problem
    (DB) ERROR: DDL statement failed
    ( CREATE VIEW "/BEV1/LAVMVA1_V" ( "MANDT", "BSTNK", "VKORG", "VTWEG", "SPART", "VKBUR", "VKGRP", "KUNNR", "ERNAM", "BSTDK", "AUART", "VBELN" ) AS SELECT T0001."MANDT", T0001."BSTNK", T0001."VKORG", T0001."VTWEG", T0001."SPART",  T0001."VKBUR", T0001."VKGRP", T0001."KUNNR", T0001."ERNAM", T0001."BSTDK", T0001."AUART", T0002."VBELN" FROM "VBAK" T0001, "VBUK" T0002 WHERE T0002."MANDT" = T0001."MANDT" AND T0002."VBELN" = T0001."VBELN" AND ( T0002."VBOBJ" = 'A' OR T0002."VBOBJ" = 'L' ) )
    dsql_exec_immediate returned DS_DBOBJECTUNKNOWN
    (DB) INFO: disconnected from DB
    /usr/sap/SID/SYS/exe/run/R3load: job finished with 1 error(s)
    /usr/sap/SID/SYS/exe/run/R3load: END OF LOG: 20100119153412
    I have changed R3load, sapinst to newest version, space is enough, tablespaces are not full.
    Do you have any idea what is cause of error and how to solve it?
    Any help is appreciated.
    Regards,
    Roman

    Hi Frank,
    thanks for your very fast hints.
    I have checked .log files SAPxxxx.log (SAP0000, SAPAPPL0, SAPAPPL1, ...) but there isnt any entry with VBAK.
    When I entered under <sid>adm command: db2 describe table sap<sid>.VBAK it takes a long time wihtout any result.
    Thanks a lot for your help.
    Roman
    Edited by: Roman Mikolas on Jan 19, 2010 4:27 PM
    Edited by: Roman Mikolas on Jan 19, 2010 4:27 PM

  • Error in Create Views

    Hi All,
    Create view is giving the following error : com.waveset.exception.ItemNotFound.
    Below is the code as well the error in the trace....please suggest how to find the exact error and the error in the code:
    <Action id='1' name='Create Views' application='com.waveset.session.WorkflowServices'>
    <Argument name='op' value='createView'/>
    <Argument name='type' value='Process'/>
    <Argument name='task.owner' value='Configurator'/>
    <Argument name='endUser' value='true'/>
    <Argument name='result'>
    <ref>variableMapping</ref>
    </Argument>
    <Argument name='process'>
    <ref>currentWorkflow</ref>
    </Argument>
    <Argument name='viewId' value='Process'/>
    <Return from='view' to='newViews' append='true'/>
    </Action>
    <Action id='2' name='Check in Views' application='com.waveset.session.WorkflowServices'>
    <Iterate for='newView' in='newViews'/>
    <Argument name='op' value='checkinView'/>
    <Argument name='view' value='$(newView)'/>
    <Argument name='endUser' value='true'/>
    Trace error:
    Action Create Views
    Result title set to 'Create Views'
    Argument op = createView
    Argument type = Process
    Argument task.owner = Configurator
    Argument endUser = true
    Resolved reference variableMapping = {UserName-1=User1, TestADT, RequestType=EntireSystem, AutoImplementationReqd=No, SA Note=null, Position=null, stewardId=[[email protected]], formButton=Submit, [email protected], StewardImplementationReqd=Yes, Name=TestADT User1, SecurityImplementationReqd=Yes, ResGroupMap=null, [email protected], Country=null, [email protected], SubArea=null, selectedForm=SRF RemoveUser, SystemName=AppTalk (H02), isAutomation=false, StewardApprovalReqd=No, Explanation-1=User Left Best Buy, TaskRoles=null, Permissions01=aAS, resourceAction=null, BusinessArea=null, Manager=Manager, TestADT, GRCRequestReqd=No, SecurityAdminApprovalReqd=No, frm_ApprovalsList=[[email protected], approver2:SRS], currentWorkflow=Old Framework_SRW Type 1 Approval Workflow, Optional Comments=ASASA, requestorUserId=a9200701, siteID=null, selectedEnablers=null, endDate=null, Request=Me, UID-1=A9200701, StewardApprovalReqd2=No, selectedEnablersLabels=null, selectedTaskRolesLabels=null, ManagerApprovalReqd=No, Rows=1, startDate=null}
    Argument result = {UserName-1=User1, TestADT, RequestType=EntireSystem, AutoImplementationReqd=No, SA Note=null, Position=null, stewardId=[[email protected]], formButton=Submit, [email protected], StewardImplementationReqd=Yes, Name=TestADT User1, SecurityImplementationReqd=Yes, ResGroupMap=null, [email protected], Country=null, [email protected], SubArea=null, selectedForm=SRF RemoveUser, SystemName=AppTalk (H02), isAutomation=false, StewardApprovalReqd=No, Explanation-1=User Left Best Buy, TaskRoles=null, Permissions01=aAS, resourceAction=null, BusinessArea=null, Manager=Manager, TestADT, GRCRequestReqd=No, SecurityAdminApprovalReqd=No, frm_ApprovalsList=[[email protected], approver2:SRS], currentWorkflow=Old Framework_SRW Type 1 Approval Workflow, Optional Comments=ASASA, requestorUserId=a9200701, siteID=null, selectedEnablers=null, endDate=null, Request=Me, UID-1=A9200701, StewardApprovalReqd2=No, selectedEnablersLabels=null, selectedTaskRolesLabels=null, ManagerApprovalReqd=No, Rows=1, startDate=null}
    Resolved reference selectedForm = SRF RemoveUser
    Resolved reference currentWorkflow = Old Framework_SRW Type 1 Approval Workflow
    Argument process = Old Framework_SRW Type 1 Approval Workflow
    Argument viewId = Process
    Argument variableMapping = {UserName-1=User1, TestADT, RequestType=EntireSystem, AutoImplementationReqd=No, SA Note=null, Position=null, stewardId=[[email protected]], formButton=Submit, [email protected], StewardImplementationReqd=Yes, Name=TestADT User1, SecurityImplementationReqd=Yes, ResGroupMap=null, [email protected], Country=null, [email protected], SubArea=null, selectedForm=SRF RemoveUser, SystemName=AppTalk (H02), isAutomation=false, StewardApprovalReqd=No, Explanation-1=User Left Best Buy, TaskRoles=null, Permissions01=aAS, resourceAction=null, BusinessArea=null, Manager=Manager, TestADT, GRCRequestReqd=No, SecurityAdminApprovalReqd=No, frm_ApprovalsList=[[email protected], approver2:SRS], currentWorkflow=Old Framework_SRW Type 1 Approval Workflow, Optional Comments=ASASA, requestorUserId=a9200701, siteID=null, selectedEnablers=null, endDate=null, Request=Me, UID-1=A9200701, StewardApprovalReqd2=No, selectedEnablersLabels=null, selectedTaskRolesLabels=null, ManagerApprovalReqd=No, Rows=1, startDate=null}
    Argument initialApprovals = [[email protected], approver2:SRS]
    Calling application 'com.waveset.session.WorkflowServices'
    Application requested argument op
    Application requested argument viewId
    Application requested all arguments
    Application requested argument subject
    Application requested argument loginApplication
    Application requested argument authorized
    Application returned =
    <WavesetResult>
    <ResultItem type='error' status='error'>
    <ResultError throwable='com.waveset.exception.ItemNotFound'>
    <Message id='TaskDefinition:Old Framework_SRW Type 1 Approval Workflow'>
    </Message>
    <StackTrace>com.waveset.exception.ItemNotFound: TaskDefinition:Old Framework_SRW Type 1 Approval Workflow&#xA;&#x9;at com.waveset.object.ObjectCache.getHandle(ObjectCache.java:851)&#xA;&#x9;at com.waveset.object.ObjectCache.getObject(ObjectCache.java:578)&#xA;&#x9;at com.waveset.object.ObjectCache.getObject(ObjectCache.java:546)&#xA;&#x9;at com.waveset.server.InternalSession.getObject(InternalSession.java:526)&#xA;&#x9;at com.waveset.server.ViewMaster.getTaskDefinition(ViewMaster.java:719)&#xA;&#x9;at com.waveset.view.ProcessViewer.findProcess(ProcessViewer.java:847)&#xA;&#x9;at com.waveset.view.ProcessViewer.createView(ProcessViewer.java:386)&#xA;&#x9;at com.waveset.object.ViewMaster.createView(ViewMaster.java:499)&#xA;&#x9;at com.waveset.session.WorkflowServices.createView(WorkflowServices.java:1369)&#xA;&#x9;at com.waveset.session.WorkflowServices.call(WorkflowServices.java:478)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.callApplication(WorkflowEngine.java:4381)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:4208)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:3521)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:3361)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.makeTransition(WorkflowEngine.java:2901)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.checkExplicitTransitions(WorkflowEngine.java:2792)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.checkTransitions(WorkflowEngine.java:2578)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.processSteps(WorkflowEngine.java:1983)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1835)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1818)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1743)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:861)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:505)&#xA;&#x9;at com.waveset.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:256)&#xA;&#x9;at com.waveset.task.TaskThread.run(TaskThread.java:132)&#xA;</StackTrace>
    </ResultError>
    </ResultItem>
    </WavesetResult>

    where is your 'TaskDefinition:Old Framework_SRW Type 1 Approval Workflow' objcet, have you imported that workflow into Idm or check the name.
    error:
    com.waveset.exception.ItemNotFound: TaskDefinition:Old Framework_SRW Type 1 Approval Workflow

  • Error Creating View on External Table

    I create my oracle directory connected as SYS as SYSDBA and grant read,write to public:
    CREATE OR REPLACE DIRECTORY ER_ADMIN_DIR AS 'C:\win32app\ingr\ER\ER_Init\scripts';
    grant read,write on directory ER_ADMIN_DIR to public;
    I creat my external table from SYS to reside in another schema called DRTEST:
    CREATE TABLE DRTEST.SPEC_REQUIRED (TABLE_NAME VARCHAR2(100), COLUMN_NAME VARCHAR2(100))
    ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY ER_ADMIN_DIR
    ACCESS PARAMETERS
    (RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL
    LOCATION ('atts_in_red.tx')
    REJECT LIMIT UNLIMITED ;
    I can select from the table and all is good at this point.
    However, I get an error when I try to create a view (in DRTEST from SYS) based on the external table.
    CREATE VIEW DRTEST.MYVIEW1 AS SELECT * FROM DRTEST.SPEC_REQUIRED;
    CREATE VIEW DRTEST.MYVIEW1 AS SELECT * FROM DRTEST.SPEC_REQUIRED
    ERROR at line 1:
    ORA-06564: object ER_ADMIN_DIR does not exist
    (note I'm still connected as SYS as SYSDBA here)
    I can create the view if I connect to DRTEST and run the exact same create view statement there. Is there something in Oracle that prevents me from doing this from the SYS account? I usually think of SYS as having the "Power of God to do all things".
    I have to create the external table and view on several schema's and I don't want the user to have to connect to each schema separately.
    Tina

    Tina,
    I think you are facing bug 2948123 (CREATE VIEW ON EXTERNAL TABLE ORA-6564). The workaround is to connect (in your case) as user DRTEST and then perform the CREATE VIEW statement (you tested this already). Or (according to the bug description) create the view under the SYS schema itself.

  • Creating view containing case statements received error ORA-22992

    We have a create view referencing table through dblink. The select statement in the create view has case statements, when running the Select statement alone, results are return. However, when executing the create view, it returns:
    SQL Error: ORA-22992: cannot use LOB locators selected from remote tables
    22992. 00000 - "cannot use LOB locators selected from remote tables"
    *Cause:    A remote LOB column cannot be referenced.
    *Action:   Remove references to LOBs in remote tables.
    One of the source table has LOB column but not in the select statement. The strange thing is when removing the case statement from the select, create view works fine. Can anybody tell me what caused the error and how to fix it?
    Create View Snippet:
    CREATE OR REPLACE VIEW "ABC"."XYZ" (....
    AS SELECT
    CASE
    WHEN A.OUTAGE =1
    THEN 'Y'
    ELSE 'N'
    END AS OUTAGE,
    FROM
    TABLEA@XXXX A
    LEFT JOIN TABLEB@XXXX B
    ON
    A.LOC =B.LO
    AND A.SITE =B.SITE
    WHERE
    A.CLASS ='CUSTOMER'
    AND A.PLUSSISGIS =1;

    What is your 4 digit Oracle version?
    Try rewriting the query to not use ANSI SQL92 joins. I found a link where this solved a problem similar to yours.
    DBLink problem ORA-22992
    >
    But, look at this curious thing: I re-write the query as follows:
    SELECT A.ID, A.ID_REF, A.EVENDATE, B.DESCRIPTION
    FROM A@ORCL A, B@ORCL B
    WHERE A.ID_REF = B.ID_REF;
    and it works fine... It seems like Oracle don't like the ANSI SQL92...
    >
    Several similar links by googling: 'SQL Error: ORA-22992'
    http://www.dbuggr.com/smallwei/solution-error-ora-22992-lob-locators-selected-remote-tabl/
    >
    Fixing ORA-22992 “cannot use LOB locators selected from remote tables” error
    You have migrated your Oracle 9i database to 10g and a distributed statement which worked fine in 9i now is getting error ORA-22992 “cannot use LOB locators selected from remote tables”. Even though the related remote table(s) does not contain any LOB column datatype.
    FIX:
    There is a bug on 9i,10g, and 11g that is related to this error. It is being fixed in 11.2. It can also be backported for previous 9i, 10g and 11g releases under the latest patchsets.
    You may also do a workaround as follow:
    Modify the affected SQL by adding the TO_CHAR function. For example:
    -- Original SQL:
    SELECT NVL2('a', 'b','c' ) FROM dual@remote_db;
    -- Modified SQL:
    SELECT TO_CHAR(NVL2('a','b','c')) FROM dual@remote_db;
    >
    See if that helps.

  • Error creating view with tables of other user

    I am creating of view containing two tables of another user. I
    am a dba-user.
    The statement looks like this:
    CREATE VIEW TEST
    (SELECT ...
    FROM DWH.TABLE_A A, DWH.TABLE_B B
    WHERE A.ID = B.ID)
    I get an error-message (ORA-00942: Table or view not found).
    When I create the view as user DWH, everything went OK. I don't
    think it has something to do with privileges since I am the dba-
    user.
    How can I create a view using other users tables?

    Hi
    To create view on table of another user you need to have select
    privilege grant directly to you - not to role granted to you. In
    your case you can select tables because you have granted dba
    role and it has select any table prvivilege, but you havent
    directly granted this rights without role.
    Regards

  • After throwing an error suppler is created

    Hi all,
    In '/oracle/apps/pos/supplier/webui/SuppCrtPG' I have extended a controller "oracle.apps.ar.hz.components.party.organization.webui.HzPuiOrgProfileQuickCO"
    after checking some validations I am throwing an error
    by - throw new OAException("Plese enter 10 Alpha Numeric characters in PAN number field." ,OAException.ERROR);
    My issue is that after throwing an error when clik on "Apply" button again with no changes made system should not create supplier but it creates. I checked from ap_suppliers table.
    Why after throwing an error system creates a supplier??
    Please help?
    thanks
    Amit

    So, you are pressing apply button then error messge is apearing but no supplier created. but when you again pressed it, it will create supplier. Am I correct?
    if not tell me again what is the flow?
    --Parag                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Error in creating view

    ASIF_SELECT is a database use with select privilege on some table and have roles CONNECT & RESOURCE, after log on if he execute following statement, there is no problem, but when he try to create view of that it give ORA-01031 insufficient privilege error, and show * on general_information.cb_region_fo d .
    If i give him SELECT ANY TABLE privilege error remove, we can not give him this privilege. how to resolve this error
    SELECT DISTINCT c.br_region_fo_code AS region_code,
    d.NAME,
    SUM (c.employer_contribution) OVER (PARTITION BY c.br_region_fo_code) AS emp_contr,
    SUM (c.emp_arrear_amount) OVER (PARTITION BY c.br_region_fo_code) AS emp_arrear
    FROM core_business.cb_contr_emp_pmt_slip c,
    general_information.cb_region_fo d
    WHERE c.br_region_fo_code = d.region_fo_code
    ORDER BY c.br_region_fo_code;
    CREATE OR REPLACE FORCE VIEW ASIF_SELECT.A1A2 AS
    SELECT DISTINCT c.br_region_fo_code AS region_code,
    d.NAME,
    SUM (c.employer_contribution) OVER (PARTITION BY c.br_region_fo_code) AS emp_contr,
    SUM (c.emp_arrear_amount) OVER (PARTITION BY c.br_region_fo_code) AS emp_arrear
    FROM core_business.cb_contr_emp_pmt_slip c,
    general_information.cb_region_fo d
    WHERE c.br_region_fo_code = d.region_fo_code
    ORDER BY c.br_region_fo_code;

    Hi,
    As you said SELECT ANY TABLE privilege works fine and, so i suppose you have create view privilege and you can create view.
    If you have create view privilege and still you can't create then read bellow.
    FROM core_business.cb_contr_emp_pmt_slip c,
    general_information.cb_region_fo dYou are referencing two tables/view in this statement. I suspect one of them is a view, please let us know which one is view(or both are views). This view references another table and on which ASIF_SELECT should have select privilege, right?
    In this case, find out the tables involved in above view(s) and grant owner of this view the "select privilege with grant option"
    suppose core_business.cb_contr_emp_pmt_slip is a view involving a table "user1.table1"
    You should grant rights on user1.table1 to core_business as follows
    grant select on user1.table1 to core_business
    grant select on core_business.cb_contr_emp_pmt_slip to ASIF_SELECT;Now user ASIF_SELECT will be able to create a view while querying core_business.cb_contr_emp_pmt_slip.
    Salman

Maybe you are looking for

  • Image Attachments Won't Open in Windows

    Hello, I'm having some frequently recurring problems sending images (usually JPEG) to Windows users. For instance, I'll create in Mail an email with two image attachements and send them to a group that includes some Mac folks and some Windows users.

  • Drag n drop not working in iTunes

    Hello all, it seems randomly that drag n drop stops working in iTunes for me. The only way to fix it is to quit iTunes and restart it again. Does any one have a suggestion that could help me fix it? Thanks!

  • Problem with SAP Management console 'yellow is not changing to green'

    Hi I am starting my SAP Server from SAP Management console( ECC6.0 IDES Version). I am able to login into my system but after few minutes the server color is changing from Green to Yellow and I am not able to continue using my system. What could be t

  • How to make WF notification auto approved

    Hi, We have implemented Absence Management and using generic approval process. we have 2 levels of approvals first level Supervisor and second level approver is HR Manager. IF Supervisor doen't approve the nitification in a week then it should get ap

  • RP_EVALUATE_INDIRECTLY_P0008 --- LOW PERFORMANCE

    Hi Experts..          I was trying yesterday to solve a performance problem after an upgrade from 4.6 to 6.0 and I found that the main cause was the running of the routine above... I searched for notes finding nothing........ and I figured out that t