problems with my dynamic sql statement

Hello

I'm not a pl/sql developer, but just trying to write a simple piece of pl/sql code. My intentions are simple. I want to find all tables with a specified column name, with a specific value in that column. Also, I just want to print these tables which have information in them.

I have read the documentation on oracle to find this information, but I can't seem to get this to work, and I don't see what my problem...

Here is the code I wrote.

declare

number of v_number;
sql_statement varchar2 (200);

cursor pick_table is
Select the table table_name from user_tab_columns
where upper (column_name) = upper ('md_file_id');

Start
because me in pick_table
loop

sql_statement: = ' SELECT count (*) from "| i.table_name | 'where md_file_id = 22410';
dbms_output.put_line (sql_statement);
EXECUTE IMMEDIATE sql_statement in v_number;
dbms_output.put_line ('number' | v_number);

If v_number > 0
then
dbms_output.put_line (i.table_name);
end if;

end loop;
end;
/

This works perfectly well if I try not to insert the table_name dynamically using i.table_name and a writing of the database table names in the select statement. It runs also fine if I take "v_number" information on my execute immediate command.
Of course I can't do it with logic I.

What is happening is that the procedure is pretending to hang himself.

I'd appreciate any help that can be given.

Thanks in advance

user10869417 wrote:
...
What is happening is that the procedure is pretending to hang himself.

It doesn't seem to be anything wrong with your code. It seems that you have:

has a lot of tables in your schema with the column MD_FILE_ID (perhaps having value 22410), or
(b) you have only a few tables but huge with this column

In my test with only 1 db such table, your PL/SQL block is running almost instantly:

test@XE>
test@XE> --
test@XE> drop table t;

Table dropped.

test@XE> create table t as
  2  select 22410 md_file_id from dual;

Table created.

test@XE>
test@XE> set timing on
test@XE>
test@XE> @test.sql
test@XE> declare
  2    v_number number;
  3    sql_statement varchar2(200);
  4    cursor pick_table is
  5      select table_name from user_tab_columns
  6      where upper(column_name) = upper('md_file_id');
  7  begin
  8    for i in pick_table
  9    loop
 10      sql_statement := 'SELECT count(*) from ' || i.table_name || ' where md_file_id = 22410';
 11      dbms_output.put_line(sql_statement);
 12      EXECUTE IMMEDIATE sql_statement into v_number;
 13      dbms_output.put_line('count returned ' || v_number);
 14      if v_number > 0
 15      then
 16        dbms_output.put_line(i.table_name);
 17      end if;
 18    end loop;
 19  end;
 20  /
SELECT count(*) from T where md_file_id = 22410
count returned 1
T

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.33
test@XE>
test@XE>  

which means that if you wait long enough, the pl/sql block will reach eventually up to completion.

isotope

Tags: Database

