Trouble executing data found on TABLE: exe_sel_dttime_xml (COLUMN: QUERY)

Hello,
I want to execute using EXECUTE IMMEDIATE the data found on a table
exe_sel_dttime_xml
The following code inside a PLSQL procedure constantly gives me coding problems(therefore not working as it should!!):
BEGIN
FOR r
IN (SELECT QUERY INTO v_toexecute FROM exe_sel_dttime_xml)
LOOP
EXECUTE IMMEDIATE v_toexecute;
END LOOP;
END;
Basically what this code is supposed to do is execute each of the data found inside the COLUMN: [QUERY] found on the TABLE: [exe_sel_dttime_xml]
ie,
SQL> r
1 select * from exe_sel_dttime_xml
2*
QUERY
SELECT COL_TNAME, DEVICE_DTTIME
INTO table_dttime(COL_TNAME, COL_DTTIME)
FROM t_xml_01;
SELECT COL_TNAME, DEVICE_DTTIME
INTO table_dttime(COL_TNAME, COL_DTTIME)
FROM t_xml_02;
SELECT COL_TNAME, DEVICE_DTTIME
INTO table_dttime(COL_TNAME, COL_DTTIME)
FROM t_xml_03;
SELECT COL_TNAME, DEVICE_DTTIME
INTO table_dttime(COL_TNAME, COL_DTTIME)
FROM t_xml_04;
SELECT COL_TNAME, DEVICE_DTTIME
INTO table_dttime(COL_TNAME, COL_DTTIME)
FROM t_xml_05;
SELECT COL_TNAME, DEVICE_DTTIME
INTO table_dttime(COL_TNAME, COL_DTTIME)
FROM t_xml_06;
Remember,
I need this to work using the following:
+ EXECUTE IMMEDIATE
+ Querying the data from table: exe_sel_dttime_xml
(ie, SELECT QUERY INTO v_toexecute FROM exe_sel_dttime_xml)
All (and any) help is appreciated
-ng

first thing, when writing cursor for loop, the select statement does not have to contain the INTO clause.
for rec in (select ename from scott.emp)
loop
  dbms_output.put_line(rec.ename) ;
end loop ;Next, can you execute the select statements stored in the table exe_sel_dttime_xml at the SQL*Plus prompt?
if you cannot, you cannot do execute immediate on them.
if the table_dttime is a table in the database into which you are inserting the data selected from the table t_xml_01, then it should be coded as a
insert into ... select ...
statement.
explain in detail what you are trying to do and someone can help you.

