encoding for spaces in the url in an in the report sql statement

1. what function or process use to code for empty spaces in a url link in a report?

I need to link a report to a 2nd report and pass 5 variables. I think I need to do by integrating my own url in the sql code for the report, given that the standard State is defined for only 3 variables to pass.

One of my variables as partner_firm has spaces, so how do I encode this in the query. Currently I have the following (simplified...).

Select partner_firm,
distinct_events County (separate event),
"< a href =" f? p = 18509:4: & SESSION. : NO:4:P4_PARTNER_FIRM, P4_QUARTER, P4_CATEGORY, P4_PRODUCT_CATEGORY, P4_EVENT:' |
partner_firm |
2 c & P3_QUARTER.%2C & P3_CATEGORY.%2C & P3_PRODUCT_CATEGORY.%2C & P3_EVENT. » >' ||
Count (distinct Lower (attendee_email)). '< /a >' distinct_attendees
of all_events...

but partner_firm spaces that are returned. I think there's the way that I can code for this?

Thank you
Stephen

Of course there are:
Select apex_util.url_encode ('http://ww.oracle.com/') of double

Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this response in marking it as useful or Correct ;-)

Tags: Database

Similar Questions

  • Run the second sql statement only if the first sql statement is set to zero.

    Hey guys I seem to have a mental block here. I have two sql statements. I would like to than the second to run only if the first sql statement is set to zero. I know that I can use PLsql but I would really like to see if I can do this with sql upward. Your answers are very much appreciated.
    This is the first sql
      Select     ft.fund_code, 
                 ft.orgn_code, 
                 ft.acct_code, 
                 ft.amount, 
                 fb.owner_pidm, 
                 ft.prog_code      
          from ftrbremb fb , ftcractg ft
          where fb.doc_code = 'TR000038'
          and fb.ftpbport_id = ft.ftpbport_id
    second sql statement
         Select ft.fund_code, 
                 ft.orgn_code, 
                 ft.acct_code, 
                 ft.amount, 
                 fb.owner_pidm, 
                 ft.prog_code      
          from ftrbremb fb , ftcractg ft, ftprexps fx
          where fb.doc_code = 'TR000038'
          --and fb.ftpbport_id = ft.ftpbport_id
          and fx.ftrbremb_id = fb.id
          and ft.ftprexps_id = fx.id;
    How can I combine these two statements together so that when the first is null the second run. As a bonus, I want to get just the first line as well.
    Any help would be greatly appreciated. I tried to accomplish with the case statement but it dosent everything seems to work for me.
    Thank you

    Miguel,

    the idea is simple: join the two queries (via the union of all) and to change the second part as to return only the rows if the first query returns no rows by changing the NOT EXISTS (first request). Hope I made it clear... ;)

  • Custom on-the-fly SQL statement

    Is it possible to build the dynamic SQL statement in the DB adapter on the fly?

    You can do bulk collect and return the collection of pl/sql procedure.

    Prasanna-

  • Space in the reports management

    I have a requirement where a report must be generated if a particular field is empty IE spaces. NULL values are not stored instead of the spaces are stored in the fields. When I am trying to filter the field for spaces is not to recognize the space provided in the filter.
    Please give the solution for this.

    TIA

    Hi user,
    If display NULL values in the vacuum of space, try this one
    1 conditional formatting this column-> give filter null--> in CSS give display: none
    Then you can see the void cellls
    2. give the filter as not null for this column.

  • How to display the text in the cell for CDA on the report

    Hi all

    I use en-Studio of reporting. Now my requirement is I want to show the text in the cell that I added under CDA - column Variance in the report. So for this I used the text of the cells and within this function function, I gave the line, column and page number. But it does not show the text in the cell that I added for hyperion planning on the report. But if I am referring to another cell text that I added to the variance of Yeartotal I'm able to see on the report.
    Can someone tell me why I'm not able to see the text from the cell that I added to the variance of the CDA?
    Pls tell the way by which I can return.

    My formula looks like this-

    < < TxtCase ("Grid1", 78 H, 1, $CurrentMonth = "October") > > I am very confused about the last parameter. No error or the kind of argument not valid message, but it still all just empty.



    Thank you

    I think you're out of luck on this one.

    Cell notes are stored in the planning of the HSP_CELL_NOTE and HSP_CELL_NOTE_ITEM tables. Done HSP_CELL_NOTE refers to a member for each dimension that is pointing to the intersection where the note should be linked. YearTotal is an intersection, even though it is dynamically calc would be in essbase. Each HSP_CELL_NOTE NOTE_ID points to one or more notes that are stored in HSP_CELL_NOTE_ITEM. This means that although you can save a note in YearTotal, it does not display when you report on the Y-T-D (Oct) which is purely dynamic. It does state that when you reference specifically an intersection that is stored in HSP_CELL_NOTE.

    It would be nice if you could see all the notes stored in Jan: Oct when your report contains a Y-T-D (Oct), but it doesn't.

    You can always write a stored procedure to go against the tables and the report in excel.

    Dave

  • Plans of multiple executions for the same SQL statement

    Dear experts,

    awrsqrpt. SQL shows several plans for a single SQL statement executions. How is it possible that a single SQL statement will be several Plans of executions within the AWR report.

    Here is the output of the awrsqrpt for your reference.

    WORKLOAD REPOSITORY SQL Report
    
    Snapshot Period Summary
    
    DB Name         DB Id    Instance     Inst Num Release     RAC Host
    ------------ ----------- ------------ -------- ----------- --- ------------
    TESTDB          2157605839 TESTDB1               1 10.2.0.3.0  YES testhost1
    
                  Snap Id      Snap Time      Sessions Curs/Sess
                --------- ------------------- -------- ---------
    Begin Snap:     32541 11-Oct-08 21:00:13       248     141.1
      End Snap:     32542 11-Oct-08 21:15:06       245     143.4
       Elapsed:               14.88 (mins)
       DB Time:               12.18 (mins)
    
    SQL Summary                            DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    
                    Elapsed
       SQL Id      Time (ms)
    ------------- ----------
    51szt7b736bmg     25,131
    Module: SQL*Plus
    UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL,
    0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE
     TEST_BATCH_DT = (:B1 )
    
              -------------------------------------------------------------
    
    SQL ID: 51szt7b736bmg                  DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> 1st Capture and Last Capture Snap IDs
       refer to Snapshot IDs witin the snapshot range
    -> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC...
    
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    --- ---------------- ---------------- ------------- ------------- --------------
    1   2960830398                 25,131             1         32542          32542
    2   3834848140                      0             0         32542          32542
              -------------------------------------------------------------
    
    
    Plan 1(PHV: 2960830398)
    -----------------------
    
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    
    Stat Name                                Statement   Per Execution % Snap
    ---------------------------------------- ---------- -------------- -------
    Elapsed Time (ms)                            25,131       25,130.7     3.4
    CPU Time (ms)                                23,270       23,270.2     3.9
    Executions                                        1            N/A     N/A
    Buffer Gets                               2,626,166    2,626,166.0    14.6
    Disk Reads                                      305          305.0     0.3
    Parse Calls                                       1            1.0     0.0
    Rows                                        371,735      371,735.0     N/A
    User I/O Wait Time (ms)                         564            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                 26            N/A     N/A
              -------------------------------------------------------------
    
    Execution Plan
    ------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------
    |   0 | UPDATE STATEMENT             |                 |       |       |  1110 (100)|          |
    |   1 |  UPDATE                      | TEST            |       |       |            |          |
    |   2 |   TABLE ACCESS FULL          | TEST            |   116K|  2740K|  1110   (2)| 00:00:14 |
    |   3 |   TABLE ACCESS BY INDEX ROWID| ACCT            |     1 |    26 |     5   (0)| 00:00:01 |
    |   4 |    INDEX RANGE SCAN          | ACCT_DT_ACC_IDX |     1 |       |     4   (0)| 00:00:01 |
    ------------------------------------------------------------------------------------------------
    
    
    
    
    Plan 2(PHV: 3834848140)
    -----------------------
    
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    
    Stat Name                                Statement   Per Execution % Snap
    ---------------------------------------- ---------- -------------- -------
    Elapsed Time (ms)                                 0            N/A     0.0
    CPU Time (ms)                                     0            N/A     0.0
    Executions                                        0            N/A     N/A
    Buffer Gets                                       0            N/A     0.0
    Disk Reads                                        0            N/A     0.0
    Parse Calls                                       0            N/A     0.0
    Rows                                              0            N/A     N/A
    User I/O Wait Time (ms)                           0            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                 26            N/A     N/A
              -------------------------------------------------------------
    
    Execution Plan
    ---------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------
    |   0 | UPDATE STATEMENT             |              |       |       |     2 (100)|          |
    |   1 |  UPDATE                      | TEST         |       |       |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID| TEST         |     1 |    28 |     2   (0)| 00:00:01 |
    |   3 |    INDEX RANGE SCAN          | TEST_DT_IND  |     1 |       |     1   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS BY INDEX ROWID| ACCT         |     1 |    26 |     4   (0)| 00:00:01 |
    |   5 |    INDEX RANGE SCAN          | INDX_ACCT_DT |     1 |       |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------
    
    
    
    Full SQL Text
    
    SQL ID       SQL Text
    ------------ -----------------------------------------------------------------
    51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) +
                  NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB
                 RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )
    Your contribution is very much appreciated.

    Thank you for taking your time to answer my question.


    Concerning

    Oracle Lover3 wrote:
    How will I know (from Plan 1 and Plan 2) whose execution plan chose for the current run?

    Since you're already on 10.2, you can identify the actual execution plan by checking in V$ SESSION SQL_ID and SQL_CHILD_NUMBER column. This can be used to identify the plan in V$ SQL_PLAN (columns SQL_ID and CHILD_NUMBER) and in 10g, you can use the convenient DBMS_XPLAN. Function DISPLAY_CURSOR for the information of the real plan using these two parameters.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • execute the dynamic sql statement

    Hi all

    CREATE TABLE  XX_OFFICE_USER_IMP 
      (
        ID              NUMBER,
        OFFICE          VARCHAR2(10 BYTE),
        USER_NAME       VARCHAR2(10 BYTE),
        BANK_ACCOUNT_ID NUMBER,
        TRANSFERED      NUMBER
      )
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (421,'0000','F0000',10029,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (422,'0000','F0000',10031,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (423,'0000','F0000',10033,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (424,'0000','F0000',10036,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (425,'0000','F0000',10037,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (426,'0000','F0000',10039,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (427,'0000','F0000',10041,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (428,'0000','F0000',10046,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (429,'0000','F0000',10048,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (430,'0000','F0000',10067,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (431,'0000','F0000',10072,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (432,'0000','F0000',10087,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (433,'0000','F0000',10092,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (434,'0000','F0000',10008,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (435,'0000','F0000',10012,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (436,'0000','F0000',10013,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (437,'0000','F0000',10014,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (438,'0000','F0000',10017,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (439,'0000','F0000',10019,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (440,'0000','F0000',10024,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (441,'0000','F0000',10025,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (442,'0000','F0000',10001,null);
    Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (443,'0000','F0000',10002,null);
    CREATE TABLE XXBG_CASIER_CASH
      (
        CASHIER         VARCHAR2(32 BYTE),
        BANK_ACCOUNT_ID NUMBER(38,0)
      )
    declare 
    v_exe_grant varchar2(32767 char);
    begin 
    
    
    for i in (select * from xx_office_user_imp where office = '0000') loop
    
      insert into XXBG_CASIER_CASH values (i.user_name, i.bank_account_id);
    
      v_exe_grant := 
                     'create user '  || i.user_name || ' identified by ' || i.user_name || ';' 
                  || 'GRANT create session to ' || i.user_name || ';' 
                  || 'GRANT select on apps.XXBG_CE_STATEMENT_HEADERS_CASH to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.FND_USER TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.dFND_DESCR_FLEX_COL_USAGE_TL TO ' || i.user_name || ';' 
                  || 'GRANT select on apps.fnd_descr_flex_column_usages to ' || i.user_name || ';' 
                  || 'GRANT select on apps.fnd_descriptive_flexs to ' || i.user_name || ';' 
                  || 'GRANT select on apps.fnd_descriptive_flexs_tl to ' || i.user_name || ';' 
                  || 'GRANT select on ce.ce_statement_headers to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.fnd_doc_sequence_assignments TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON CE.CE_STATEMENT_HEADERS_S TO ' || i.user_name || ';' 
                  || 'GRANT EXECUTE ON APPS.XXBG_GET_NEXTVAL TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON CE.CE_STATEMENT_LINES TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.XXBG_CE_STATEMENT_LINES TO ' || i.user_name || ';' 
                  || 'GRANT select on apps.CE_BANK_ACCOUNTS to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.CE_BANK_BRANCHES_V TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON CE.XXBG_CASIER_CASH TO ' || i.user_name || ';' 
                  || 'GRANT EXECUTE ON APPS.XXBG_ST TO ' || i.user_name || ';' 
                  || 'GRANT select on ce.xxbg_ce_statement_lines_detail to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.ce_transaction_codes TO ' || i.user_name || ';' 
                  || 'GRANT select on ce.ce_statement_lines_s to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON CE.XXBG_CE_STATEMENT_LINES_DET_SQ TO ' || i.user_name || ';' 
                  || 'GRANT select on apps.xx_pko_lines to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON apps.xx_rko_lines TO ' || i.user_name || ';' 
                  || 'GRANT select on apps.XX_INVOICE_RELATIONS_CASH to ' || i.user_name || ';' 
                  || 'GRANT select on APPS.PO_VENDOR_SITES_ALL to ' || i.user_name || ';' 
                  || 'GRANT select on ap.AP_INVOICE_LINES_INTERFACE_S to ' || i.user_name || ';' 
                  || 'GRANT select on ap.AP_INVOICE_LINES_INTERFACE to ' || i.user_name || ';' 
                  || 'GRANT select on APPS.ap_distribution_set_lines_all to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.AP_INVOICES_INTERFACE_S TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.AP_INVOICES_INTERFACE TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.AP_DISTRIBUTION_SETS_ALL  TO ' || i.user_name || ';' 
                  || 'GRANT select on apps.ce_lookups  to ' || i.user_name || ';' 
                  || 'GRANT select on ar.HZ_CUST_SITE_USES_ALL to ' || i.user_name || ';' 
                  || 'GRANT select on ar.HZ_LOCATIONS to ' || i.user_name || ';' 
                  || 'GRANT select on ar.HZ_PARTIES to ' || i.user_name || ';' 
                  || 'GRANT select on ar.HZ_PARTY_SITES to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON AR.HZ_CUST_ACCT_SITES_ALL TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON AR.HZ_CUST_ACCOUNTS TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.XXBG_CLAIMS_V TO ' || i.user_name || ';' 
                  || 'GRANT select on apps.xxbg_insis_agents_v to ' || i.user_name || ';' 
                  || 'GRANT select on ce.xxbg_cash_doc_types to ' || i.user_name || ';' 
                  || 'GRANT select on AP.AP_BANK_ACCOUNTS_ALL to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON AP.AP_BANK_BRANCHES TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.FND_DESCR_FLEX_CONTEXTS TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.FND_DESCR_FLEX_CONTEXTS_TL TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.AP_SUPPLIERS to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.per_employees_x TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.fnd_doc_seq_categories_ap_v TO ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.AP_LC_INVOICE_TYPES_V to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON ce.xxbg_ce_statement_lines_sq to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.XXBG_STATEMENT_HEADERS_CASH to ' || i.user_name || ';' 
                  || 'GRANT SELECT ON APPS.XXBG_INSIS_POLICY_V TO ' || i.user_name || ';' 
                  || 'GRANT insert  ON ce.ce_statement_lines to ' || i.user_name || ';' 
                  || 'GRANT INSERT  ON CE.XXBG_CE_STATEMENT_LINES_DETAIL TO ' || i.user_name || ';' 
                  || 'GRANT INSERT ON APPS.AP_INVOICES_INTERFACE TO ' || i.user_name || ';' 
                  || 'GRANT INSERT ON APPS.AP_INVOICE_LINES_INTERFACE TO ' || i.user_name || ';' 
                  || 'GRANT INSERT ON APPS.XX_RKO_LINES TO ' || i.user_name || ';' 
                  || 'GRANT INSERT ON APPS.XX_PKO_LINES TO ' || i.user_name || ';' 
                  || 'GRANT delete on ce.xxbg_ce_statement_lines_detail to ' || i.user_name || ';' 
                  || 'GRANT update on ce.XXBG_CE_STATEMENT_LINES_DETAIL to ' || i.user_name || ';' 
                  || 'GRANT DELETE ON CE.CE_STATEMENT_LINES TO ' || i.user_name || ';' 
                  || 'GRANT INSERT ON CE.CE_STATEMENT_HEADERS TO ' || i.user_name || ';' 
                  || 'GRANT update on CE.CE_STATEMENT_HEADERS to ' || i.user_name || ';' 
                  || 'GRANT update on ce.CE_STATEMENT_LINES to ' || i.user_name || ';' 
                  || 'GRANT select on apps.XX_AGENTS_NO_V to ' || i.user_name || ';' ;
                  
                  
      execute immediate v_exe_grant;
      
    update xx_office_user_imp
      set transfered = 1 
      where id = i.id
    ;
    
    v_exe_grant := '';
    end loop;
    
    end;
    /
    After execute the PL/SQL block I get the message:
    Error report:
    ORA-00911: invalid character
    ORA-06512: at line 79
    00911. 00000 -  "invalid character"
    *Cause:    identifiers may not start with any ASCII character other than
               letters and numbers.  $#_ are also allowed after the first
               character.  Identifiers enclosed by doublequotes may contain
               any character other than a doublequote.  Alternative quotes
               (q'#...#') cannot use spaces, tabs, or carriage returns as
               delimiters.  For all other contexts, consult the SQL Language
               Reference Manual.
    *Action:
    Any ideas? I think I call correct immediate execution.

    DB version: 11g

    Unfortunately I can't provide you the sql code of the other tables to create their... Maybe you should try without all budgets... :)


    Thanks in advance,
    Bahchevanov.

    Edited by: bahchevanov on 11 October 2012 06:14

    Bahchevanov wrote:
    Any ideas?

    Sure. EXECUTE IMMEDIATE executes a unique statement when you try to run the job. So use:

    execute immediate 'create user '  || i.user_name || ' identified by ' || i.user_name;
    execute immediate 'GRANT create session to ' || i.user_name;
    execute immediate 'GRANT select on apps.XXBG_CE_STATEMENT_HEADERS_CASH to ' || i.user_name;
    .
    .
    .
    

    SY.

  • Check the old sql statements


    Hi, I want to know what updates occur during the night, so I can run it through a plan to explain and try to tune them (11.2). I have not any audit

    Ive looked in v$ _sql_plan, but can't make much sense of it. Is there an easy way to find out what went?

    Thank you very much

    Adam

    885842 wrote:

    Hi, I want to know what updates occur during the night, so I can run it through a plan to explain and try to tune them (11.2). I have not any audit

    Ive looked in v$ _sql_plan, but can't make much sense of it. Is there an easy way to find out what went?

    Thank you very much

    Adam

    REDO contains any DML history.

    Dbms_logmnr can provide details for any & all the UPDATE instructions

  • Use of ROWID in the Update SQL statement

    Hi all

    I have an update statement that uses the rowid column to make the selection on the target table. Since a rowid represents the physical location of a row on disc, we know that this reference may change when various activities are conducted on the line of database/table/etc...

    Here is an example of the statement I post:

    UPDATE tabA outertab SET col1 = 'value '.
    WHERE EXISTS (SELECT 1 FROM tabA innertab WHERE outertab.) ROWID = outertab. ROWID AND...)

    Of course, the inner query is more complicated and uses other tables etc. but for the purposes of the example we don't need to include the details.

    My question is: what help rowid in a single statement SQL as a reference of a subquery in the outer statement is there a risk that outdoor activities can change the rowid and these changes be reflected in the session database that my query is executed which causes an incompatibility between the clause SQL internally and externally?

    In response to the question that will follow this post: 'why don't you just use a PK', we would like to avoid to maintain a PK on the table that we are talking about very large volumes of data and we do not want to have to appeal to a sequence, if we can avoid when we insert the data. If however there is a risk that this Update statement may fail, or update lines badly, then we might have to use a PK.

    I know there are a lot of discussions about this, but I havnt been able to find one that someone answered with any kind of confidence or clarity, any help would be appreciated.

    Thank you

    Keith

    Edited by: Turtle on March 5, 2009 05:24

    When using rowid in a single statement SQL as a reference of a subquery in the outer statement is there a risk that outdoor activities can change the rowid and these changes be reflected in the session database that my query is executed which causes an incompatibility between the clause SQL internally and externally?

    No, it's safe to use rowid in this query type. Docs

    A line assigned ROWID remains unchanged, unless the line is exported and imported using the import and export utilities. When you delete a row in a table, then commit the transaction enclosing, rowid of the deleted row can be attributed to a line inserted in a subsequent operation.

  • limit the size on the column heading in the report SQL auery

    Hello

    I returned a SQL query in the report where my column labels are also dynamically. Apparently, the size of this label is limited? Why?
    We tried to get the maximum and it seems that it is limited to 32 characters?

    Y at - it a solution because the meaning of the column in my app is really more important and must be displayed entirely

    Thank you

    Erwin

    Erwin,

    APEX does not limit the size of the headers of column (at least not at only 32 characters). AFAIK a limitation exists only if you use a Type of "Column names" or "column names (InitCap)." Then you click on the limitation of the Oracle DB as an identifier of Oracle, for example name or alias of the column referenced in your SQL query, may not exceed 30 characters long. To work around use a Type of "Custom" or "PL/SQL". "PL/SQL", you can dynamically set the report headings with a function that returns the headers as a string of delimited colon. You call the function like this:

    return get_my_report_headers(<input parameters>)
    

    HTH
    Frank

  • How to see all passed to the db sql statements?

    Is it possible to configure Jdevloper (11.1.1.4) in a way so that it shows all the sql statements in the console?

    THX in advance

    You have restarted your WLS instance in debug mode?

  • Refresh the report SQL (Send Page element)

    I want to add a lookup field in a SQL report. I have something like this
    SELECT * FROM emp
    WHERE  emp_no  LIKE  :P1_SEARCH || '%'
    I want to make the asynchronous search on KeyPress. The problem is that a SQL report is not a ' submit: 'attribute as an interactive report. "
    So after I refresh the report:
    $a_report($x('P1_REPORT_ID').value,'1','10','100');
    The report is refreshing (the icon of circle on the top of the screen) but nothing changes cause the: P1_SEARCH supports.

    How can I submit a JS page element?

    Greetings from King,
    Cearnau Dan

    PS: I use 4 APEX and by using dynamic measurements, it is the same as the Javascript call. (still does not submit the: point P1_SEARCH)

    Hello

    Place your footer area

    
    

    And create processes on demand MODEL

    htp.prn('OK');
    

    Kind regards
    Jari

    Published by: jarola December 19, 2010 14:40
    typo

    Published by: jarola December 19, 2010 14:46

    Another typo corrected from code.

    I did fact sample
    https://Apex.Oracle.com/pls/OTN/f?p=40323:78

  • For the CASE of the Oracle SQL statement problem

    Follwing query run without any problem in oracle 12 c.

    SELECT

       BOX to_number (sysdate ' on()

             WHEN 6 THEN to_char(sysdate,'ww')+1

             WHEN 2 THEN to_char(sysdate,'ww')+1 

             ELSE to_char(sysdate,'ww')+ 1 END 

             FROM dual

    But the request fails below. Only change is WHEN 6 THEN to_char (sysdate 'ww') + 2

    SELECT

       BOX to_number (sysdate ' on()

             WHEN 6 THEN to_char(sysdate,'ww')+2

             WHEN 2 THEN to_char(sysdate,'ww')+1 

             ELSE to_char(sysdate,'ww')+ 1 END 

             FROM dual


    Data fault is ORA-01722 invalid number

    Hello

    Try below.

    SELECT

    CASE to_number (to_char(sysdate,'D'))

    WHEN 6 THEN to_char (sysdate, "ww") + 2

    WHEN 2 THEN to_char (sysdate, "ww") + 1

    END of ANOTHER to_char (sysdate, "ww") + 1

    OF the double

  • Why my static PL/SQL within SQL local variable is not transformed in space in the shared pool?

    Hello everyone,

    Oracle version: 12.1.0.1.0 - 64 bit

    OS: Linux Fedora Core 17 X86_64

    Description of the problem:

    I'm reading an interesting book of online oracle named: SQL in PL/SQL

    On page 11, it reads the following:

    In the absence of a compilation error, the PL/SQL compiler generates an equivalent statement of SQL regular text and stores this with the generated machine code. This instruction uses placeholders where the embedded SQL statement uses identifiers that have been resolved in the PL/SQL unit.

    What I understand of this (please, correct me if I'm wrong) is that whenever I write some static/embedded statement SQL within a PL/SQL block in which there are a few local variables in PL/SQL, and then final generated SQL statement (after resolution of identifier) will include placeholders (bind variables) instead of these identifiers the PL/SQL.

    I just wanted to see this in practice, so I made the following test:

    Test case:

    SQL> connect / as sysdba
    SQL> alter system flush shared_pool
    
    system altered
    

    So, normally, after execution of the foregoing the shared_pool on my development environment is now empty.

    And then I run the following PL/SQL block

    <<b>>
    declare
        depid hr.employees.department_id%type := 100;
        cnt   pls_integer := 0;
    begin
        select
            count(*)
        into
            b.cnt
        from
            hr.employees t1
        where
            t1.department_id = b.depid;
    end;
    /
    --
    --
    column sql_id new_value sqlid_saved;
    --
    select
        v1.sql_id
    from
        v$sql v1
    where
        v1.sql_text like '%t1.department_id = b.depid%';
    --     
    -- 
    select
        v1.sql_text
    from
        v$sql v1
    where
        v1.sql_id = '&sqlid_saved';
    

    And the result was:

    SQL_ID
    -------------
    687dxvsmrwm9z
    g17tjb3f8t94y

    6 old: v1.sql_id = "& sqlid_saved"
    6 new: v1.sql_id = "g17tjb3f8t94y".

    SQL_TEXT
    --------------------------------------------------------------------------------
    < < b > > declare depid hr.employees.department_id%type: = 100;     CNT pls_in
    SEB: = 0; Start select count (*) in b.cnt of
    T1 hr. Employees where t1.department_id = b.depid; end;


    SQL >

    What I don't understand is the main part of the SQL_TEXT I put in red.

    Instead of

    T1.department_id = b.depid

    I expected to see something like

    T1.department_id = : B

    In other words, some bind variable, because depid is a local variable inside my PL/SQL block used in integrated/static SQL statement, so it must be converted to a reserved space in the shared pool instead of the original identifier.

    You kindly could you tell me what I misunderstood?

    Thanks in advance

    > But once again no variable binding in the stored/parsed SQL statement. That's what I don't understand.

    Submitted by PL/SQL SQL is "normalized", which includes (among other things) convert uppercase. Your query on v$ sql is looking for '% hr.employees% '.

  • Are constants of body of the PL/SQL Package in the shared or private area

    Based on that it is not clear to me if body Package PL/SQL constants are stored in the shared or private area.

    http://docs.Oracle.com/CD/B28359_01/server.111/b28318/memory.htm

    "PL/SQL program units and the Shared Pool

    Oracle database treats PL/SQL program units (anonymous blocks, procedures, functions, packages and triggers in database) much the same way he treats the individual SQL statements. Oracle database allocates a shared area to hold the shape analyzed, compiled a program unit. Oracle database allocates a private space to hold values specific to the session who runs the program unit, including local, global and package variables (also known as the package is instantiated) and stamps of SQL execution. If more than one user is running the same program unit, a place unique and shared is used by all users, while each user runs a separate copy of his own private SQL area containing session-specific values.

    The individual SQL statements contained in a PL/SQL program unit are processed as described in the previous sections. Despite their origins within a PL/SQL program unit, these SQL statements use a shared area to hold their analysed representations and a private space for each session, who executes the statement. »


    I am also curious to know what are the differences in fine grain in a perspective of memory and performance (multisession) for the two examples below. One is more effective?


    Example 1.

    create or replace
    package body
    application_util
    as

    c_create_metadata constant varchar2 (6000): =...

    procedure process_xxx
    (
    )
    as
    Start
    ...
    end process_xxx;

    end application_util;

    vs.

    Example 2.

    create or replace
    package body
    application_util
    as

    procedure process_xxx
    (
    )
    as

    c_create_metadata constant varchar2 (6000): =...

    Start
    ...
    end process_xxx;

    end application_util;

    881398 wrote:

    But I still have to ask because it seems still more particularly in example 1 that the constant can be attributed to the use that the actual value could be a pointer to a constant string value in a table of symbols or something related to the compilation unit. I'm always curious in a perspective of management of memory if there is a difference between the example 1 and example 2, and if one is better and why.

    The storage is real, references to this storage internal to the PL/SQL engine. And irrelevant to the PL/SQL programmer.

    This question is really a disagreement over the shape is better: example 1 or example 2. I prefer the 1 example, for readability, testability, etc., and so the question is where is the performance of the memory/differences and or is it just preference of developer.

    I agree with rp0428 - he raised a very important point that it is a problem of scope and nothing else.

    Basically is there any trade-off between using one shape on the other insofar as the performance and memory management?

    Not really. Most runtime engines release not just actual system memory when a variable is out of range. the malloc() calls are expensive. Free() calls are expensive (and are not always the result in usable free memory which can be malloc'ed again).

    Several execution engines use what is called a managed heap. A malloc is made of a new process when it is initialized. The heap memory / managed malloc'ed is adjacent. Pointer allocation of memory for this process is initially pointing to the base of the managed heap. As the process allocates / uses memory, the pointer is moved just advance in the managed heap, which indicates the HWM as such - the beginning of the 'free' memory in the heap. Allocation is sequential.

    Reset of your variable execution, or releasing your runtime object, does not reset the HWM as other objects/variables can still be used and located after this place in the bunch. In this case set him free memory by releasing / resetting the language variables does not restore the kernel memory.

    Memory management is a sophisticated process entirely processed by the engine running - and best left to the runtime engine. As you as a programmer do not explicitly control the memory management, it is not a good idea to try to write code that artificially attempt to use 'better' for the runtime engine memory management. The next version of the runtime of that aura of new features, optimizations and so on — and your interference in your code to get the "valorisation" of memory can happen just bite you not bad after an upgrade to execution.

    Regarding the performance aspect - variable initialization is dependent on scope. In order to have a global scope means a one-time initialization, whereas a private scope (created each call) is a multiple unit. If the first is a little faster than the latter.

    However, the performance differences are tiny - IMO too small to justify this as a valid consideration to spend in addition to the decision of functional design on what possibilities a variable or a constant need to have.

    SQL> create or replace package FooLib1 as
      2          procedure Exec;
      3  end;
      4  /
    
    Package created.
    
    SQL>
    SQL> create or replace package body FooLib1 as
      2          const1  constant varchar2(32767) := rpad('-',10000,'-');
      3
      4          procedure Exec is
      5                  var1    varchar2(32767);
      6          begin
      7                  var1 := const1;
      8          end;
      9  end;
     10  /
    
    Package body created.
    
    SQL>
    SQL>
    SQL> create or replace package FooLib2 as
      2          procedure Exec;
      3  end;
      4  /
    
    Package created.
    
    SQL>
    SQL> create or replace package body FooLib2 as
      2          procedure Exec is
      3                  const1  constant varchar2(32767) := rpad('-',10000,'-');
      4                  var1    varchar2(32767);
      5          begin
      6                  var1 := const1;
      7          end;
      8  end;
      9  /
    
    Package body created.
    
    SQL>
    SQL> set timing on
    SQL> exec for i in 1..100000 loop FooLib1.Exec; end loop;
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.28
    SQL> exec for i in 1..100000 loop FooLib2.Exec; end loop;
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.74
    SQL> 
    

    A second difference 0.0000046 in a single execution for FooLib.Exec between the use of package for the constant scope, against increased private. Which means that the issue of the scope is not a decision of the performance. Not when improving performance overhead is 0,0046 millisecs.

Maybe you are looking for