Similar Questions

  • Char invalid when you use dynamic sql statements with cursor

    Hello guys,.
    I'm opening a following cursor with dynamic sql
     v_sql := 'SELECT OS.table_name FROM OBJECT_STATS_CONTROL OS, ALL_TABLES AT
                    WHERE OS.analyze_flag <> ''N''
                    AND OS.last_analyze < sysdate -1 AND AT.last_analyzed < sysdate - 1 '||v_1||';'; 
    my cursor statement is
    BEGIN
           OPEN v_cur FOR v_sql; 
           LOOP
           FETCH v_cur INTO v_tabname;
    ......
    I get an error message
    0911 invalid char
    can any body suggest me where I'm wrong

    Thank you

    Remove the semicolon at the end:

    ||';'  -- remove this.
    
  • Helps with the syntax of dynamic sql statements

    Hi all
    How can I pass the value of the result of my dynamic select statement to a Ref Cursor?
    I try the following statement but does not work, I get this error:
    ORA-00932: inconsistent data types: expected - was - ORA-06512: at
    Procedure getItems(v_first In number, v_second In Number, arg_Cursor IN OUT CUSTOM_REF_CURSOR) is
         sqlString varchar(3000);
         Begin
           sqlString := 'select* from bla where o.arg_1 = :1 and arg_2 = :2'; 
       
           execute immediate sqlString 
           into arg_Cursor
           using v_first, v_second;
       End getItems;
    Any ideas?
    Thank you

    Johnny
    PROCEDURE getitems (v_first IN NUMBER, v_second IN NUMBER, arg_cursor IN OUT sys_refcursor)
    IS
      sqlstring   VARCHAR (3000);
    BEGIN
      sqlstring := 'select* from bla where o.arg_1 = :1 and arg_2 = :2';
    
      OPEN arg_cursor FOR sqlstring USING v_first, v_second;
    END getitems;
    
  • GETTING AN ERROR - slider 'P_REFCUR' cannot be used in the OPEN dynamic SQL stat

    DECLARE
    create or replace procedure partial_single (p_fileid in NUMBER, p_filename IN VARCHAR2 (2000), p_temptablename IN VARCHAR2 (2000), p_temppartialtablename IN VARCHAR2 (2000), p_retval ON the NUMBER)
    --)

    p_fileid NUMBER;
    p_filename VARCHAR2 (2000);
    p_temptablename VARCHAR2 (2000);
    p_temppartialtablename VARCHAR2 (2000);
    p_retval NUMBER;
    p_refcur types_pkg.return_cur;
    v_strquery varchar2 (4000);

    BEGIN

    p_fileid: = 5080;
    p_filename: = "TAGSUR1HM2011013111160838654.000019265";
    -p_temptablename: = "TEMP_RECORDS_MED_0004";
    p_temptablename: = 'TEMP_RECORDS_MED_DATE ';
    p_temppartialtablename: = 'TEMP_MED_PARTIAL_RECORDS_0002 ';
    p_retval: = 0;


    v_strquery: = 'SELECT imsi, connectedcallingnumber, callstart MIN (calleventstarttimestamp), SUM (calleventduration), MAX (sequence_number) sequencenumber, msisdn, max (callreleasetime) callreleasetime period';
    v_strquery: = v_strquery | ' A ' | p_temppartialtablename | ' GROUP BY connectedcallingnumber, imsi, msisdn';

    OPEN p_refcur - GETTING AN ERROR - slider 'P_REFCUR' cannot be used in a dynamic OPEN SQL statement
    FOR v_strquery;

    FOR CC IN (SELECT imsi,
    connectedcallingnumber,
    Callstart MIN (calleventstarttimestamp),
    Duration of the SUM (calleventduration),
    SequenceNumber MAX (sequence_number),
    MSISDN,
    Max (callreleasetime) callreleasetime
    OF TEMP_MED_PARTIAL_RECORDS_0002
    GROUP BY connectedcallingnumber, imsi, msisdn)

    LOOP

    UPDATE TEMP_RECORDS_MED_DATE
    SET calleventstarttimestamp = cc.callstart,
    calleventduration = calleventduration + cc.duration
    WHERE connectedcallingnumber = cc.connectedcallingnumber
    AND imsi = cc.imsi
    AND sequencenumber = cc.sequencenumber + 1
    AND msisdn = cc.msisdn
    AND calleventstarttimestamp = cc.callreleasetime;


    IF SQL % ROWCOUNT > 0
    THEN
    UPDATE TEMP_MED_PARTIAL_RECORDS_0002
    SET isprocessed = 1
    WHERE connectedcallingnumber = cc.connectedcallingnumber
    AND imsi = cc.imsi
    AND msisdn = cc.msisdn;
    - AND callreleasetime = cc.callreleasetime;

    ON THE OTHER

    UPDATE TEMP_MED_PARTIAL_RECORDS_0002
    SET calleventduration = calleventduration + cc.duration
    IMSI WHERE = cc.imsi
    AND msisdn = cc.msisdn
    AND callreleasetime = cc.callreleasetime
    AND calleventduration! = cc.duration;


    END IF;

    END LOOP;


    REMOVE FROM TEMP_MED_PARTIAL_RECORDS_0002
    WHERE isprocessed = 1;


    p_retval: = 0;

    -VALIDATION;
    / * EXCEPTION
    WHILE OTHERS
    THEN
    -RESTORATION;
    p_retval: = 1;
    p3_errorlog ("partial" p_fileid, SQLERRM, |) ':' || p_filename);
    COMMIT;
    */
    END;

    Is - what your refcursor has a return type? In this case you can not open it with dynamic SQL. Change the Refcursor as a weakly typed cursor and give it a try.

  • What is the problem with this pl/sql code?

    What is the problem with this statement of the cursor? I am getting PLS-00341 error for her:
    CURSOR cur_rsource(p_sql_stmt IN VARCHAR2) IS
            SELECT plan_table_output FROM v$sql s, table(dbms_xplan.display_CURSOR(s.sql_id, s.child_number)) t WHERE sql_text LIKE '''%'||p_sql_stmt||'%''';
    How to solve this problem?

    Thank you

    Published by: PhoenixBai on December 14, 2009 14:05

    I don't have time right now to study exhaustively, but for me his vomit ORA-00942 table or view does not exist on this line:

        SELECT sql_id, child_number into tmp_sql_id, tmp_child_number
             from v$sql where sql_text like sql_statement||'%' and sql_text not like '%v$sql%';
    

    I am able to select from v$ sql in normal SQL as user I am compiling as, so don't know why it's complaing.

    Anyone know if there are certain restrictions on access to the views v$ through PL/SQL?

    EDIT: http://www.dbasupport.com/forums/showthread.php?t=22299

    Access to the views of $ v seems to be through a role - try giving explicit access to it.

    As SYS, you must grant select permissions on V_$ SQL (V$ SQL is synonymous with V_$ SQL) to your owner of the procedure. Just tested on my system and it allows him to compile.

    Published by: Cyn on December 14, 2009 10:30

  • Zero error of iteration - the treatment of dynamic sql statements in dbms_xmlgen

    Hello

    I have a procedure that creates a dynamic sql v_sql

    cursor v_curr is
    Select *.
    of btctl_msg_log;

    BEGIN
    Select count (*) in the v_cnt of btctl_msg_log;

    IF v_cnt > 0 THEN
    C1 in v_curr
    LOOP
    v_sql: = "' | ' SELECT * from '. C1.msg_rcrd_src_tbl_nm | |' where rowid = ' | " ' ||'' ' || C1.msg_rcrd_src_tbl_id | " ' ||'' ' ||'' ' ;
    Select DBMS_XMLGEN.getXMLtype (v_sql) in the double v_xml;

    gives me an error

    ORA-19202: an error has occurred in the processing of XML
    ORA-24333: zero number of iterations
    ORA-06512: at "SYS." DBMS_XMLGEN", line 288
    ORA-06512: at line 1

    I don't know why is this error happening.
    Any help much appreciated.

    881575 wrote:
    Hello

    I have a procedure that creates a dynamic sql v_sql

    cursor v_curr is
    Select *.
    of btctl_msg_log;

    BEGIN
    Select count (*) in the v_cnt of btctl_msg_log;

    IF v_cnt > 0 THEN
    C1 in v_curr
    LOOP
    v_sql: = "' | ' SELECT * from '. C1.msg_rcrd_src_tbl_nm | |' where rowid = ' | " ' ||'' ' || C1.msg_rcrd_src_tbl_id | " ' ||'' ' ||'' ' ;
    Select DBMS_XMLGEN.getXMLtype (v_sql) in the double v_xml;

    gives me an error

    ORA-19202: an error has occurred in the processing of XML
    ORA-24333: zero number of iterations
    ORA-06512: at "SYS." DBMS_XMLGEN", line 288
    ORA-06512: at line 1

    I don't know why is this error happening.
    Any help much appreciated.

    Standard when boards (ab) use of EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the variable before passing to EXECUTE IMMEDIATE.
    COPY the statement & PASTE in sqlplus to validate its correctness.

  • What is the problem with this dynamic query? help

    with the following code, I get the correct answer.
    I just want to know maxempno current (and care for the 3rd, 4th tank only)

    declare
    Temp varchar2 (2);
    Start

    Select substr (A1.empno, 3, 2) in the emp A1 temp where A1.empno = (select (max (A2.empno) of emp A2) and rownum = 1;)
    HTP.p ('temp' is |) Temp)
    end;

    Temp is 34

    =====================================
    Now I need to make a call to the procedure and pass the name of a table and column

    P_CHECK_MAX
    ('emp' = > p_table,)
    ('empno' = > p_column)

    create or replace procedure 'P_CHECK_MAX '.
    (p_table in VARCHAR2,
    p_column in varchar2)

    is
    Temp varcahr2 (2);
    d_select varchar2 (500);

    Start
    d_select: ='SELECT substr (A1.'| p_column | 3: 2) IN ' | "temp" | 'FROM ' | p_table | "A1 WHERE A1.' | p_column | "= (SELECT max (A2.' | p_column |')) OF ' | p_table | ("A2) AND rownum = 1';
    immediately run d_select;

    end;

    I'm getting ORA - 00905 missing keywords. Can you help me what is the missing word here? I am stomped for hours on it.

    Published by: wanwan63 on September 29, 2009 06:23
    Sorry I reverse the setting in the call. must be p_table = > 'emp', p_column = > 'empno '.

    P_CHECK_MAX
    ("emp"-online p_table,
    'empno'-online p_column)

    It must be

    p_check_max(p_table=>'emp', p_column=> 'empno)
    

    d_select: ='SELECT substr (A1.'| p_column | 3: 2) IN ' | "temp" | 'FROM ' | p_table | "A1 WHERE A1.' | p_column | "= (SELECT max (A2.' | p_column |')) OF ' | p_table | ("A2) AND rownum = 1';
    immediately run d_select;

    IN is not part of the SQL syntax. Its syntax PL. If you can not use dynamic SQL. It should be like this

    d_select:='SELECT substr(A1.'||p_column|| ',3,2)  FROM ' || p_table || '  A1 WHERE A1.' ||p_column ||'= (SELECT max(A2.' ||p_column||') FROM ' || p_table||' A2) AND rownum=1';
    execute immediate d_select into temp;
    
  • Display dynamic SQL statement result

    Hello

    Is it possible to view the sql statement in the procedure below, after that the variables are applied?

    In my view, a solution would be to put the entire statement in an important variable, then use DBMS_OUTPUT. Put_line (my_large_variable) but I'm hoping to save this step.

    Thanks in advance for your help,

    Lou

    create or replace
    PROCEDURE TEST1_PROC)
    p_refcur ON SYS_REFCURSOR,
    p_where in VARCHAR2,
    p_order_by in VARCHAR2
    )

    IS

    v_id ci_summrpt_report_codes.id% TYPE;
    v_descr ci_summrpt_report_codes.descr% TYPE;
    v_valid_flag ci_summrpt_report_codes.valid_flag% TYPE;
    v_order_by VARCHAR2 (100);

    BEGIN
    IF p_order_by IS NULL THEN
    v_order_by: = NULL;
    ON THE OTHER
    v_order_by: = "ORDER BY". p_order_by;
    END IF;
    DBMS_OUTPUT. Put_line (p_where);
    DBMS_OUTPUT. Put_line (v_order_by);
    P_refcur OPEN FOR ' SELECT id, descr, valid_flag OF |
    «(SELECT 1 AS 'ID', "A" AS "DESCR", "Y" AS "VALID_FLAG" OF THE DOUBLE ' |)»
    "UNION ALL" |
    "SELECT 2,"TWO","Y"OF THE DOUBLE ' |
    "UNION ALL" |
    "SELECT 3,"THREE"," Y "DOUBLE" |
    "UNION ALL" |
    SELECT 4, "FOUR", "Y" DOUBLE) ' |
    p_where |
    v_order_by
    ;
    END TEST1_PROC;

    In my view, a solution would be to put the entire statement in an important variable, then use DBMS_OUTPUT. Put_line (my_large_variable) but I'm hoping to save this step.

    This isn't a big problem, I think, is - this? :

    create or replace procedure test1_proc (p_refcur        out sys_refcursor,
                                            p_where      in     varchar2,
                                            p_order_by   in     varchar2)
    is
       v_id           ci_summrpt_report_codes.id%type;
       v_descr        ci_summrpt_report_codes.descr%type;
       v_valid_flag   ci_summrpt_report_codes.valid_flag%type;
       v_order_by     varchar2 (100);
       v_stmt         long;
    begin
       if p_order_by is null
       then
          v_order_by := null;
       else
          v_order_by := ' ORDER BY ' || p_order_by;
       end if;
    
       dbms_output.put_line (p_where);
       dbms_output.put_line (v_order_by);
       v_stmt :=
          'SELECT id, descr, valid_flag FROM '
          || '(SELECT 1 AS "ID", ''ONE'' AS "DESCR", ''Y'' AS "VALID_FLAG" FROM DUAL '
          || 'UNION ALL '
          || 'SELECT 2, ''TWO'', ''Y'' FROM DUAL '
          || 'UNION ALL '
          || 'SELECT 3, ''THREE'',''Y'' FROM DUAL '
          || 'UNION ALL '
          || ' SELECT 4, ''FOUR'',''Y'' FROM DUAL) '
          || p_where
          || v_order_by;
       dbms_output.put_line (v_stmt);
    
       open p_refcur for v_stmt;
    end test1_pro;
    
  • What is the problem with this PL/SQL block

    declare
    v_count integer: = 0;
    Start
    -immediate ' select count (1) in v_count of | "abc". '.table1 ';
    run immediately ' select count (1) in abc.table1 v_count;
    dbms_output.put_line ('v_count: ' | v_count);
    end;

    When I execute the pl/sql block above, I get the following error:
    ORA-00905: lack of keyword
    ORA-06512: at line 6

    What I am doing wrong?
    When I use SELECT COUNT (1) INTO v_count FROM abc.table1; (instead of the dynamic sql), it works.
    I know I can't use run immediately to SELECT, but I need to make the dynamic SQL because table1 will be developed according to several drawings.

    Would appreciate an explanation of the error above, or alternate solution (s) SQL dynamic.

    Thank you
    DECLARE
      v_count INTEGER := 0;
    BEGIN
      -- execute immediate 'select count(1) into v_count from ' || 'abc' || '.table1';
      EXECUTE IMMEDIATE 'select count(1)  from abc.table1' into v_count;
      dbms_output.put_line('v_count: ' || v_count);
    END;
    

    TEST

    DECLARE
      v_count INTEGER := 0;
    BEGIN
      -- execute immediate 'select count(1) into v_count from ' || 'abc' || '.table1';
      EXECUTE IMMEDIATE 'select count(1) from dual ' into v_count;
      dbms_output.put_line('v_count: ' || v_count);
    END;
    /
    v_count: 1
    
    PL/SQL procedure successfully completed.
    

    HTH
    SS

  • 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.

  • Problem with the microsoft SQL server installation 2016

    When I'm tryig to install MICROSOFT SQL SERVER MANAGEMENT STUDIO 2016 his watch an error like

    [8:21 TO 8 19(D)] [2015 12-14 T 13: 46:06] e000: MainViewModel.OnBundleAction: Bundle action failed

    What to do to solve this problem. ?

    Hello

    Your question is beyond the scope of this community.

    Please repost your question in the SQL Server TechNet Forums.

    https://social.technet.Microsoft.com/forums/SQLServer/en-us/home?category=SQLServer

    See you soon.

  • problem with the order of statements

    Hello

    I know that, in the declaration section, the cursor should be at the top of the statement and only then I can declare the internal procedures, functions etc.
    But what happens if in this slider, I need the result of the internal function said after the cursor? The cursor does not see this feature because is declared after.
    How do I write this slider, is it possible?

    Thank you!

    The SQL engine is aware of the standalone procedures and functions as well as public packet methods. He is not aware of the private methods in a package or nested procedures & functions. The PL/SQL engine always runs all PL/SQL blocks, it's just a question of which blocks exposes it PL/SQL in SQL engine.

    If you need to call a nested function or a private function declared in your package, it is normally relatively simple just call the function in an iteration on the cursor rather than in the cursor declaration itself, i.e.

    declare
      l_dname dept.dname%type;
      cursor employees is
        select *
          from emp;
      function get_dname( p_deptno in number )
        return varchar2
      is
        l_dname dept.dname%type;
      begin
        select dname
          into l_dname
          from dept
        where deptno = p_deptno;
        return l_dname;
      end;
    begin
      for i in employees
      loop
        l_dname := get_dname( i.deptno );
      end loop;
    end;
    /
    

    rather than trying to call the GET_DNAME procedure in the context of the cursor EMPLOYEES.

    Justin

  • I have a problem with the dynamic buttons on AC3.

    I downloaded a flash with a pre-made navigation model and all the buttons are in English. I am really struggling to do the buttons display Cyrillic text. Whenever I write in Cyrillic text, buttons are empty. Here is the code:

    var menu_label:Array = new Array ("Something",

    'Something',

    'Something',

    'Something',

    'Something');

    var total: Number = menu_label.length;

    var i: Number = 0;

    var: page number;

    var main_menu:MovieClip = new MovieClip();

    stage.addChild (main_menu);

    for (i = 0; i < total; i ++)

    {

    btn var = new flashmo_button();

    btn.name = "btn" + i;

    btn.x = fm_button.x + i * (fm_button.width + 5);

    btn.y = fm_button.y;

    btn.buttonMode = true;

    btn.item_no = i;

    btn.flashmo_click_area.addEventListener (Event.ENTER_FRAME, btn_enter);

    var each_substring:Array = menu_label [i].split("|");

    btn.flashmo_button_label.fm_label.text = each_substring [0];

    btn.item_url = each_substring [1];

    main_menu.addChild (btn);

    }

    Any ideas how to solve this problem? Thanks in advance!

    PS: I am a complete newbie

    Try to join the police in the textfields.  If you select the textfield object in the button, theProperties Panel should have a button available called Embed.  Click on that and rthen select the characters that you expect, you'll need (the less the better in terms of file size)

  • Problems with the implementation of State machine enemies spawn

    Hi guys,.

    I am developing my own 2D shoot-em - up and using a book called "The essential guide to Flash games" as reference to create my own state machine enemies spawn where the game keep enemies spawning (game will always until the player dies). I tried to trigger each enemy spawn that occur at the level of the game with a variable called 'chance '.

    With my current attempts, the game does not an enemy and does not other or not spawning all enemies at all. I was wondering everyone here has suggestions/advice for this question, I will have?

    Here is the sample code from the book that I used:


    public void Main()
    {
    Level = 1;
    score = 0;
    chance = 0;


    enemies = new Array();
    makeEnemies();

    }

    public function makeEnemies (): void {}
    var chance: Number = Math.floor (Math.random () * 100);
    var tempEnemy:MovieClip;
    If (< 2 + level of luck)
    tempEnemy = new EnemyImage()
    tempEnemy.y = 435;
    tempEnemy.x = Math.floor (Math.random () * 515)
    addChild (tempEnemy);
    Enemies.push (tempEnemy);
    }
    function checkCollisionWithEnemies(bullet:MovieClip)
    {
    If (enemy.meter.width < 1)
    {
    Enemy.Stop ();
    swapProperies (enemy, b);
    removeChild (enemy);
    enemy = null;
    level ++;
    }

    Occurring in the book lines:

    "var chance: Number = Math.floor (Math.random () * 100);"
    "If (< 2 + level of luck).

    should create + 2 enemies according to the level of the game, but no enemies to reproduce at all. I also tried a different method with "if (level > = 1)" but that creates a single enemy.

    Anyone have any suggestions of what I'm doing wrong? Any help would be greatly appreciated.

    Thank you

    Jonesy

    > is not new spawning enemies when the former enemies are killed

    You have nothing to create new enemies in the function "checkCollisionWithEnemies()".

    > three enemies are created in the beginning instead of one

    The for () loop based on makeEnemies() is configured to run 3 times (I I = 0, 1, 2)

  • Problem with accessing dynamically created video clips, returns null.

    I hope that it's a dumb question with an easy answer, if my code is pretty simple.

    I use this code snippet to create menu items, then use the variable jCount below to give the clips a like number, index in so much of (which seems to work very well):

    for(var j:Number=0;j<xmlSubMenuLength;j++){  
        var mcSubMenuItem:mcSubMenu=new mcSubMenu();    
        addChild(mcSubMenuItem);     
        jCount++;    
        mcSubMenuItem.name = "mcSubMenuItem" + jCount; 
        //traces out names correctly
        trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name); 
        mcSubMenuItem.x=mcMenuHolder.x+20;
        mcSubMenuItem.y =mcMenuHolder.y;
        mcSubMenuItem.y+= nextBtnY;
        nextBtnY+=subtopicSpace;
        global_subi.text = String(jCount); //i see the proper count of 10 in the text field
       }
       
       
    

    However, when I try to access the clips using this snippet:

      
     for(var j:Number=0;j<Number(global_subi.text);j++)//
        {   
      trace("GLOBAL SUBI = "+ String(global_subi.text));  //traces out 10, which it should
      var scSubMenuItem:String = "mcSubMenuItem" + j;   
      var scSubContent:Object = this.getChildByName(scSubMenuItem); 
      trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent); //returns null!
      
     }   

    My last trace statement returns null. Anyone can see my mistake, or explain why I can't access my videos after they have been created?

    Thanks muchly,.

    ~ Chipleh

    You are welcome.

Maybe you are looking for