Similar Messages

  • AA - Error Message: No data found in table j_1aat089 for depreciation area

    Hi friends,
    I am trying to execute ABAW transaction but I recieved the below error:
    "No data found in table j_1aat089 for depreciation area 00."
    Message no. 8Z874
    But Area 00 there is not configurate in my system.
    Does anyone has any hint regarding this issue?
    Thanks
    Daniel Dorta

    Hi Daniel,
    You are not using Inflation funcitonality, are not you? Check that in IMG - Financial Accounting (New) - Financial Accounting Global Settings (New) - Inflation Accounting - Inflation Methods - Assign Inflation Methods to Company Codes your company code is not assigned to any inflation methods.
    Regards,
    Eli

  • Data in multiple tables and columns

    Hi,
    How to find if multiple tables are containing the same data?
    'Apple' text is in three different tables and under three different column names.
    Expected result
    fruits_one
    fruits_two
    fruits_three
    Select name, quantity from fruits_one;
    Apple   1
    Orange  1
    Pear    1
    select flavour, desc from fruits_two;
    Red,   Apple
    Blue, Berry
    select order,date,details  from fruits_three;
    101  11/11/2011    Grapes
    102  12/01/2010    AppleThanks
    Sandy

    SQL> create table fruits_one (name varchar2(100), quantity number);
    Table created.
    SQL> insert into fruits_one
      2  select 'Apple'  name, 1 quantity from dual union all
      3  select 'orange'  name, 1 quantity from dual;
    2 rows created.
    SQL> commit;
    Commit complete.
    SQL> create table fruits_two (flavour varchar2(100), des varchar2(100));
    Table created.
    SQL> insert into fruits_two
      2  select 'Red' flavour,   'Apple' des  from dual union all
      3  select 'blue' , 'berry'  from dual ;
    2 rows created.
    SQL> commit;
    Commit complete.
    SQL> set serveroutput on
    SQL> declare
      2  l_search varchar2(10) := 'APPLE';
      3  l_cnt number := 0;
      4  begin
      5 
      6  for x in (select column_name, data_type, table_name from user_tab_cols where data_type in ('VAR
    CHAR2'))
      7  loop
      8     
      9    execute immediate  'select count(*) from "' || x.table_name ||'" where upper("' || x.column_n
    ame || '") like ''%' || l_search || '%''' into l_cnt;
    10   
    11    if l_cnt > 0  then
    12    dbms_output.put_line('table = "' || x.table_name ||'", column = "' || x.column_name ||'"');
    13    end if;
    14   
    15  end loop;
    16 
    17  end;
    18  /
    table = "FRUITS_ONE", column = "NAME"
    table = "FRUITS_TWO", column = "DES"
    PL/SQL procedure successfully completed.
    SQL>

  • How to input data into a table with columns?

    I am trying to input data into a table.  My table have 5 columns and an unlimited amount of rows.  I created a program in LabView that enters the data into the table but it enters all of the data in one row.  I would like to enter the first set of information into the first column, the second set of info into the second  column and so on.  I am including a copy of the program that I am working with.  I would like the number of runs to be put into the first column (it should count down like number 5 in first row, number 4 in second row, number 3 in third row, and so on).  I would like the applied voltage to be placed in the second column, and so on.  Any help or information will be greatly appreciated.  I am working with LabView Version 6.1 and 8.0.  I am submitting the vi from 6.1. 
    Attachments:
    FJ-PROGRAM.vi ‏68 KB

    Pondered,
    I looked at your code and I think you might be making things too complicated. I've included a very simple example that demonstrates how to write a 2D array of integers to a table. Hope you find this helpful. It is in LV 7.1.
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect
    Attachments:
    rows - columns.vi ‏17 KB

  • Issue in data Extraction , Source tables having columns wth lengthe 60

    Hi BI Experts ,
    Here I have a issue while extracting the data from Oracle tables. I encountered some columns for which the length of character stream is more than 60 , some where around 200 to 300 , for example : Reason for some action , Comments , discription .
    I am not able to to treat them as master  data text since these fileds are coming with the Transaction data . In SAP BI we can have the data type CHAR with length max to 60 . Now how can I deal this situation in a better way ??
    Could you please come up with your ideas .
    Expecting interesting solutions
    Anurag

    Hello Charan,
    first check this Blog:
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417800)ID0294722750DB10878770002327649734End?blog=/pub/wlg/3705
    It may helps already.
    Anouter methode is to report from PSA Tables. But here no How-to is available.
    Br.
    Joerg

  • "No Applicable Data found" message in BEx Analyzer Query

    Can anyone help me on this problem? I have encountered this problem when i tried to view the results in analyzer after i completed the database with all the data.
    Query - Demo: ICDEMOBC00_Q01 - Key Date: 31.12.9999     
    Calendar Day     
    Customer ID     
    Material number     
    Key Figures     
    Sale representative     
    No Applicable Data Found.

    You key date 31.12.9999, is this the date you entered in a variable?  If so I presume you don't have data on your system for this time period.
    If you take the date filter out of the report do you see data?
    Also check if there are any conditions on the report that may be active.
    Regards
    Gill

  • CrystalRpts - Excel Data source, SQLServer2005 table. SQL Query behavior?

    Greetings - What should be a simple report (with Excel 2007 spreadsheet as primary data source linking to a SQLServer 2005 table ) returns incorrect results.  Query designed to select data from SQL Table with  'DATES >=' certain date, but data returned ignores the DATE qualifier.
    Running DATE query manually against the SQL Table proves the data is correct. 
    Anyone notice problems with SQL Query behavior when mixing data sources?  Thanks.

    Hello,
    Take the SQL that works outside of CR and then create a new report and add all data sources. Now use a Command Object and paste in your SQL. YOu may have to play with adding each data source in a different order. If that works great if not you'll have to figure out a way to get all the data into one source.
    I believe MS SQL Server can link multiple data sources and types. Check SQL Help file for more info it it is possible.
    Thank you
    Don

  • How to retrive the blob data from a table using sql query

    Hi gurus,
    I have a table which has " BLOB "content in a column .I want to view the data From BLOB column using sql query .It would be helpfull If some one share their idea.
    Regards,
    vardhani.

    You can use data templates.
    See this: http://blogs.oracle.com/xmlpublisher/entry/blob_clob_raw_and_looooong
    http://blogs.oracle.com/xmlpublisher/entry/inserting_blobs_into_your_repo
    Thanks,
    Bipuser

  • Fetch data from 50  tables with single query

    Hi,
    I am having a requirement where I should fetch the records count  in a table, since there are close to 50 tables I have written below code, which is working fine with out WHERE  clause, but going to short dump if I use a where clause.
    IF NOT p_sel_opt IS INITIAL.
        LOOP AT p_sel_opt INTO wa_sel_opt .
          ASSIGN wa_sel_opt-low TO <fval>.
          ASSIGN  p_fieldname TO <field>.
          IF <field> IS ASSIGNED AND <fval> IS ASSIGNED.
            SELECT COUNT(*)  FROM (p_tabname) WHERE <FIELD>  = <fval>  .
            IF sy-subrc = 0.
              wa_fi_bukrs-bukrs = <fval>.
              wa_fi_bukrs-table =  p_tabname.
              wa_fi_bukrs-count = sy-dbcnt.
              APPEND wa_fi_bukrs TO it_fi_bukrs.
              CLEAR wa_fi_bukrs.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Reason it is giving is
    <field>
    is not availble in the data base tables . what can I do to the above query for that to work.
    Thanks,
    Varun

    replace <field> with (<field>) ok?
    but, its better if you construct your where clause.. i dont know the above will work or not.
    like
    concatenate <FIELD>  ' = ' <fval> into s1 separated by space.
    and pass where (s1).
    check the FM RFC_READ_TABLE. you will get a proper picture
    Edited by: Soumyaprakash Mishra on Dec 13, 2011 11:02 PM

  • Checking existence of data in multiple table in single query

    create table x_test1(id number, property varchar2(1000));
    insert into x_test1 values (1,'abc');
    insert into x_test1 values (2,'ab');
    insert into x_test1 values (1,'abcd');
    insert into x_test1 values (3,'a');
    insert into x_test1 values (4,'b');
    insert into x_test1 values (5,'c');
    insert into x_test1 values (8,'d');
    insert into x_test1 values (10,'e');
    create table x_test2(id number, property varchar2(1000));
    insert into x_test2 values (1,'abc');
    insert into x_test2 values (5,'ab');
    insert into x_test2 values (2,'abcd');
    insert into x_test2 values (6,'a');
    insert into x_test2 values (11,'b');
    insert into x_test2 values (15,'c');
    insert into x_test2 values (18,'d');
    insert into x_test2 values (10,'e');
    Given an id I want to check whether its exists in any this tables. However,in acutal sceneraio x_test1, x_test2 contains millions of records so I want to write a SQL query in such way that if we check in x_test1 if it exists there I don;t check in x_test2.
    Can I able to write this in one SQL statement ?
    Example -
    Given id '1' I want to whether its exists in any these two tables
    or
    Given id '7' I want to whether its exists in any these two tables

    Hi,
    I loved Michael's solution.
    But since he ahs already shown you that, here is another way of doing it.
    It may be more expensive since distinct is involved, however it si only to take care of multiple entries in the table.
    select
    case when 1=(select distinct 1 from x_test1 where id=&x) then
    'EXISTS IN TABLE 1'
    when 1=(select distinct 1 from x_test2 where id=&x) then
    'EXISTS IN TABLE 2'
    else
    'EXISTS NO WHERE'
    end valu
    from dualRegards,
    Bhushan

  • No Data Found Exception

    I'm getting No Data found exception while selecting a query.
    I'm trying to insert into a table by selecting records from a table.
    I'm doing this inside a loop. So I need to continue with insertion even though i get this error( NO DATA FOUND). How can this be done?
    Any help?
    Eg.
    FOR id IN (select Emp_ID from Table A)
    Begin
    LOOP
    BEGIN
    Select COL_B INTO Var_X from Table B where COL_C = id.EMPID;
    EXCEPTION
    NO DATA FOUND ---- I need to go for insertion even though i get this error
    END
    ---- Insertion Goes here to TABLE_C
    ----- Inserting VAR_X into the TABLE_C along with other Columns
    END LOOP
    END
    Thanks
    Harshini

    What you have should work. Are you saying thet the exception handler doesn't catch the exception? If that is the case then it must be another exception. You could change the exceptiuon handler to be a when others (which will catch everything) or you could just decalre a cursor which you open, fetch from, and then close. If no data is found you won't get an exception, but your variables won't be null unless you reset them every time you go round the loop.
    Obviously the no data found exception is actually no_data_found (i.e. with underscores) but your code wouldn't compile if you missed out the underscores so you must have that right.

  • No Data Found Error in wwv_flow_files

    Hello All,
    I have written a procedure to upload the .csv file data into one of my database Table. It was working fine some days back, but when I try to upload a .csv today, it gives me error "No Data Found".
    This is the Query I am using to fetch the data from wwv_flow_files table:
    select blob_content into v_blob_data
    from wwv_flow_files
    where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = UPPER(:APP_USER))
    and id = (select max(id) from wwv_flow_files where updated_by = UPPER(:APP_USER));
    this is returning No data found error.
    Please suggest what is the problem.
    Apex vesion : 4.0.1.00.03
    DB: 11g
    Thanks
    Tauceef

    Hi Trent,
    As I said, I am using this code from a long time ago, it was working fine before and I have uploaded many files using this code.
    But suddenly I don't know what happen it start giving this error.
    For making sure that this statement is the one which is giving "no data found" error I commented all the other select statements
    and I still got no data found. So it's confirmed.
    One more thing, I tried to run this code in SQL command by hard coding the :APP_USER value and this is what I got in the result:
    BLOB_CONTENT
    [unsupported data type]
    means this code is returning something but at run time it is giving no data found.
    Please suggest.
    Thanks
    Tauceef

  • Table and columns separation  in string

    Hi,
    I am having one column data containing combining table and column names like
    act_hand_table.work_order
    i want seperate table and column names
    i want separte . filed
    Please help me
    Regards,
    Kiran

    Kiran Bathula wrote:
    Hi,
    I am having one column data containing combining table and column names like
    act_hand_table.work_order
    i want seperate table and column names
    i want separte . filed
    Please help me
    Regards,
    KiranTry
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2  (select 'act_hand_table.work_order' col from dual)
      3* select substr(col,1,instr(col,'.',1)-1)tbl,substr(col,instr(col,'.',1)+1) from t
    SQL> /
    TBL            SUBSTR(COL
    act_hand_table work_orderHope this helps
    Regards,
    Achyut

  • Is it possible to assign user-defined data elements to table control?

    Hi SDN,
    Is it possible to assign a user defined data element other than basic data types in table control column.

    Hi Suresh,
    In Screen layout,In element list tab,i am not able to give the user-defined data types other than basic data types?please tell me how to give other data types

  • Row tables Or Column Tables Or both?

    I would like to know the basic approach in order to build a new model  in hana ( row tables or column tables or both) ?
    Suppose I've a source system for example excel or .csv..etc and different excels consists of different types of data that includes both dimensions and measures and each source file consists of around 500 fields. The source feed comes every day and I need to load each and every field in the database.
    Out of these 500 fields and assume 300 are dimensions and 200 are facts, and for reporting for purpose i just need 150 dimensions and 80 measures and some calculated measures. (Infuture, I may need to consider some more dimensions and facts) .
    Now my question is,
    As the source feed comes every day and I need to load all the fields,
    Do I need to create first row tables first as Row tables are preferred for insert operations or Can I go a head with column tables directly?
    I just want to know the guidelines to follow , where we need to load some thousand of fields and huge number of rows and at the same time my modeling should be good for reporting as well.
    What I am not able to catch is, SAP HANA recommends not to combine row tables and column table for operations otherwise first I load all the data into row tables and then create column tables specific to reporting purpose by using row tables' data? ( I can create some stored procs to load data from row tables to columns tables and run them after data load completes)
    Please let me know your inputs.
    Thanks,
    Sree

    Hello Shree,
    For the better performance it is always advisable to store table as a Column Store.
    This can be changed anytime to row store.
    HANA does have a row store and you can create row-oriented tables for some very specific scenarios:
    - Transient data like queues, where you insert and delete a lot and the data never persists
    - Configuration tables which are never joined, where you select individual entire rows
    - When you are advised to by a SAP support personnel
    Also if you are going to create views it only supports column based stored tables.
    Usually performance is better with the Column store.
    For more details you can refer:
    http://scn.sap.com/thread/2025441
    Regards,
    Saurabh

Maybe you are looking for

  • Can I install win2K and solaris8 in one disk?

    I have already installed windows2000 in my laptop. I also want to install Solaris8 on it. The installation loader finds my hard disk device and asks if I want to create a new fdisk partition in c0d0. If I answer "yes", will the installation prompt me

  • Tips required from algorithm practitioners on how to learn algorithms

    Hello, I am trying to improve my programming skills and more particularly my proficiency at algorithms. I decided to start with advanced sorting algorithms such as the quick sort and shell sort. Here is what I did in order to practise: -Working with

  • Remove Effects from Inspector Window???

    With a clip selected in the timeline, I played around with available effects but now my Inspector window is filled with lists of Effects, with some duplicated several times. I can remove the effects from the clip by deselecting the Effect header, but

  • This web page can not be displayed

    System: Windows 7 Home Premium 64x I have been trying to access http://www.studentconsult.com (It is Elseviers online eBook web site.), http://www.hup.harvard.edu/catalog.php?isbn=9780674003477 (the official web page of the book Famous Women written

  • Build a report of All Hardware types and thier IP Address

    We are in the middle of upgrading all WinXP hardware and i am using the below report to determine the Harware type/make/model and top console user but i need to also retrieve the IP address. SELECT  distinct  CS.name0 as 'Computer Name',  CS.domain0