running of SQL question

Hi expert,


When I ran after SQL, error message reads "table or view does not exist" pointing to the table "dba_tab_cols" and "dba_all_tables". There is no other question for this statement, because if I changed table "user_tab_cols" and "user_all_tables", it works well.


declare
v_old_table DBA_tab_columns.table_name%type;
v_where Varchar2 (4000);
Boolean v_first_col: = true;
type rc is ref cursor;
c rc;
v_rowid varchar2 (20);
Val varchar2 (50): = "Test note";

Start
for r in)
Select
t.*
Of
dba_tab_cols t, dba_all_tables a
where t.table_name = a.table_name
and t.data_type like '% CHAR % '.
and a.owner = 'QA'
order by t.table_name loop)

If v_old_table is null then
v_old_table: = r.table_name;
end if;

If v_old_table <>r.table_name then
v_first_col: = true;

-dbms_output.put_line ('search' | v_old_table);

Open c for ' select rowid from ' ' |. ' v_old_table | '" ' || v_where;

extract the c in v_rowid;
loop
When the output c % notfound;
dbms_output.put_line (' rowid: ' | v_rowid |) "in" | v_old_table);
extract the c in v_rowid;
end loop;

v_old_table: = r.table_name;
end if;

If v_first_col then
v_where: = 'where ' | r.column_name | "as" %' | Val | '%''';
v_first_col: = false;
on the other
v_where: = v_where | "or" | r.column_name | "as" %' | Val | '%''';
end if;

end loop;
end;


But if I choose these DBA tables in the toad sql Editor, it works well, I am currently using my own credentials, not the administrator credentials. why he get different effects running in these two ways?

Thank you very much

>

Hello

When I ran after SQL, error message reads "table or view does not exist" pointing to
Table 'dba_tab_cols' and 'dba_all_tables '. There is no other question for this statement, because

If I changed table "user_tab_cols" and "user_all_tables", it works well.
But if I choose these DBA tables in the toad sql Editor, it works well, I am currently using my own
credentials, not the administrator credentials. why he get different effects running in these two ways?

You answered your own question - you know that you have the administrator privileges when you
Open a session under your own credentials - but your id user obviously does TOAD.

You use SQL * for the query that fails?

BTW, you do not give us your version of Oracle - you must always tell us what it is

Please read the forum FAQ and also the thread "sticky" by BluShadow at the top of the list of positions
on the forum homepage. These forums are an excellent resource - you will get the best out of them if
you follow the instructions.

HTH,

Paul...

Published by: Paulie July 24, 2012 16:40

Tags: Database

