Table name in from clause

Hi Gurus,
Each day I am creating a table dynamically and the table name is stored in log table.
End of the day I want to see that tables data(want to create a report based on that table).
select * from (
select table_name from my_log
where created_on=sysdate and table_name like '%sunil%');
As we know, it will not work in sql, and I dont want to use plsql.
Is there any way to get my requirements only using sql.
Thanks,
Sunil

Sunil Jena wrote:
Each day I am creating a table dynamically and the table name is stored in log table.Not the best of options. If you have purchased the Partitioning Option, use that instead. If not - give serious consideration to getting it as it is worth every cent.
End of the day I want to see that tables data(want to create a report based on that table).
select * from (
select table_name from my_log
where created_on=sysdate and table_name like '%sunil%');Not possible like that.
It can be done using a pipeline table functions. Which would be the wrong choice IMO.
A better option would be a partitioned view. This feature has been introduced with Oracle 7.3 I think it was. It supports partition-like pruning and enables you to have a view on several tables, but only the relevant table being hit for the actual query.
Here's an example on 11.2.0.2. Note how the CBO uses the filter condition NULL is not NULL to remove no-relevant tables from the query.
SQL> declare
  2          tabName         varchar2(30);
  3          nameList        TStrings;
  4          pviewSql        varchar2(32767);
  5 
  6          procedure W( line varchar2 ) is
  7          begin
  8                  DBMS_OUTPUT.put_line( nvl(line,chr(10) ) );
  9          end;