Similar Questions

  • When the computer starts first to the top, a window titled "run as" the question "which user account do you want to use to run this program?

    Original title: which user account you want to use to run this program?

    I use a computer that is running Windows XP SP3. Recently, when the computer starts first to the top, a window will appear titled ' run as ' the question "which user account do you want to use to run this program?" with two radio buttons. The default selection is "Current user" and there is a checkbox to "protect my computer and data from unauthorized program activity. The other button is for "the next user. I have to click 'OK' before you can run any programs.

    There is only one user on the computer. Why has this window began to appear and can I get rid of him?

    Hello

    That you recently installed which triggers this popup message initially upwards?

    You can try to perform a clean boot and check if it helps.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to configure Windows XP to start in a "clean boot" State

    Note: Make sure that you put the computer to a Normal startup once you have completed troubleshooting.

  • Problem with Apex 5.0 report with a query that runs in SQL Developer

    Hello

    I have a query that runs in SQL Developer without problem, but when I use it in a classic report, it displays following:

    error report:

    ORA-06502: PL/SQL: digital or value error: character of number conversion error


    The query is:

    select 
     T1.ID_ATTACHMENT, 
     T1.BLOB_CONTENT, 
     T2.ATTACH_CATEGORY, 
     T1.FILENAME, 
     T1.ATTACHMENT_DESCRIPTION 
    from ATTACHMENTS T1
     LEFT JOIN REF_ATTACH_CATEGORIES T2
      ON T1.ATTACHMENT_CATEGORY = T2.ID_ATTACH_CATEGORY
     WHERE T1.ID_ATTACHMENT IN
      (SELECT ID_ATTACHMENT FROM REL_ATTACHMENTS
       WHERE REL_PART_ID = 1
       AND REL_ID = 64146);
    


    And the output of SQL Developer is:

    2015-08-12_01-03-36.png

    I have following Setup for the BLOB_CONTENT column in the classic report:

    2015-08-12_01-06-25.png

    Any ideas what is causing this problem?

    Thanks in advance,

    Sergio


    I don't have notes with me, but I think that the content of the blob must be selected as:

    DBMS_LOB. GetLength (blob_content) as blob_content

    and check that you have included the primary key in the results.

  • What do I need to run adsysapp2.sql in the database of R12?

    Hi, experts:


    I'm migrating a 11.2.0.3 R12 database of HP following Linux notes 741818.1. I work on the step 8. Establish the diagram of the SYSTEM. After execution of the

    script ausy1120.sql, I saw that a command in the log file says "You must run adsysapp.sql to create packages of Oracle Applications in the scheme of the SYSTEM.". What do I need to run this? It is not said in the note. At this point I just create a database structure. No given no request.


    Thanks and regards.

    Thank you so much, Hussein.

  • Running a SQL command in my bean class

    Hi all

    I use JDeveloper 12.1.2.0.0.

    I have an interest in running a query in my method of bean. I did some research and I always have a code but it does not find the method that the method requires so I tried to add the query in my AppModule and I added my method as a data control, but how do I access and change my method of bean?

    The page with the code that does not find the method: http://jjzheng.blogspot.pt/2010/11/run-single-query-in-application-module.html

    Gives me: 'Method 'getDBTransaction' not found'

    The page that creates my method as a data control: http://amit-adf-work.blogspot.pt/2013/09/how-to-execute-sql-using-adf-application.html

    This is the right way? How can I run a SQL command in my bean class?

    Kind regards

    Frederico.

    This is the code I am using

    GET A METHOD OF PAGEDEF AND RUN

    get the link containe

    BindingContainer links is BindingContext.getCurrent () .getCurrentBindingsEntry ();.

    get an Action or a MethodAction

    Method of the class OperationBinding = bindings.getOperationBinding ("YourMethodAction");

    If there are parameters to define...

    Map paramsMap = method.getParamsMap ();

    paramsMap.put ("param", "value");

    execute the method

    Method.Execute ();

    List errors = method.getErrors ();

    If (! errors.isEmpty ())

    {

    handle errors errors here is a list of exceptions!

    }

    no error return to normal work

    Timo

  • Running PL/SQL scripts...

    Hello:

    I'm new to PL/SQL and am learning by writing that a few basic Queries.I using TOAD as a tool to write queries I got stuck in this query I posted below.

    Here I have a table with data.

    EMPLOYEE_ID SALARY BONUS

    ----------- ---------- ----------

    90-1000

    100 2000

    110 1890

    130 2132

    120 1255

    I wrote a query which take the value from the table (of particular employee_id) salary and multi with 0.01 and once again will store in the variable bonus (so far everything works fine).

    but when I execute the script with the function to update its time consuming process (ends without result).

    DECLARE

    bonus NUMBER (8.2);

    emp_id NUMBER (6): = 100;

    BEGIN

    SELECT salary * 0.10 IN bonus

    Employees

    WHERE employee_id = emp_id;

    dbms_output.put_line (bonus);

    update set employees.bonus = bonus employees where employee_id = emp_id;

    END;

    I tried the same thing through the sql-plus tool.


    I stored the file above in note ++ (.sql extension) and through sql-plus I tried to run

    SQL > @[path] [file]


    but this does not work please help me in this. Please help me solve both ways...



    See you soon...

    It shouldn't take long at all.

    SQL > create table emp2 in select * from emp;

    Table created.

    SQL > ed c:\give_bonus.sql

    In my case, I have...

    >
    declare
    number of bonuses;
    emp_id number: = 7788;
    Start
    Select sal * 1.1
    as a bonus
    from emp2
    where empno = emp_id;

    dbms_output.put_line ('Sal with bonus: ' | bonus);

    Update emp2
    Sal value = give_bonus.bonus
    where empno = emp_id;

    commit;
    end;
    /

    And then again in SQL * more I call it...

    SQL > set timing on
    SQL > @c:\give_bonus.sql
    SAL with bonus: 3300

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.03

    Very fast.

    Perhaps you lack the ' / ' the end of your script that tells SQL * Plus to run the code?  And he's sitting there waiting for input?

  • error running InstallOracleProfile.sql

    evening of GOOG,
    I installed oracle XE and Toolkit for asp.net odac in my pc.when that I am trying to run InstallOracleProfile.sql I get
    ORA-01917: user or role 'ORA_ASPNET_PROF_FULLACCESS' does not exist
    can someone help me solve this problem

    Thank you
    Prakash

    Hello

    Did you run the InstallOracleASPNETCommon.sql script?
    Kind regards

  • Virtual Center can run on SQL Server Express

    Hi, I currently have Virtual Center running on SQL Server 2005 Standard.  I would like to move databases to SQL Server Express.  Virtual Center run on SQL Server Express?  Y at - there any restrictions that I can hit?  We run ESX 4.X and a few 50 VM environment.

    Thanks in advance for your help,

    Terry

    the limitation to Express is 5 guests and 50 VM.  However, the biggest concern may be the restriction of size of 4 GB of your DB.  May I ask why if you are already running on the standard 2005 would return you Express?

  • Models to run a SQL to droplet (selection)

    Hello

    I need query on a table, example: select * from ARF_QUERY "the database used is Oracle. I would like to know if the atg has some
    standard method to make this connection to database and run the SQL of a droplet (select).

    I thank.

    Just found a droplet that takes your sql as input.
    More info on the following link
    http://docs.Oracle.com/CD/E23095_01/platform.93/PageDevGuide/HTML/s1349sqlqueryrange01.html

    I hope this helps!

  • the basic sql question

    Hi all I have a basic sql question
    Watch below two querries
    1.  select 1 from dual where 1 in (select 1 from dual union all select null from dual) 
    
    It gives output  as 1
    
    but below one 
    
    2.   select 1 from dual where 1 not in  (select 2 from dual union all select null from dual)
    
    It gives output as no data found 
    I think as operator will not compare with all the values, but not the outcome it will compare with all values... When comparing with the value null, the result is automatically null

    I'm wrong
    Please help me on this

    and why performance wise in operator is more better than no of?

    Thanks to all in advance

    Thanks for posting your explain plan command

    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3249215828
    
    -----------------------------------------------------------------------------
    | Id  | Operation        | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |          |     2 |     6 |     4   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS    |          |     2 |     6 |     4   (0)| 00:00:01 |
    |   2 |   FAST DUAL      |          |     1 |       |     2   (0)| 00:00:01 |
    |   3 |   VIEW           | VW_NSO_1 |     2 |     6 |     2   (0)| 00:00:01 |
    |   4 |    SORT UNIQUE   |          |     2 |       |     2   (0)| 00:00:01 |
    |   5 |     UNION-ALL    |          |       |       |            |          |
    |   6 |      FAST DUAL   |          |     1 |       |     2   (0)| 00:00:01 |
    |*  7 |      FILTER      |          |       |       |            |          |
    |   8 |       FAST DUAL  |          |     1 |       |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       7 - filter(NULL IS NOT NULL)
    
    02:12:54 SQL> select 1 from dual where 1 not in  (select 2 from dual union all select null from dual);
    Elapsed: 00:00:00.01
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3291682568
    
    -----------------------------------------------------------------
    | Id  | Operation        | Name | Rows  | Cost (%CPU)| Time     |
    -----------------------------------------------------------------
    |   0 | SELECT STATEMENT |      |     1 |     4   (0)| 00:00:01 |
    |*  1 |  FILTER          |      |       |            |          |
    |   2 |   FAST DUAL      |      |     1 |     2   (0)| 00:00:01 |
    |   3 |   UNION-ALL      |      |       |            |          |
    |*  4 |    FILTER        |      |       |            |          |
    |   5 |     FAST DUAL    |      |     1 |     2   (0)| 00:00:01 |
    |   6 |    FAST DUAL     |      |     1 |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------
    
  • How to run multiple sql statements

    Hi all

    I wonder if I can run multiple sql statements in one shot with > >, immediate run

    for example:

    I set the variable as X: = sql statement
    Y: = sql statement
    z: = sql statement

    can I execute immediate (X, Y, Z);

    If yes how? and if not what other possible

    Thank you

    Beginning with the codes of Ganesh

    DECLARE
       l_statement                 VARCHAR2 (2000);
       v_passwd                    VARCHAR2 (200);
       v_username                  VARCHAR2 (200) := 'test';
       v_pwd_key                   VARCHAR2 (200) := 'lwty23';
       v_dblink_name               VARCHAR2 (2000);
       v_dblink_drop               VARCHAR2 (2000);
       v_dblink_create             VARCHAR2 (2000);
       v_dblink_check_connection   VARCHAR2 (2000);
       l_number                    NUMBER;
    BEGIN
       --<>
       FOR c_instance IN (SELECT *
                            FROM v_oracle_instances
                           WHERE environment = 'Developement')
       LOOP
          SELECT encpwd_owner.display_db_encpwd (v_username,
                                                 c_instance.host_name,
                                                 c_instance.instance_name,
                                                 v_pwd_key)
            INTO v_passwd
            FROM DUAL;
    
          v_dblink_name := c_instance.host_name || '_' || c_instance.instance_name;
          v_dblink_create :=
                ' CREATE DATABASE LINK '
             || v_dblink_name
             || ' CONNECT TO '
             || v_username
             || ' '
             || 'IDENTIFIED BY '
             || v_passwd
             || ' USING'
             || ' ''(DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST= '
             || c_instance.host_name
             || ')(PORT='
             || c_instance.LISTENER_PORT
             || '))(CONNECT_DATA=(SID='
             || c_instance.instance_name
             || ')))''';
          v_dblink_check_connection := 'select 1 from global_name@' || v_dblink_name || '.QCM';    --- Notice this change. I am simply selecting 1. That should be enough to test the database link.
          v_dblink_drop := 'drop database link ' || v_dblink_name || '.QCMTLAF';
    
          -- l_statement := 'BEGIN ' || v_dblink_create ';' || v_dblink_check_connection ';' || v_dblink_drop '; END ;'
    
          BEGIN
              EXECUTE IMMEDIATE (v_dblink_create);
              DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Created');
         EXCEPTION
            WHEN others THEN
               dbms_output.put_line( 'Failed to create the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <> );
         END;
    
          EXECUTE IMMEDIATE (v_dblink_check_connection) INTO l_number;    --- Notice this.
    
          DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Tested');
    
          BEGIN
             EXECUTE IMMEDIATE (v_dblink_drop);
             DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Dropped');
          EXCEPTION
             WHEN others THEN
               dbms_output.put_line( 'Failed to drop the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <> );
         END;
       END LOOP;
    END;
    

    But I agree with the comment that others have grown up is not really wise to create and drop a database like that link.

    Justin

  • How to run wfstatus.sql for i-expenses

    How to run wfstatus.sql i-expenses in EBS 11i.

    Select this check box, hope it helps.

    How to find and solve the reports on Internet expenditures within workflow [ID 185004.1]

    How wfstatus.sql to run on a statement of expenses Internet [134895.1 ID]

  • How to run grid sql statements

    Hello

    I would like to run some of the grid control sql statements as tablespace freespace check.

    Grid options could there be to execute the sql statement?

    If so, how to set up the output of the sql for E-mail

    Please I need your suggestion to proceed.

    Version of the grid: 10.2.0.5.0
    Platform: Sun

    Thank you.

    Hello

    no need to run the sql statement of the grid, instead of that you can configure the threshold values.

    for example, if your tablespace capacity 85% complete and then he will send you the email alert that you configured in notifications.

    you will find on the home page - bottom of the page - > manage settings...

    check http://download.oracle.com/docs/cd/B19306_01/server.102/b14196/montune001.htm#CACCIHAB

    http://download.Oracle.com/docs/CD/B19306_01/EM.102/b40002/notification.htm#sthref995

    Thank you

  • How I can run pl/sql express edition? PLSS help me.

    I am trying to run pl/sql statements in oracle 10 g express edition, but it does not work! What can I do? What program can I download to run pl/sql?

    pls help me!

    Thank you.

    Code:
    ---------------------------------------------------------------------------------
    SET SERVEROUTPUT ON

    DECLARE
    v_count NUMBER (2): = 1;
    BEGIN
    LOOP
    DBMS_OUTPUT. Put_line (v_count);
    v_count: = v_count + 2;
    WHEN the EXIT v_count > 10;
    END LOOP;
    END;
    ---------------------------------------------------------------------------------

    Error code:

    ORA-00922: missing or not valid option

    Version:

    Oracle Database 10 g Express Edition Release 10.2.0.1.0 - product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    AMT for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    Published by: user8944100 on 24.Oca.2010 12:31

    Published by: user8944100 on 24.Oca.2010 12:37

    user8944100 wrote:
    by the way that Mr. Alex Nuijten when I fail "set serveroutput on ', it works, is this problem cause :(

    You use SQL Workshop in the APEX, the "SET SERVEROUTPUT ON" is a SQL * more order - which is not included in the workshop of SQL...
    So, Yes, that's your problem... now you can close the message and mark it as answered...

  • Apex SQL question - weeks of the month

    I have a sql question.
    I want to create a dynamic list.

    If the user select may2009, then I want a dynamic list of show

    04/27/2009-05/03/2009
    05/04/2009-05/10/2009
    05/11/2009-05/17/2009
    05/18/2009-05/24/2009
    05/25/2009-05/31/2009

    If the user selects Jun 2009, then the list will be
    06/01/2009-06/07/2009
    06/08/2009-06/14/2009
    06/15/2009-06/21/2009
    06/22/2009-06/28/2009
    06/29/2009-07/05/2009

    Thank you.

    Using this SQL statement, you can get this list:

    SELECT w_start || ' - ' || w_end d, w_start r
      FROM (SELECT     (week_start_list + (LEVEL - 1) * 7) + 1 w_start,
                       week_start_list + (LEVEL) * 7 w_end
                  FROM (SELECT TO_CHAR (TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                               'mm'
                                              ),
                                        'IW'
                                       ) week_begin,
                               TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                      'mm'
                                     ) m_begin,
                               TO_CHAR
                                  (TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'), 'mm'),
                                   'd'
                                  ) day_month_begin,
                               TO_CHAR
                                  (TRUNC (ADD_MONTHS (TO_DATE (:my_date,
                                                               'dd.mm.yyyy'
                                                              ),
                                                      1
                                                     ),
                                          'mm'
                                         ),
                                   'IW'
                                  ) week_end,
                               TRUNC (ADD_MONTHS (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                                  1
                                                 ),
                                      'mm'
                                     ) m_end,
                               TO_CHAR
                                  (TRUNC (ADD_MONTHS (TO_DATE (:my_date,
                                                               'dd.mm.yyyy'
                                                              ),
                                                      1
                                                     ),
                                          'mm'
                                         ),
                                   'd'
                                  ) day_month_end,
                                 TRUNC (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                        'mm'
                                       )
                               - TO_NUMBER
                                          (TO_CHAR (TRUNC (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           'mm'
                                                          ),
                                                    'd'
                                                   )
                                          ) week_start_list,
                                 TRUNC
                                    (ADD_MONTHS (TO_DATE (:my_date, 'dd.mm.yyyy'),
                                                 1
                                                ),
                                     'mm'
                                    )
                               + TO_NUMBER
                                    (TO_CHAR
                                        (TRUNC
                                              (ADD_MONTHS (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           1
                                                          ),
                                               'mm'
                                              ),
                                         'd'
                                        )
                                    )
                               - 1 week_end_list
                          FROM DUAL)
            CONNECT BY LEVEL <=
                          (SELECT   TO_NUMBER
                                       (TO_CHAR
                                           (TRUNC
                                               (ADD_MONTHS (TO_DATE (:my_date,
                                                                     'dd.mm.yyyy'
                                                                    ),
                                                            1
                                                           ),
                                                'mm'
                                               ),
                                            'IW'
                                           )
                                       )
                                  - TO_NUMBER
                                          (TO_CHAR (TRUNC (TO_DATE (:my_date,
                                                                    'dd.mm.yyyy'
                                                                   ),
                                                           'mm'
                                                          ),
                                                    'IW'
                                                   )
                                          )
                             FROM DUAL))
    

    It is a question of SQL and has nothing to do with the Apex.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for