10 
11          procedure ExecSQL( sqlStmnt varchar2 ) is
12          begin
13                  W( 'SQL> '||sqlStmnt );
14                  W( '' );
15                  execute immediate sqlStmnt;
16          exception when OTHERS then
17                  W( SQLERRM(SQLCODE) );
18          end;
19  begin
20          --// need to create some sample tables - will grab dictionary objects from
21          --// the following schemas to populate the sample tables
22          nameList := new TStrings( 'XDB','SYS','BILLY','APEX_040100','FLOWS_FILES' );
23 
24          --// format of the sampe table, e.g. TAB_1
25          tabName := 'TAB_%n';
26 
27          --// drop the sample table if exists
28          for i in 1..nameList.Count loop
29                  ExecSQL( 'drop table '||replace(tabName,'%n',i)||' purge' );
30          end loop;
31 
32          --// create the sample tables
33          for i in 1..nameList.Count loop
34                  ExecSQL(
35  'create table '||replace(tabName,'%n',i)||'(
36          object_id primary key,
37          object_owner not null check(object_owner='''||nameList(i)||'''),
38          object_type not null,
39          object_name not null
40  )
41  nologging as
42  select
43          object_id,
44          owner,
45          object_type,
46          object_name
47  from       all_objects
48  where      owner = '''||nameList(i)||''''
49                  );
50          end loop;
51 
52          --// create the partition view
53          pviewSql := 'create or replace view PVIEW_TAB as ';
54          for i in 1..nameList.Count loop
55                  pviewSQL := pviewSQL || 'select * from '||replace(tabName,'%n',i);
56                  if i < nameList.Count then
57                          pviewSQL := pviewSQL || ' union all ';
58                  end if;
59          end loop;
60 
61          ExecSQL( pviewSQL );
62  end;
63  /
SQL> drop table TAB_1 purge
SQL> drop table TAB_2 purge
SQL> drop table TAB_3 purge
SQL> drop table TAB_4 purge
SQL> drop table TAB_5 purge
SQL> create table TAB_1(
        object_id primary key,
        object_owner not null check(object_owner='XDB'),
        object_type not null,
        object_name not null
nologging
as
select
        object_id,
        owner,
        object_type,
        object_name
from    all_objects
where   owner = 'XDB'
SQL> create table TAB_2(
        object_id primary key,
        object_owner not null check(object_owner='SYS'),
        object_type not null,
        object_name not null
nologging
as
select
        object_id,
        owner,
        object_type,
        object_name
from    all_objects
where   owner = 'SYS'
SQL> create table TAB_3(
        object_id primary key,
        object_owner not null check(object_owner='BILLY'),
        object_type not null,
        object_name not null
nologging
as
select
        object_id,
        owner,
        object_type,
        object_name
from    all_objects
where   owner = 'BILLY'
SQL> create table TAB_4(
        object_id primary key,
        object_owner not null check(object_owner='APEX_040100'),
        object_type not null,
        object_name not null
nologging
as
select
        object_id,
        owner,
        object_type,
        object_name
from    all_objects
where   owner = 'APEX_040100'
SQL> create table TAB_5(
        object_id primary key,
        object_owner not null check(object_owner='FLOWS_FILES'),
        object_type not null,
        object_name not null
nologging
as
select
        object_id,
        owner,
        object_type,
        object_name
from    all_objects
where   owner = 'FLOWS_FILES'
SQL> create or replace view PVIEW_TAB as select * from TAB_1 union all select * from TAB_2 union all select * from TAB_3 union all select * from TAB_4 union all select * from TAB_5
PL/SQL procedure successfully completed.
SQL>
SQL> set autotrace on explain
SQL> --// example of using the partition view, but querying only a single table in it
SQL> select count(*) from pview_tab where object_owner = 'BILLY' and object_type = 'TABLE';
  COUNT(*)
        27
Execution Plan
Plan hash value: 3160219530
| Id  | Operation             | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT      |           |     1 |    28 |     3   (0)| 00:00:01 |
|   1 |  SORT AGGREGATE       |           |     1 |    28 |            |          |
|   2 |   VIEW                | PVIEW_TAB |    31 |   868 |     3   (0)| 00:00:01 |
|   3 |    UNION-ALL          |           |       |       |            |          |
|*  4 |     FILTER            |           |       |       |            |          |
|*  5 |      TABLE ACCESS FULL| TAB_1     |     1 |    28 |     3   (0)| 00:00:01 |
|*  6 |     FILTER            |           |       |       |            |          |
|*  7 |      TABLE ACCESS FULL| TAB_2     |     2 |    56 |    51   (2)| 00:00:01 |
|*  8 |     TABLE ACCESS FULL | TAB_3     |    27 |   756 |     3   (0)| 00:00:01 |
|*  9 |     FILTER            |           |       |       |            |          |
|* 10 |      TABLE ACCESS FULL| TAB_4     |     1 |    28 |     3   (0)| 00:00:01 |
|* 11 |     FILTER            |           |       |       |            |          |
|* 12 |      TABLE ACCESS FULL| TAB_5     |     1 |    28 |     2   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   4 - filter(NULL IS NOT NULL)
   5 - filter("OBJECT_OWNER"='BILLY' AND "OBJECT_TYPE"='TABLE')
   6 - filter(NULL IS NOT NULL)
   7 - filter("OBJECT_OWNER"='BILLY' AND "OBJECT_TYPE"='TABLE')
   8 - filter("OBJECT_OWNER"='BILLY' AND "OBJECT_TYPE"='TABLE')
   9 - filter(NULL IS NOT NULL)
  10 - filter("OBJECT_OWNER"='BILLY' AND "OBJECT_TYPE"='TABLE')
  11 - filter(NULL IS NOT NULL)
  12 - filter("OBJECT_OWNER"='BILLY' AND "OBJECT_TYPE"='TABLE')
Note
   - dynamic sampling used for this statement (level=2)
SQL> select count(*) from pview_tab where object_owner = 'SYS' and object_type = 'TABLE';
  COUNT(*)
        33
Execution Plan
Plan hash value: 1404131350
| Id  | Operation             | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT      |           |     1 |    28 |    51   (2)| 00:00:01 |
|   1 |  SORT AGGREGATE       |           |     1 |    28 |            |          |
|   2 |   VIEW                | PVIEW_TAB |    15 |   420 |    51   (2)| 00:00:01 |
|   3 |    UNION-ALL          |           |       |       |            |          |
|*  4 |     FILTER            |           |       |       |            |          |
|*  5 |      TABLE ACCESS FULL| TAB_1     |     1 |    28 |     3   (0)| 00:00:01 |
|*  6 |     TABLE ACCESS FULL | TAB_2     |    11 |   308 |    51   (2)| 00:00:01 |
|*  7 |     FILTER            |           |       |       |            |          |
|*  8 |      TABLE ACCESS FULL| TAB_3     |     1 |    28 |     3   (0)| 00:00:01 |
|*  9 |     FILTER            |           |       |       |            |          |
|* 10 |      TABLE ACCESS FULL| TAB_4     |     1 |    28 |     3   (0)| 00:00:01 |
|* 11 |     FILTER            |           |       |       |            |          |
|* 12 |      TABLE ACCESS FULL| TAB_5     |     1 |    28 |     2   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   4 - filter(NULL IS NOT NULL)
   5 - filter("OBJECT_OWNER"='SYS' AND "OBJECT_TYPE"='TABLE')
   6 - filter("OBJECT_OWNER"='SYS' AND "OBJECT_TYPE"='TABLE')
   7 - filter(NULL IS NOT NULL)
   8 - filter("OBJECT_OWNER"='SYS' AND "OBJECT_TYPE"='TABLE')
   9 - filter(NULL IS NOT NULL)
  10 - filter("OBJECT_OWNER"='SYS' AND "OBJECT_TYPE"='TABLE')
  11 - filter(NULL IS NOT NULL)
  12 - filter("OBJECT_OWNER"='SYS' AND "OBJECT_TYPE"='TABLE')
Note
   - dynamic sampling used for this statement (level=2)
SQL> select count(*) from pview_tab where object_type = 'TABLE';
  COUNT(*)
        78
Execution Plan
Plan hash value: 1006798202
| Id  | Operation            | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT     |           |     1 |    11 |    62   (2)| 00:00:01 |
|   1 |  SORT AGGREGATE      |           |     1 |    11 |            |          |
|   2 |   VIEW               | PVIEW_TAB |    57 |   627 |    62   (2)| 00:00:01 |
|   3 |    UNION-ALL         |           |       |       |            |          |
|*  4 |     TABLE ACCESS FULL| TAB_1     |    17 |   187 |     3   (0)| 00:00:01 |
|*  5 |     TABLE ACCESS FULL| TAB_2     |    11 |   121 |    51   (2)| 00:00:01 |
|*  6 |     TABLE ACCESS FULL| TAB_3     |    27 |   297 |     3   (0)| 00:00:01 |
|*  7 |     TABLE ACCESS FULL| TAB_4     |     1 |    11 |     3   (0)| 00:00:01 |
|*  8 |     TABLE ACCESS FULL| TAB_5     |     1 |    11 |     2   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   4 - filter("OBJECT_TYPE"='TABLE')
   5 - filter("OBJECT_TYPE"='TABLE')
   6 - filter("OBJECT_TYPE"='TABLE')
   7 - filter("OBJECT_TYPE"='TABLE')
   8 - filter("OBJECT_TYPE"='TABLE')
Note
   - dynamic sampling used for this statement (level=2)
SQL> set autotrace offPartition views are no longer actively supported. It could be removed in future Oracle versions. However, it is a useful and existing feature, that is worth considering in some cases.

Similar Messages

  • How to pass Temp variable value instead of Table name in From clause.

    Hi,
    I have an requirement to pass the Temperorary variable value instead of Table name in FROM Clause in SQL.
    But I am strugglint to pass this variable value.
    E.g., a Varchar2(5) := 'aa';
    Select * from a;
    Here I come to mention a - 'aa'. But the SQL looks for 'a' as Table. But its should look into 'aa' as Table name.
    Kindly guide me.
    Thanks.

    SQL> declare
      a     varchar2 (5) := 'emp';
      v     varchar2 (100);
      cur   sys_refcursor;
    begin
      open cur for 'Select ename from ' || a;
      fetch cur into v;
      while cur%found
      loop
        dbms_output.put_line (v);
        fetch cur into v;
      end loop;
      close cur;
    end;
    JAMES
    SCOTT
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    KING
    TURNER
    ADAMS
    FORD
    MILLER
    PL/SQL procedure successfully completed.

  • *Dynamic* Table Name in From Clause with input from cursor

    Hello
    I have a cursor say...
    select table_name from dba_tables where <blah>
    The result is
    row1:: emp
    rwo2:: emp_1 ---> Both the tables have same structure and entirely different data... please dont ask why... that's the way it is and we cant change it..
    Now we need to run an Insert...
    insert into tableX (col1,col2,...) select a,b,... from <o/p of the cursor> where <blah> ...
    Note: The table name changes and it the cursor can o/p emp,emp_a and emp_b.
    Am looking to do it parallel instead of doing it serially and with best performance ....no sql injection issues.
    By parallel i mean
    insert into tableX (col1,col2,...) select a,b,... from emp where <blah>
    and insert into tableX (col1,col2,...) select a,b,... from emp_1 where <blah> statements to fire parallel/at the same time to the database. If you can share procedure if you guys already have with you.. is really appreciated
    Thanks a lot for your time....
    Edited by: user007009 on Apr 27, 2013 8:33 PM

    Hello thanks for your time..
    I tried to implement the chunk by sql parallel execution approach and it took 3.1 seconds to complete.. while the SP took around 0.042 seconds and the parallel process didn't throwed any errors and it didn't insert any data either... I am not sure what I am doing wrong... can you please let me know your thoughts...
    Sample Data Creation::::::::::::::*
    drop table table_ASERCARE purge;
    drop table table_MEDCARE purge;
    DROP TABLE TABLE_XYCARE PURGE;
    DROP TABLE TABLE_TIME PURGE;
    DROP TABLE TABLE_LOCATION PURGE;
    drop table table_group purge;
    drop table tablex purge;
    -- select distinct TABLE_NAME from ALL_TAB_COLS where TABLE_NAME like 'EMP%';
    create table table_asercare (time number(30), location_number number(5), value number(5),catg_id number(5));
    insert into table_asercare values  (20110111, 01, 55, 1200);
    insert into table_asercare values  (20110131, 01, 31, 1223);
    insert into table_asercare values  (20120131, 15, 24,1224);
    insert into table_ASERCARE values  (20130131, 03, 555,1200);
    -- Truncate table table_MEDCARE
    create table table_medcare (time number(30), location_number number(5), value number(5),catg_id number(5));
    insert into table_medcare values  (20110113, 01, 23, 1200);
    insert into table_medcare values  (20110128, 02, 78, 1223);
    insert into table_medcare values  (20110130, 03, 100, 1224);
    insert into table_medcare values  (20120111, 04, 57, 1200);
    insert into table_medcare values  (20120221, 05, 64, 1223);
    insert into table_MEDCARE values  (20130321, 15, 48, 1224);
    create table table_xycare (time number(30), location_number number(5), value number(5),catg_id number(5));
    insert into table_xycare values  (20100113, 01, 99, 1200);
    insert into table_xycare values  (20110128, 02, 90, 1223);
    insert into table_XYCARE values  (20130128, 03, 24, 1224);
    create table table_LOCATION ( LOCATION_NUMBER number(5), LOCATION_NAME varchar2(50));
    insert into table_LOCATION values  (01, 'atlanta1');
    insert into table_LOCATION values  (02, 'atlanta2');
    insert into table_LOCATION values  (03, 'atlanta3');
    insert into table_LOCATION values  (04, 'atlanta4');
    insert into table_LOCATION values  (05, 'atlanta5');
    insert into table_location values  (15, 'atlanta15');
    create table table_category (catg_id number(5), catg_name varchar2(30));
    insert into table_category values (1200, 'EMS');
    insert into table_category values (1223, 'LJM');
    insert into table_category values (1224, 'LIO');
    create table table_TIME (YEAR_MONTH_DATE number(30), YEAR_VAL number(4), MONTH_VAL number(2),DATE_VAL number(2));
    insert into table_TIME values  (20110111, 2011, 01,11 );
    insert into table_TIME values  (20110131, 2011, 01,31);
    insert into table_TIME values  (20120131, 2012, 01,31);
    insert into table_TIME values  (20130131, 2013, 01,31);
    insert into table_TIME values  (20110128, 2011, 01,28 );
    insert into table_TIME values  (20110130, 2011, 01,30 );
    insert into table_TIME values  (20120111, 2012, 01,11 );
    insert into table_TIME values  (20120221, 2012, 02,21 );
    insert into table_TIME values  (20130321, 2013, 03,21 );
    insert into table_TIME values  (20100113, 2010, 01,13 );
    insert into table_TIME values  (20130128, 2013, 01,28 );
    --Truncate table table_group
    CREATE TABLE table_group (group_key number,table_name VARCHAR2(30), group_name VARCHAR2(30), catg_name varchar2(30));
    insert into table_group values (1,'table_ASERCARE', 'GROUP_ONE','EMS');
    insert into table_group values (2,'table_MEDCARE', 'GROUP_ONE','LJM');
    INSERT INTO TABLE_GROUP VALUES (3,'table_XYCARE', 'GROUP_TWO','LIO');
    create table TABLEX (YEAR_VAL number(4) ,LOCATION_NAME varchar2(50),tablename VARCHAR2(30), cnt number ); --> Proc data will be inserted into this...
    Stored Procedure++++++++_
    CREATE OR REPLACE
    PROCEDURE ABC(
        GROUP_NAME_IN IN VARCHAR2 )
    is
    type c1 is ref cursor;
        sql_stmt VARCHAR2(200);
        v_sql    VARCHAR2(30000);
        c1_cv c1;
        table_name_f VARCHAR2(30);
        c1_rec TABLE_GROUP%rowtype;
      BEGIN
        SQL_STMT := 'SELECT * FROM TABLE_GROUP WHERE GROUP_NAME = :i';
        OPEN c1_cv FOR SQL_STMT USING GROUP_NAME_IN ;
        loop
          fetch c1_cv  INTO c1_rec;
        exit when c1_cv%notfound;
    --    forall i in c1_rec.FIRST ..c1_rec.last loop
        table_name_f := c1_rec.table_name;
    --      END LOOP;
       EXECUTE immediate
       'INSERT  INTO tablex (YEAR_VAL,LOCATION_NAME, tablename, cnt)
    SELECT
    t.YEAR_VAL,l.location_name, :table_name, count(*) as cnt
    FROM '
        ||table_name_f||
        ' variable_table
    ,table_time t
    , table_location l
    ,table_group g
    ,table_category ctg
    WHERE t.year_month_date = variable_table.TIME
    and variable_table.location_number = l.location_number
    and ctg.catg_id = variable_table.catg_id
    --and ctg.catg_name = g.catg_name
    GROUP BY t.YEAR_VAL,l.location_name,g.catg_name' USING table_name_f;
        --dbms_output.put_line ( 'The SQL is'|| v_sql);
        COMMIT;
        --dbms_output.put_line ( c1_rec.table_name||','||c1_rec.group_name );
        --dbms_output.put_line ( 'The table name is '|| c1_rec.table_name );
      end loop;
        CLOSE c1_cv;
      --null;
    END ABC;
    Parallel Execution Code++++++++++_
    begin
    begin
    DBMS_PARALLEL_EXECUTE.DROP_TASK(task_name => 'TASK_NAME');
    exception when others then null;
    end;
    DBMS_PARALLEL_EXECUTE.CREATE_TASK(task_name => 'TASK_NAME');
    DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_SQL(task_name => 'TASK_NAME', sql_stmt =>'select distinct group_key, group_key from table_group', by_rowid => false);
    end;
    begin
    DBMS_PARALLEL_EXECUTE.RUN_TASK (task_name => 'TASK_NAME',
    sql_stmt =>'declare
    s varchar2(16000); vstart_id number := :start_id; vend_id number:= :end_id;
    table_name varchar2(30);
    begin
    select table_name into table_name from group_table where group_key=vstart_id;
    s:=''INSERT  INTO tablex (YEAR_VAL,LOCATION_NAME, tablename, cnt)
    SELECT
    t.YEAR_VAL,l.location_name, :table_name, count(*) as cnt
    FROM ''||table_name||'' variable_table
    ,table_time t
    , table_location l
    ,table_group g
    ,table_category ctg
    WHERE t.year_month_date = variable_table.TIME
    and variable_table.location_number = l.location_number
    and ctg.catg_id = variable_table.catg_id
    and ctg.catg_name = g.catg_name
    and g.group_key =:vstart_id
    GROUP BY t.YEAR_VAL,l.location_name,g.catg_name'';
    execute immediate s using vstart_id;
    commit;
    end;',
    language_flag => DBMS_SQL.NATIVE, parallel_level => 2 );
    end;
    / thanks in advance for your time.
    Edited by: user007009 on Apr 28, 2013 12:25 PM

  • Dynamic table name in FROM clause of an abap native sql statement

    Hi Frenz,
    Kindly help me with the solution. Thank you.
    data: tabname type string.
    tabname = 'CRMD_ORDERADM_H'.
    EXEC SQL.
      SELECT count( * )
             FROM tabname into :count
    ENDEXEC.
    This piece of the code is giving me a dump. Kindly let me know how can i use tabname in this context. It is a parameter on the selection screen.
    Thank you,
    Kamal
    Edited by: Rob Burbank on May 20, 2009 10:02 AM

    Hi
    try using ( )
    EXEC SQL.
    SELECT count( * )
    FROM ( tabname ) into :count
    ENDEXEC.
    hope this helps!
    haven't tested it in from section but it worked for me in where section
    regards jacko
    Edited by: Jacko1986 on May 20, 2009 3:55 PM

  • Is it possible to create a view where table in the From clause changes name

    is it possible to create a view from a from a table like this
    create view my_view as select id, col1, col2, result from <<my_latest_cacahe_table>>;
    the table in the from clause changes the name .
    I have another table which indicates the the latest name of my cache tables. Always there are two records there. The latest one and previous one.
    select * from cache_table_def
    table_name cache_table_name refresh_date
    my_table cache_table245 1/23/2012
    my_table cache_table235 1/22/2012
    create table cache_table_def (table_name varchar2(25), cache_table_name varchar2(25), refresh_date date);
    insert into cache_table_def values( 'my_table','cache_table245','23-jan-2012');
    insert into cache_table_def values ( 'my_table','cache_table546','22-jan-2012');
    create table cache_table245 (id number, col1 varchar2(50), col2 varchar2(20), result number);
    insert into cache_table245 values(1, 'test123', 'test345',12.12);
    insert into cache_table245 values (2, 'test223', 'test245',112.12);
    create table cache_table235 (id number, col1 varchar2(50), col2 varchar2(20), result number);
    insert into cache_table235 values (1, 'test123', 'test345',92.12);
    insert into cache_table235 values (2, 'test223', 'test245',222.12);
    what I need to do is find the latest cache_table name for my_table and use that in my view defintion
    When user select from the the view it always reurns the data from the latest cache_table
    is it possible to do something like this in oracle 11g?
    I have no control on the cache tables names. that is why I need to use the latest name from the table.
    Any ideas really appreciated.

    I've worked up an example that does what you ask. It uses the SCOTT schema EMP table. Make two copies of the EMP table, EMP1 and EMP2. I deleted dept 20 from emp1 and deleted dept 30 from emp2 so I could see that the result set really came from a different table.
    -- create a context to hold an environment variable - this will be the table name we want the view to query from
    create or replace context VIEW_CTX using SET_VIEW_FLAG;
    -- create the procedure specified for the context
    - we will pass in the name of the table to query from
    create or replace procedure SET_VIEW_FLAG ( p_table_name in varchar2 default 'EMP')
      as
      begin
          dbms_session.set_context( 'VIEW_CTX', 'TABLE_NAME', upper(p_table_name));
      end;
    -- these are the three queries - one for each table - none of them will return data until you set the context variable.
    select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
    select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' );
    select * from emp2 where 'EMP2' =  sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    -- this is how you set the context variable depending on the table you want the view to query
    exec set_view_flag( p_table_name => 'EMP' );
    exec set_view_flag( p_table_name => 'EMP1' );
    exec set_view_flag( p_table_name => 'EMP2');
    -- this will show you the current value of the context variable
    SELECT sys_context( 'VIEW_CTX', 'TABLE_NAME' ) FROM DUAL
    -- this is the view definition - it does a UNION ALL of the three queries but only one will actually return data
    CREATE VIEW THREE_TABLE_EMP_VIEW AS
    select * from emp where 'EMP' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    union all
    select * from emp1 where 'EMP1' = sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    union all
    select * from emp2 where 'EMP2' =  sys_context( 'VIEW_CTX', 'TABLE_NAME' )
    -- first time - no data since context variable hasn't been set yet
    SELECT * FROM THREE_TABLE_EMP_VIEW
    -- get data from the EMP table
    exec set_view_flag( p_table_name => 'EMP' );
    SELECT * FROM THREE_TABLE_EMP_VIEW
    -- get data from the EMP2 table
    exec set_view_flag( p_table_name => 'EMP2');
    SELECT * FROM THREE_TABLE_EMP_VIEW
    For your use case you just have to call the context procedure whenever you want to switch tables. You can union all as many queries as you want and can even put WHERE clause conditions based on other filtering criteria if you want. I have used this approach with report views so that one view can be used to roll up report data different ways or for different regions, report periods (weekly, quarterly, etc). I usually use this in a stored procedure that returns a REF CURSOR to the client. The client requests a weekly report and provides a date, the procedure calculates the START/END date based on the one date provided and sets context variables that the view uses in the WHERE clause for filtering.
    For reporting it works great!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Two variables in the name of a table in the FROM clause.

    Hello,
    I ve got a problem making this work:
    SELECT *
    FROM tablename_YY_MM
    (This is part of the script I need to use YY and MM in various tables)
    I need to find a way so the script will ask me every time about the YY and MM
    For example the current table name is "tablename_09_08" next month it will be "tablename_09_09"
    It looks simple but I can't make it work. It seems to be a problem with concatanation || and the underscore _
    Looks like it should be done with PL/SQL ?
    If anyone can help it will be much appreciated.
    Thank you.
    Edited by: user1067236 on Aug 11, 2009 2:21 AM
    Edited by: user1067236 on Aug 11, 2009 2:23 AM

    Hi,
    That's easy to do using substitution variables in SQL*Plus:
    SELECT  *
    FROM    tablename_&year_num._&month_num;Note the . after &year_num; it is necessary to indicate that the next _ is not part of the preceding name.
    You can also use the SQL*Plus ACCEPT command to prompt the user for values, with a detailed message.
    ACCEPT  year_num  PROMPT "Please enter year number (2 digits only, such as 09): "Edited by: Frank Kulash on Aug 11, 2009 5:29 AM

  • Have tables names changed from CF6/7 to CF 8/9?

    <<Edit>>I might have just answered my question, sort of.  I had already exported the data from the hosted SQL 2000 DB to my local SQL 2000 DB and then backed up and restored it to an empty DB in SQL 2008 Express.  The tables have the dbo. prefix instead of the "xx." prefix in the other DB which went from SQL 2000 to SQL 2008.  The site runs with the dbo. prefix.  Any links to articles/videos/summaries of simple differences between version still appreciated."<</Edit>>
    I built a CF6/7 based site about 5 years ago and I'm trying to move it to the current versions of MSSQL (2008R2 Express) and CF9.  I believe the SQL DB is fine, I have setup the site on the local server, and am getting the following error when trying to view a page that access the DB.
    [Macromedia][SQLServer JDBC  Driver][SQLServer]Invalid object name 'client_info'.
    I exported the DB data from the live DB server into my local SQL 2008 Express and tables now have names like "xx.client_info"  Is it correct to assume that this is a new naming convention so that you can access easily access tables in multiple DBs?  Would I simply need to rename the tables to exclude the "xx." at the begining?  Or would it be advised to export the data into SQL 2000 and then backup/restore the DB to SQL 2008 Express?
    Thanks for any help, and if there's a video or link to simple differences/improvements in CF from 6/7 to 8/9 any link would be greatly appreciated.

    It's not CF-related, it's a SQLServer thing. In SQL 2008 they introduced the concept of Schemas, which I think is what you're seeing here. Rather than dbo.tablename, you now have schema.tablename.
    I don't know the details to be honest, but that's what you need to be looking at.
    O.

  • How to use PL/SQL type table in SQL FROM clause

    Hi All,
    I have to use a PL/SQL type table in our SQL statement as a table?
    I am using the syntax (below) but it gives PL/SQL: ORA-00902: invalid datatype
    SELECT ... FROM TABLE(CAST( var_pl/sql_table AS pl/sql_table)) tab WHERE tab.a=1;
    Plz reply with an example.
    Thanks.. Ratan

    You don't need a cast!!!
         select *
         from table ( <nested_table> )
         where <condition>Anyway, are you sure that tab.a is a number?
    Here follows an example with an useful function
    CREATE OR REPLACE
    type string_table  as table of varchar2(4000)
    CREATE OR REPLACE
    FUNCTION split_string (
         string IN varchar2,
         delimiter IN varchar2
    ) RETURN  string_table IS
         tab string_table;
         pre integer;
         post integer;
         step integer;
         i integer;
    BEGIN
         pre := 1;
         step := length(delimiter);
         i := 0;
         tab := string_table();
         loop
              tab.extend;
              i := i + 1;
              post := instr(string,delimiter,pre);
              if ( post = 0 ) then
                   tab(i) := substr(string,pre);
                   return tab;
              end if;
              tab(i) := substr(string,pre,post-pre);
              pre := post + step;
         end loop;
    END;
    select * from table (split_string('abc,dfg,hij',','))
    Query finished, retrieving results...
                                      COLUMN_VALUE                                  
    abc                                                                             
    dfg                                                                             
    hij                                                      

  • Parse SQL: How to extract column names, table names from a SQL query

    Hi all,
    I have a requirement wherein a SQL query will be given in a text file.
    The text file has to be read (probably using text_io package), the SQL query needs to be parsed and the column names, table names and where clauses have to be extracted and inserted into separate tables.
    Is there a way to do it using PL/SQL ?
    Is there a PL/SQL script available to parse and extract column names, table names etc ?
    Pls help.
    Regards,
    Sam

    I think I jumped to conclusion too early saying it is completely possible and straight forward. But after reading through your post for one more time I realised you are not interested only in the column_names, also the table_names and the predicates .
    >
    SQL query needs to be parsed and the column names
    >
    The above is possible and straight forward using the dbms_sql package.
    I am pasting the same information as I did in the other forum.
    Check this link and search for Example 8 and .
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sql.htm#sthref6136
    Also check the working example from asktom
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1035431863958
    >
    table names and where clauses have to be extracted
    >
    Now this is the tricky bit. You can extract the list of tables by getting the sql_id from v$sql and joining it with v$sql_plan. But sometimes you may not get all the results because the optimizer may choose to refine your query (check this link)
    http://optimizermagic.blogspot.com/2008/06/why-are-some-of-tables-in-my-query.html
    and you can get the predicate information from the same table v$sql_plan but I will leave that area for you to do some R&D.
    Regards
    Raj
    Edited by: R.Subramanian on Dec 10, 2008 3:14 AM

  • Order of tables in the form clause influences query performance? (ora 9i)

    Hi,
    I have a SQL select with 5 tables in the 'from' clause. On Oracle 9i (and 8i too) if I user a certain table order (bigger tables first, smaller tables last) the query executes fast. If I change the order, then it executes in slow motion. I use cost based optimizing.
    I thought it was just Oracle 8i where I had to take into account such things when writing a query. Does some one know the cause for this? I
    Regards,
    Tamas Szecsy

    And, even in 10GR2, if the optimizer_mode is changed to CHOOSE (the default is ALL_ROWS), the optimizer defaults to RULE based:
    SQL> show parameter optimizer_mode
    NAME                                 TYPE        VALUE
    optimizer_mode                       string      ALL_ROWS
    SQL> alter session set optimizer_mode = choose ;
    Session altered.
    SQL> show parameter optimizer_mode
    NAME                                 TYPE        VALUE
    optimizer_mode                       string      CHOOSE
    SQL> analyze table emp delete statistics ;
    Table analyzed.
    SQL> analyze table dept delete statistics ;
    Table analyzed.
    SQL> set autotrace traceonly explain
    SQL> select e.*, d.* from emp e, dept d where d.deptno = e.deptno (+) ;
    Execution Plan
    Plan hash value: 748780195
    | Id  | Operation                    | Name           |
    |   0 | SELECT STATEMENT             |                |
    |   1 |  NESTED LOOPS OUTER          |                |
    |   2 |   TABLE ACCESS FULL          | DEPT           |
    |   3 |   TABLE ACCESS BY INDEX ROWID| EMP            |
    |*  4 |    INDEX RANGE SCAN          | IDX_EMP_DEPTNO |
    Predicate Information (identified by operation id):
       4 - access("D"."DEPTNO"="E"."DEPTNO"(+))
    Note
       - rule based optimizer used (consider using cbo)
    SQL> analyze table emp compute statistics for table for all indexes for all indexed columns ;
    Table analyzed.
    SQL> analyze table dept compute statistics for table for all indexes for all indexed columns ;
    Table analyzed.
    SQL> select e.*, d.* from emp e, dept d where d.deptno = e.deptno (+) ;
    Execution Plan
    Plan hash value: 748780195
    | Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                |    14 |   826 |     4   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS OUTER          |                |    14 |   826 |     4   (0)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL          | DEPT           |     4 |    76 |     3   (0)| 00:00:01 |
    |   3 |   TABLE ACCESS BY INDEX ROWID| EMP            |     4 |   160 |     1   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | IDX_EMP_DEPTNO |     5 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("D"."DEPTNO"="E"."DEPTNO"(+))
    SQL> alter session set optimizer_mode = rule ;
    Session altered.
    SQL> select e.*, d.* from emp e, dept d where d.deptno = e.deptno (+) ;
    Execution Plan
    Plan hash value: 748780195
    | Id  | Operation                    | Name           |
    |   0 | SELECT STATEMENT             |                |
    |   1 |  NESTED LOOPS OUTER          |                |
    |   2 |   TABLE ACCESS FULL          | DEPT           |
    |   3 |   TABLE ACCESS BY INDEX ROWID| EMP            |
    |*  4 |    INDEX RANGE SCAN          | IDX_EMP_DEPTNO |
    Predicate Information (identified by operation id):
       4 - access("D"."DEPTNO"="E"."DEPTNO"(+))
    Note
       - rule based optimizer used (consider using cbo)
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL>

  • ORA-32031: illegal reference of a query name in WITH clause

    Oracle tutorial : http://www.oracle.com/technology/pub/articles/hartley-recursive.html#4
    When Executing this Query 6: Using a Recursive WITH Clause
    WITH C (CNO, PCNO, CNAME) AS
    (SELECT CNO, PCNO, CNAME -- initialization subquery
    FROM COURSEX
    WHERE CNO = 'C22' -- seed
    UNION ALL
    SELECT X.CNO, X.PCNO, X.CNAME -- recursive subquery
    FROM C, COURSEX X
    WHERE C.PCNO = X.CNO)
    SELECT CNO, PCNO, CNAME
    FROM C;
    Error: ORA-32031: illegal reference of a query name in WITH clause
    kindly suggest what need to do in case of recursion using subquery

    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  with c as
      2  (
      3  select empno,ename from emp
      4  where deptno=20
      5  union all
      6  select c.empno,c.ename from emp c
      7  where c.deptno=30
      8  )
      9* select * from c
    SCOTT@orcl> /
         EMPNO ENAME
          7566 xx
          7788 xx
          7876 xx
          7902 xx
          7499 xx
          7521 xx
          7654 xx
          7698 xx
          7844 xx
          7900 xx
    10 rows selected.
    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  with emp as
      2  (
      3  select empno,ename from emp
      4  where deptno=20
      5  union all
      6  select c.empno,c.ename from emp c
      7  where c.deptno=30
      8  )
      9* select * from emp
    SCOTT@orcl> /
    select empno,ename from emp
    ERROR at line 3:
    ORA-32031: illegal reference of a query name in WITH clause
    SCOTT@orcl>You can not use the same table name alongwith WITH clause's cursor name. See as above if i says with C as... its works; but if i says with emp as... it returned ora-32031, because it is the name of table.
    HTH
    Girish Sharma

  • SQL Issue in FROM CLAUSE

    It is possible changed the SQL statement below to repeat only once USUARIO table in the FROM clause ?
    SELECT U_PEND.NOME AS USUARIO_PEND
         , U_DECLINADO.NOME AS USUARIO_DECLINADO
         , U_REVISADO.NOME AS USUARIO_REENVIADO
         , U_EMITIDO.NOME AS USUARIO_EMITIDO
         , U_CANCELADO.NOME AS USUARIO_CANCELADO
         , U_RECEBIDO.NOME AS USUARIO_RECEBIDO
         , PP.NUMERO AS NUMERO_PROPOSTA
         , C.CODIGO AS COOPERATIVA
         , S.NOME AS SEGURADORA
         , P.NOME AS PRODUTO_NOME
         , GL.DATA_ENVIO AS DATA_ENVIO
         , PP.OID_MOTIVO_DECLINIO AS OID_MOTIVO_DECLINIO
         , MD.DESCRICAO AS DESCRICAO_MOTIVO_DECLINIO
         , SUBSTR(PA.CODIGO, 6, 2) AS CODIGO_PONTO_ATENDIMENTO
         , PD.NOME_DOCUMENTO
         , PS.OID
      FROM SIS_OWNER.SEGURADORA S
         , PRODUTO P
         , PRODUTO_SEGURADORA PS
         , USUARIO U_PEND
         , USUARIO U_DECLINADO
         , USUARIO U_REVISADO
         , USUARIO U_EMITIDO
         , USUARIO U_CANCELADO
         , USUARIO U_RECEBIDO
         , GERACAO_LOTE GL
         , COOPERATIVA C
         , MOTIVO_DECLINIO MD
         , PONTO_ATENDIMENTO PA
         , PROTOCOLO_DOCUMENTO PD
         , PROTOCOLO_PROPOSTA PP
    WHERE PP.OID_PRODUTO_SEGURADORA = PS.OID
       AND PS.OID_SEGURADORA = S.OID
       AND PS.OID_PRODUTO = P.OID
       AND PP.OID_USUARIO_MOV_PEND = U_PEND.OID(+)
       AND PP.OID_USUARIO_MOV_DECLINADO = U_DECLINADO.OID(+)
       AND PP.OID_USUARIO_MOV_REENVIADO = U_REVISADO.OID(+)
       AND PP.OID_USUARIO_MOV_EMITIDO = U_EMITIDO.OID(+)
       AND PP.OID_USUARIO_MOV_CANCELADO = U_CANCELADO.OID(+)
       AND PP.OID_USUARIO_MOV_RECEBIDO = U_RECEBIDO.OID(+)
       AND PP.OID_GERACAO_LOTE = GL.OID(+)
       AND PP.OID_COOPERATIVA = C.OID(+)
       AND PP.OID_MOTIVO_DECLINIO = MD.OID(+)
       AND PP.OID_PONTO_ATENDIMENTO = PA.OID(+)
       AND PP.OID_PROTOCOLO_DOCUMENTO = PD.OID(+)
       AND PP.OID = 1704719 ;Edited by: Luciana T. Angeli on Jul 16, 2010 9:58 AM
    Edited by: Luciana T. Angeli on Jul 16, 2010 10:02 AM

    Hi,
    Yes, you can do that, but I'm not sure it will be any more efficient, or otherwise better, than what you're doing now.
    Since you didn't post CREATE TABLE and INSERT statements for sample data, I'll use tables in the scott schema to illustrate.
    The following uses 3 copies of the empgrade table, similar to the way you use several copies of the usario table:
    SELECT       e.empno,       eg.grade     AS empno_g
    ,       e.sal,       sg.grade     AS sal_g
    ,       e.mgr,       mg.grade     AS mgr_g
    ,       d.dname
    FROM          scott.emp     e
    JOIN          scott.salgrade     eg     ON     e.empno       BETWEEN eg.losal AND eg.hisal
    JOIN          scott.salgrade     sg     ON     e.sal       BETWEEN sg.losal AND sg.hisal
    LEFT OUTER JOIN     scott.salgrade     mg     ON     e.mgr       BETWEEN mg.losal AND mg.hisal
    JOIN             scott.dept     d     ON     e.deptno  = d.deptno
    ORDER BY  e.empno
    ;Output:
    EMPNO EMPNO_G   SAL SAL_G   MGR MGR_G DNAME
    7369       5   800     1  7902     5 RESEARCH
    7499       5  1600     3  7698     5 SALES
    7521       5  1250     2  7698     5 SALES
    7566       5  2975     4  7839     5 RESEARCH
    7654       5  1250     2  7698     5 SALES
    7698       5  2850     4  7839     5 SALES
    7782       5  2450     4  7839     5 ACCOUNTING
    7788       5  3000     4  7566     5 RESEARCH
    7839       5  5000     5             ACCOUNTING
    7844       5  1500     3  7698     5 SALES
    7876       5  1100     1  7788     5 RESEARCH
    7900       5   950     1  7698     5 SALES
    7902       5  3000     4  7566     5 RESEARCH
    7934       5  1300     2  7782     5 ACCOUNTINGThe problem is that you may need 3 different values of the grade column, from 3 different rows of salgrade, for each row of emp.
    You can get all 3 grades at once as separate rows, then pivot the results to make them 3 different columns:
    WITH     all_grades  AS
         SELECT       e.empno, e.sal, e.mgr, e.deptno
         ,       MIN (CASE WHEN e.empno BETWEEN g.losal AND g.hisal THEN grade END)     AS empno_g
         ,       MIN (CASE WHEN e.sal   BETWEEN g.losal AND g.hisal THEN grade END)     AS sal_g
         ,       MIN (CASE WHEN e.mgr   BETWEEN g.losal AND g.hisal THEN grade END)     AS mgr_g
         FROM       scott.emp       e
         JOIN       scott.salgrade g     ON     e.empno     BETWEEN g.losal AND g.hisal
                                OR     e.sal     BETWEEN g.losal AND g.hisal
                                OR     e.mgr     BETWEEN g.losal AND g.hisal
         GROUP BY  e.empno, e.sal, e.mgr, e.deptno
    SELECT       a.empno
    ,       a.empno_g
    ,       a.sal
    ,       a.sal_g
    ,       a.mgr
    ,       a.mgr_g
    ,       d.dname
    FROM       all_grades     a
    JOIN          scott.dept     d     ON     a.deptno  = d.deptno
    ORDER BY  a.empno
    ;

  • ORA-00903:invalide table name

    Hi,
    I can not understand. I'm loged into DB as sysdba :
    select table_name, owner from all_tables where table_name ='ORDER';
    TABLE_NAME                     OWNER
    ORDER                          SYS
    select * from ORDER
    error on line 1 :
    ORA-00903:invalide table name
    select * from SYS.ORDER
    error on line 1 :
    ORA-00903:invalide table nameThank for help.

    user522961 wrote:
    thank you.
    But why that ? I have always used table name without double qutation mark ?
    Regards.
    Edited by: user522961 on May 29, 2009 2:53 AMThink about this variant on your query:
    select * from order
    order by 1;What do you suppose oracle is doing when it parses your query and it sees "order" where it is expecting a table name?

  • I want to find the table name

    Hi experts,
    I want to find information which is stored in the particular transaction (find the table name)
    tcode is COR3 in that enter process order and enter after that go to adminstrative data in that created user.
    I want find user information will be stored in which table . pls help me in this

    Hi,
    There are both technical and functional ways of knowing the Table Names:
    1. You can ask your functional consultant to give you the basic or the main table name. From there you can use a where used list to get the list of all the tables that are connected to this table by the foreign key relationship.
    2. You can get to know the name of the package from the package hierarchy. You can also use se84 to find the objects from the repository information browser.
    3. You can use the ST05 transaction to run and SQL trace to find all the tables that where accessed during the TCODE execution. But here you need to be precise as it will show you all the names of all the database tables accessed.
    Hope this will help you.
    Thanks,
    Samantak.

  • Using dymanic table name for running select queries

    Hi there. Currently got a problem with performing the following task:
         Perform fulltext search on all tables that have created fulltext indexes in specific schema. Result should look like this:
              <TABLE_NAME1>                <ID_FROM_TABLE>
              <TABLE_NAME1>                <ID_FROM_TABLE>
              <TABLE_NAME2>                <ID_FROM_TABLE>
              <TABLE_NAME2>                <ID_FROM_TABLE>
         At the moment all tables have the same ID column UOI_ID.
    What I've tried so far is the following:
    PROCEDURE "tuser"."dam.test.db.procedures::textSearch" ( in keyword NVARCHAR(300), out search_results "tuser"."dam.test.db::tuser.procedures.tt_search_results" )
      LANGUAGE SQLSCRIPT
      SQL SECURITY INVOKER
      DEFAULT SCHEMA "tuser"
      AS
    BEGIN
      Write your procedure logic
      DECLARE counter Integer := 1;
      DECLARE row_count Integer;
      DECLARE table_name NVARCHAR(300);
      DECLARE schema_name NVARCHAR(300) := 'tuser';
      indexed_tables = SELECT row_number() OVER (ORDER BY "TABLE_NAME") AS ROW_NUMBER, "TABLE_NAME"
           FROM (
                SELECT DISTINCT "TABLE_NAME"
                     FROM "SYS"."FULLTEXT_INDEXES"
                          WHERE "SCHEMA_NAME" = :schema_name
      SELECT COUNT(*) INTO row_count FROM :indexed_tables;
      WHILE counter < row_count + 1 DO
           SELECT '"tuser"."'||"TABLE_NAME"||'"' INTO table_name FROM :indexed_tables WHERE "ROW_NUMBER" = :counter;
           temporary_results = SELECT :table_name AS TABLE_NAME, "OUI_ID" AS ID
                FROM :table_name
                     WHERE contains(*, :keyword, fuzzy(0.5));
           search_results = CE_UNION_ALL(:search_results, :temporary_results);
           counter := counter + 1;
      END WHILE;
    END;
    At this point it's impossible to perform the:
    ... FROM :table_name ...
    The error is:
    Could not create catalog object: scalar type is not allowed
    Tried doing it with CE functions.
    temporary_table = CE_COLUMN_TABLE(table_name);
    The error is:
    Dependent object not found: SqlScript; tuser.TABLE_NAME
    So the question is: How to dynamically put table name into "FROM ..." statement?

    Hello. Thx for response.
    I have tried something like
    exec 'INSERT INTO "tuser"."dam.test.db::tuser.procedures.search_result" SELECT '''||table_name||''' AS TABLE_NAME, '||column_name||' AS ID, SCORE() AS SCORE  FROM '||table_name||' WHERE contains(*, '''||keyword||''', fuzzy(0.5))';
    but here i have "tuser"."dam.test.db::tuser.procedures.search_result" created before the execution. What i really want is to make it as a local variable. Something like:
    DECLARE schema_name NVARCHAR(300) := 'tuser';
    indexed_tables = SELECT DISTINCT "TABLE_NAME" FROM "SYS"."FULLTEXT_INDEXES" WHERE "SCHEMA_NAME" = :schema_name ;
    but i can not transform the top 'exec ...' statement into 'result = SELECT ...' because it always says that it can not pass the scalar value into the 'FROM ...' part.

Maybe you are looking for

  • Data not seen in RSA3 after setup table was filled

    HI We have an issue where we do not see data for Sales Orders and Deliveries in RSA3  (and hence is missing in BW). For sales orders we are missing 6 months' data and for Deliveries we are missing data from june to october 2007. We checked the sales

  • Error while creating  jco connection for metadata?

    Hi all, we are using ep 6 sp 16. I could create the  JCO connection for application data  but i am not able to create the jco connection for metadata for the same  r3 server . while creating  the   the connection system name and  logon group  and dis

  • TDS ceiling limit for lower TDS certificate.

    how i put TDS ceiling limit for lower TDS certificate for a particular vendor?say for example:- tax type-C6,tax code-C6, exemption rate-.11% and ceiling limit- 45,000/-.please suggest how i put the ceiling amount? Cheers Joy

  • Flash player 11 Fehler 303 error 2048

    Hallo, seit dem Update auf den Player 11 habe werden viele Videos nicht mehr abgespielt erhalte da ständig die Meldung Fehler 303 error 2048 (try lossing flash securitty settings) was funktioniert da nicht richtig?

  • Macbook Startup Issue - Help!!!!!!!!!!!!

    My 2006 mac book had a start up issue a couple of years back, I'd boot her up to be greeted with a screen displaying a start up failed message in three different languages on a grey screen. http://www.minneapolispcrepair.com/images/mac%20error%20scre