Dynamic Select query is failing with error "Invalid Table Name"

OPEN rc FOR 'SELECT count(*) from :s' USING tab_name;
fetch rc into rec_count;
CLOSE rc;
my requirement is to build dynamic select query to retrieve the total count of rows in each table ( variable tab_name contains the table_name )
But I am getting stuck by this errror, not sure if there is any alternative !
ORA-00903: invalid table name
ORA-06512: at line 43

OPEN rc FOR 'SELECT count(*) from '||tab_name;
fetch rc into rec_count;
CLOSE rc;
-- This will work
1. Create a sql statement.
2. Open ref cursor for that statement.

Similar Messages

  • Disc erase failed with error invalid request

    HI,
    I'm trying to get a new 2.5tb external wd hard drive to work with both my mac and my old pc - so i can backup my old data from the pc.
    i have tried using disc utility, and erasing the disk and reformating to ms-dos (fat) format and recieve the following error message:
    Disk erase failed with the following request: invalid request
    i have also tried partitioning the hard drive, and recieve the same error message.
    Any ideas on how to re-format this device?
    Thanks!

    Had to reply just to say this.
    Thank you Webdva
    - OSX Yosemite

  • Call to Java Method to Zip directory fails with error Invalid parameter 1

    Hi all,
    I try to translate the following Java Code to PeopleCode and I do not succeed in it.
    Can somebody please help me out ?
    On that website http://www3.ntu.edu.sg/home/ehchua/programming/java/J5b_IO.html I extracted the Java Code:
    import java.io.File;
    public class ListDirectoryRecusive {
    public static void main(String[] args) {
    File dir = new File("d:\\myproject\\test"); // Escape sequence needed for '\'
    listRecursive(dir);
    public static void listRecursive(File dir) {
    if (dir.isDirectory()) {
    File[] items = dir.listFiles();
    for (File item : items) {
    System.out.println(item.getAbsoluteFile());
    if (item.isDirectory()) listRecursive(item); // Recursive call
    PeopleCode
    I want to get all the files included in the directory
    Local string &SourceDirPath = S1_FS_RDCFG_AET.S1_CHMN_TODO;
    Local JavaObject &Javadir = CreateJavaObject("java.io.File", &SourceDirPath);
    Local array of any &StrArray;
    &ArrayOfAny = CreateArrayAny();
    Local JavaObject &JavaFilesArray = CreateJavaArray("java.lang.Object[]", 1024);
    &JavaFilesArray = &Javadir.listFiles();
    CopyFromJavaArray(&JavaFilesArray, &ArrayOfAny);
    ==> I alway get the error
    Message:
    Invalid parameter 1 for function CopyFromJavaArray. (2,116) S1_DSITE_ZIP.MAIN.GBL.default.1900-01-01 .DIRECTOR.OnExecute PCPC:511 Statement:9
    I thank you in avance
    Edited by: Meapri on Jan 23, 2013 9:33 AM

    The Pcode I wrote to Zip Directories
    Function AddFileToZip(&sDirSeparator, &zipInternalPath, &fileNameToZip, &zipFileName, &outFileStream, &zipStreamOut)
       Local JavaObject &file = CreateJavaObject("java.io.File", &fileNameToZip);
       Local JavaObject &inFileStream = CreateJavaObject("java.io.FileInputStream", &fileNameToZip);
       Local JavaObject &zipEntry = CreateJavaObject("java.util.zip.ZipEntry", &fileNameToZip);
       REM **  Créer le flux de sortie de données pour le fichier ZIP final;
       REM ** We will read &fileNameToZip into a buffer and write it out to &zip;
       Local string &ZippedfileName = &zipInternalPath | &sDirSeparator | &zipFileName;
       REM ** Make sure zip entry retains original modified date;
       &zipEntry.setTime(&file.lastModified());
       &zipStreamOut.putNextEntry(&zipEntry);
       Local JavaObject &buf = CreateJavaArray("byte[]", 1024);
       Local number &byteCount;
       &byteCount = &inFileStream.read(&buf);
       While &byteCount > 0
          &zipStreamOut.write(&buf, 0, &byteCount);
          &byteCount = &inFileStream.read(&buf);
       End-While;
       &inFileStream.close();
       MessageBox(0, "", 99000, 0, "Zipped File : " | &fileNameToZip);
    End-Function;
    Function getDirContent(&sDirSeparator, &parentFolder, &zipFileName, &outFileStream, &zipStreamOut)
       MessageBox(0, "", 99000, 0, "Directory to scan : " | &parentFolder);
       Local JavaObject &Folder = CreateJavaObject("java.io.File", &parentFolder);
       Local JavaObject &jItems = &Folder.list();
       /* Transformation en Array Pcode*/
       Local array of any &items = CreateArrayAny();
       Local number &idx = 1;
       &items [&jItems.length] = Null;
       CopyFromJavaArray(&jItems, &items);
       For &idx = 1 To &jItems.length
          Local string &Entry = &parentFolder | &sDirSeparator | &items [&idx];
          Local JavaObject &FileOrFolder = CreateJavaObject("java.io.File", &Entry);
          If &FileOrFolder.isDirectory() Then
             getDirContent(&sDirSeparator, &Entry, &zipFileName, &outFileStream, &zipStreamOut);
          Else
             AddFileToZip(&sDirSeparator, &parentFolder, &Entry, &zipFileName, &outFileStream, &zipStreamOut);
          End-If;
       End-For;
    End-Function;
    Local string &RootName = "C:\TEMP\TEST";
    Local string &sDirSeparator = "\";
    REM ** Create Output Zip File ;
    Local string &ZipFileName = &RootName | &sDirSeparator | "Temp2_Zip.zip";
    Local JavaObject &OutFileStream = CreateJavaObject("java.io.FileOutputStream", &ZipFileName, True);
    Local JavaObject &zipStreamOut = CreateJavaObject("java.util.zip.ZipOutputStream", &OutFileStream);
    REM ** Create Zip File Entries found in the directory;
    getDirContent(&sDirSeparator, &RootName, &ZipFileName, &OutFileStream, &zipStreamOut);
    REM Close Output Zip File ;
    &zipStreamOut.close();Edited by: Meapri on Feb 2, 2013 10:54 AM : copy and paste code that works!
    Edited by: Meapri on Feb 2, 2013 10:56 AM
    Edited by: Meapri on Feb 2, 2013 11:02 AM

  • The task failed with error: Invalid BPM Object context key, can any one hel

    The application works fine on version 5.7. I am trying to migrate to 10.3 angetting the error when tried to execute task. This is coming up from opening a jsp page; don't know exact code/line number as the error message is in a popup window and doesn't show it clearly in logs:
    The task could not be successfully executed. Reason: 'fuego.xobject.util.InvalidContextKey: Invalid BPM Object context key'.
    See log file for more information [Error code: workspace-1255544311265]
    The log shows the below starting from just before the error upto the complete error msg:
    ExecutionDispatcher.actionId: RUN_INSTANCE_TASK
    WamJsp: commit prepare.
    java.lang.NullPointerException
    java.lang.NullPointerException
         at fuegoblock.net.NewJSP$1.prepare(NewJSP.java:185)
         at fuego.web.execution.InteractiveInvocation.retryExecution(InteractiveInvocation.java:72)
         at fuego.web.execution.InteractiveExecution.retry(InteractiveExecution.java:246)
         at fuego.web.papi.TaskExecutor.runInstanceTask(TaskExecutor.java:375)
         at fuego.web.papi.TaskExecutor.execute(TaskExecutor.java:98)
         at fuego.workspace.servlet.ExecutorServlet.doAction(ExecutorServlet.java:117)
         at fuego.workspace.servlet.BaseServlet.doPost(BaseServlet.java:229)
         at fuego.workspace.servlet.BaseServlet.doGet(BaseServlet.java:220)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at fuego.workspace.servlet.AuthenticatedServlet.service(AuthenticatedServlet.java:83)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at sun.reflect.GeneratedMethodAccessor201.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
         at fuego.web.filter.SingleThreadPerSessionFilter.doFilter(SingleThreadPerSessionFilter.java:64)
         at fuego.web.filter.BaseFilter.doFilter(BaseFilter.java:63)
         at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
         at fuego.web.filter.CharsetFilter.doFilter(CharsetFilter.java:48)
         at fuego.web.filter.BaseFilter.doFilter(BaseFilter.java:63)
         at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Unexpected Error:The task could not be successfully executed.
    Reason: 'fuego.xobject.util.InvalidContextKey: Invalid BPM Object context key'.
    Can any one please help?
    Javed

    Hi Javed,
    I'm having similar error. What was the root cause of your problem? How did you fix that?
    Thanks,
    Bharat

  • How to use dynamic select query which queries from 3 different table.

    Hi All,
    I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
    I have used the following lines. Please tell me how to get code for the dynamic where clause.
    First try :
    Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
    The above method is not returning the vector or collection.
    Second Try:
    ReadAllQuery query = new ReadAllQuery(Person.class);
    query.useCollectionClass(LinkedList.class);
    LinkedList person = (LinkedList) session.executeQuery(query);
    The second try is returning the collection but, this fetches all the record from the table.
    1. How to query for range of records?
    2. How to query from multiple tables for some range. How to use dynamic range values ?
    Please reply with your answers or some pointers would help.
    Thanks and Regards,
    Vijay.B

    Hi,
    Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
    Employee employee = (Employee) session.executeSelectingCall(
        new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
    );You can get more information here :-
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
    Regards,
    Sandeep

  • Internal warning: Decryption failed with error

    OK, yesterday I did not receive this error when running this Job and all my other projects run fine and access the same Data Sources.
    So why then am I receiving this error. I have checked the Data Sources for this job and all seem fine. I have rebooted my PC.
    Sometimes when I run this Job trying to figure out the error it will give me an additional message that it cannot communicate with the data flow. (see second message)
    5892     5336     RUN-305004     1/25/2012 10:22:26 AM     |Session P2CFI03_JOB_1_VENDOR
    5892     
    5336     5336    RUN-305004     1/25/2012 10:22:26 AM     Internal warning: Decryption failed with error <Invalid message digest for data.>.
    5892     5336    CON-120302     1/25/2012 10:22:26 AM     |Session P2CFI03_JOB_1_VENDOR
    5892     
    5336     5336    CON-120302     1/25/2012 10:22:26 AM     ODBC call <SQLDriverConnect> for data source <mintoerpdw> failed: <[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed
    5892     5336     CON-120302     1/25/2012 10:22:26 AM     for user 'erp_migration'.>. Notify Customer Support.
    2592     3260     RUN-050406     1/25/2012 9:54:43 AM     |Session P2CFI03_JOB_1_VENDOR|Data flow New_DataFlow55
    2592     3260     RUN-050406     1/25/2012 9:54:43 AM     Data flow <New_DataFlow55> received a bad system message. Message text from the child process is < >. The process executing
    2592     3260     RUN-050406     1/25/2012 9:54:43 AM     data flow <New_DataFlow55> has died abnormally. For NT, check errorlog.txt. For HPUX, check stack_trace.txt. Also, notify
    2592     3260     RUN-050406     1/25/2012 9:54:43 AM     Technical Support.
    2592     3260     RUN-050409     1/25/2012 9:54:43 AM     |Session P2CFI03_JOB_1_VENDOR
    2592     3260     RUN-050409     1/25/2012 9:54:43 AM     The job process could not communicate with the data flow <New_DataFlow55> process. For details, see previously logged error
    2592     3260     RUN-050409     1/25/2012 9:54:43 AM     <50406>.

    Can anyone help with this?

  • Invalid table name  error when updating object in collection using SQL

    Hi,
    I have pl/sql code where I am selecting a object from a collection using sql select query. I am processing this record and now I want to update the collection with the new object. ie. ensure that the object that was fetched be removed and this new one be added.
    considering my_ot is the object type and my_tt is the table type.
    DECLARE
    my_col my_tt;
    my_col1 my_tt
    my_var my_ot;
    my_var2 VARCHAR2(10);
    BEGIN
    // populating my_col1 with select query
    //populating my_col with select query
    FOR my_col1.FIRST .. my_col.LAST LOOP
    //populating my_var2
    BEGIN
    SELECT my_ot(c.field1, c.field2 ,c.field3) INTO my_var FROM TABLE(my_col) c WHERE c.field3 = my_var2
    //processing the field my_VAR
    UPDATE TABLE(my_col) c SET c.field1 = my_var.field1 , c.field2 = my_var.field2 , WHERE c.field3 = my_var.field3;
    EXCEPTION WHEN NO_DATA_FOUND
    my_col.EXTEND;
    my_col(my_col.LAST) := // new my_ot object
    END;
    END LOOP;
    Here, when compiling the update query is not being compiled. I am getting a error 'invalid table name'. Is there any way to modify an object in the collection without knowing its index?
    If not, is it possible to find the index of a object in the collection in select query?
    Thanks in advance
    Paddy

    Hi,
    Is there any way to find the index of a object in the collection? Then I will simply replace the object at that index, right!
    Thanks
    Paddy

  • Invalid Table Name in query

    Hello, I'm trying to create a report on a table name that is in an item. This is the simple query I'm using for the report:
    Select * from :P9_MERGE_TABLE;
    I get an Invalid Table Name error. Is there any way I can build the query to get around this problem.
    thanks,
    Jan

    Certainly you can use a bind variable for a table name when building a dynamic sql query. But this is not exactly what I would call "binding the value of variable to a sql statement. You cannot bind a table name to a static sql query (hope this is the correct wording).
    For example:
    It is ok, to create the following static query:
    SELECT * from emp where empno = :P1_EMPNO;But this will not work
    SELECT * from :P1_TABLE_NAME;In this case, you have to do it the way discussed in this thread.

  • Table(): invalid table name

    The following line is a part of a PLSQL procedure which takes object_reference as an argument.
    delete from table(deref(object_reference).nested_table) where column_value = 'something';
    Error: invalid table name. Why? How do I accomplish this correctly?

    Oracle 10.2 . Any table. It doesn't matter. Or does it?
    I'm trying to query against a nested table (also called collection) of an object to which I have a reference. This object may be in any (object) table. A more elaborate example:
    create type item_ty (
    code number
    create type items_ty as table of item_ty;
    create type box (
    items items_ty,
    member procedure put_item(code number),
    member function take_item(code number)
    create type body box is
    begin
    member procedure put_item(code number) is
    begin
    insert into table(deref(self).items) item_ty(code); -- ERROR: invalid table name
    end;
    member procedure take_item(code number) is
    begin
    delete from table(deref(self).items) where column_value = code; -- ERROR: invalid table name
    end;
    end;

  • XSJOB - Invalid Table Name

    Hi Experts,
    I created one XSJOB service to update a table in 1 hour interval . But wheni activate the XSJOB file, iam getting the error "invalid table name". I am able to eecute the XSJS function successfully if I run externally . Function does not take any parameters.
    Sreehari

    function loadData(){
      var now = new Date();
      var dbconn = $.db.getConnection();
      try
      var query = "insert into \"METALS_ONE_GEN\".\"W_METALS_ONE.data::METALS_LIVE_PRICE\""+
      "values('DEMO50',?,?,?,'INR')";
      var pstmt  = dbconn.prepareCall(query);
      pstmt.setString(1,now.getFullYear()+"-"+now.getMonth()+"-"+now.getDate());
      pstmt.setString(2,now.getHours()+":"+now.getMinutes());
      pstmt.setBigInt(3,Math.floor((Math.random()*75)+375));
      pstmt.execute();
      dbconn.commit();
      catch(er){
      $.response.setBody(er.message);
    This is the content of XSJS file. Id insert a random data to a db table.
    Sreehari

  • Absolute dynamic select query with dynamic join and where

    Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
    I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
    Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
        SELECT (FIELDS) INTO TABLE IT_TABLES
          FROM ( (ME->TABLE1)  inner join ( me->table2 )
          on ( on_condition ) )
          WHERE (me->where_fields).
    Ags.

    It worked for me in a following way:
    select * into corresponding fields of table <result_table>
            from (join_string)
            where (l_where).
    Where the contents of join_string were dynamically build using concatenation. So it will be something like
    concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
    <...>
    add here matching/reference colums, something like
    concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
    concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
    concatenate join_string temp1 '=' temp2 into join_string separated by space.
    <...>
    concatenate join_string ')' into join_string separated by space.
    And then use similar approach for l_where variable.

  • How to create a Type Object with Dynamic select query columns in a Function

    Hi Every One,
    I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row.
    I have tried by
    SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE a.country_code = 'US';
    c :=DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(c,actual_query,DBMS_SQL.NATIVE);
    l_status := DBMS_SQL.EXECUTE(c);
    DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.DEFINE_COLUMN(c,j,v_val,2000);
    END LOOP;
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.COLUMN_VALUE(c,j,v_val);
    END LOOP;
    But got stuck, how to iterate the values and assign to a Type Object from the cursor. Can any one guide me how to do the process.
    Thanks,
    mallikj2

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • Dynamic select query with dynamic where condition

    Hi all,
    I want to use the dynamic select query with dynamic where condition. For that I used the below code but I am getting dump when using this code.
    Please advice, if there is any other way to achieve this requirement.
    Thanks,
    Sanket Sethi
    Code***************
    PARAMETERS: p_tabnam      TYPE tabname,
                p_selfl1      TYPE edpline,
                p_value       TYPE edpline,
                p_where1      TYPE edpline .
    DATA: lt_where    TYPE TABLE OF edpline,
          lt_sel_list TYPE TABLE OF edpline,
          l_wa_name   TYPE string,
          ls_where    TYPE edpline,
          l_having    TYPE string,
          dref        TYPE REF TO data,
          itab_type   TYPE REF TO cl_abap_tabledescr,
          struct_type TYPE REF TO cl_abap_structdescr,
          elem_type   TYPE REF TO cl_abap_elemdescr,
          comp_tab    TYPE cl_abap_structdescr=>component_table,
          comp_fld    TYPE cl_abap_structdescr=>component.
    TYPES: f_count TYPE i.
    FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,
    *                <ls_outtab> TYPE ANY,
                    <l_fld> TYPE ANY.
    struct_type ?= cl_abap_typedescr=>describe_by_name( p_tabnam ).
    elem_type   ?= cl_abap_elemdescr=>describe_by_name( 'F_COUNT' ).
    comp_tab = struct_type->get_components( ).
    comp_fld-name = 'F_COUNT'.
    comp_fld-type = elem_type.
    APPEND comp_fld TO comp_tab.
    struct_type = cl_abap_structdescr=>create( comp_tab ).
    itab_type   = cl_abap_tabledescr=>create( struct_type ).
    l_wa_name = 'l_WA'.
    CREATE DATA dref TYPE HANDLE itab_type.
    ASSIGN dref->* TO <lt_outtab>.
    *CREATE DATA dref TYPE HANDLE struct_type.
    *ASSIGN dref->* TO <ls_outtab>.
    * Creation of the selection fields
    APPEND p_selfl1 TO lt_sel_list.
    APPEND 'COUNT(*) AS F_COUNT' TO lt_sel_list.
    ** Creation of the "where" clause
    *CONCATENATE p_selfl1 '= '' p_value ''.'
    *            INTO ls_where
    *            SEPARATED BY space.
    *APPEND ls_where TO lt_where.
    * Creation of the "where" clause
    APPEND p_where1 TO lt_where.
    * Creation of the "having" clause
    l_having = 'count(*) >= 1'.
    * THE dynamic select
    SELECT          (lt_sel_list)
           FROM     (p_tabnam)
           INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>.
    *       WHERE    (lt_where).

    Hi Sanket,
    The above given logic of mine works for you, put the code in the If condition and try-
    just like below:
    IF NOT P_EBELN IS INITIAL.
    lt_where = '& = ''&'' '.
    REPLACE '&' WITH p_ebeln INTO lt_where.
    REPLACE '&' WITH field_value INTO lt_where.
    SELECT (lt_sel_list) INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>
    FROM (p_tabnam)
    WHERE (lt_where).
    ENDIF.
    thanks\
    Mahesh

  • In perfdatasource querying for global snapshot failed with error 'the size limit for this '

    I received  scom alerts from two win 2k8 r2 servers , hosting exchange 2010 mailbox roles , the alerts came almost in same time from both servers ,
    can I ignore those alerts
    or can someone give a me a clue how can I troubleshoot those alert , please any help would be appreciated
    In PerfDataSource, querying for Global Snapshot failed with error 'The size limit for this '
    from Ops-mgmt logs 
    Log Name:      Operations Manager
    Source:        Health Service Modules
    Date:          
    Event ID:      10104
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:       server 1
    Description:
    In PerfDataSource, querying for Global Snapshot failed with error 'The size limit for this ' 
    One or more workflows were affected by this.  
    Workflow name: Microsoft.Windows.Server.2008.OperatingSystem.PercentMemoryUsed.Collection 
    Instance name: Microsoft Windows Server 2008 R2 Enterprise  
    Log Name:      Operations Manager
    Source:        Health Service Modules
    Date:          
    Event ID:      10104
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:       server 1
    Description:
    In PerfDataSource, querying for Global Snapshot failed with error 'The size limit for this ' 
    One or more workflows were affected by this.  
    Workflow name: Microsoft.Windows.Server.2008.LogicalDisk.PercentIdle.Collection 
    Instance name:  " edb file path "
    Log Name:      Operations Manager
    Source:        Health Service Modules
    Date:          
    Event ID:      10104
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:       server 2 
    Description:
    In PerfDataSource, querying for Global Snapshot failed with error 'The size limit for this ' 
    One or more workflows were affected by this.  
    Workflow name: Microsoft.Windows.Server.2008.NetworkAdapter.CurrentBandwidth.Collection 
    Log Name:      Operations Manager
    Source:        Health Service Modules
    Date:          
    Event ID:      10104
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:   server 2   
    Description:
    In PerfDataSource, querying for Global Snapshot failed with error 'The size limit for this ' 
    One or more workflows were affected by this.  
    Workflow name: Microsoft.ForefrontProtection.FPE.Server.PerformanceCollection.RealtimeScanMessageRate

    Hi Blake , 
    Thanks for your reply , I appreciate your help  ,
    I didn't put the alert from scom console because they were same as the events ( same source )
    Health Service Modules, I didn't want to spam
    more :-)
    also the two servers encountered the issue were mailbox servers and part of same DAG , it worth mention the alert were resolved
    by Exchange 2010 Correlation Engine service 
    http://blogs.technet.com/b/kevinholman/archive/2010/10/15/clustering-the-exchange-2010-correlation-engine-service.aspx
    http://support.microsoft.com/kb/2592561
    also the Opsmgmt logs are full of waring and error event like 2023 , 21402 ,  21403 , 1207 !!
    Log Name:      Operations Manager
    Source:        HealthService
    Date:          
    Event ID:      2023
    Task Category: Health Service
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      server 1
    Description:
    The health service has removed some items from the send queue for management group "SCOM" since it exceeded the maximum allowed size of 15 megabytes.
    1- alert from console >>
    In PerfDataSource, querying for Global Snapshot failed with error 'The size limit for this '
    One or more workflows were affected by this.
    Workflow name: Microsoft.Windows.Server.2008.OperatingSystem.PercentMemoryUsed.Collection
    Instance name: Microsoft Windows Server 2008 R2 Enterprise 
    EventSourceName: Health Service Modules

  • How to use Field-symbol with dynamic select query

    Can anybody tell me, how to use field-symbols in the dynamic select query.

    FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }.
    1. ... typing
    2. ... STRUCTURE struc DEFAULT dobj
    The FIELD-SYMBOLS statement declares a field symbol <fs>. The name conventions apply to the name fs. The angle brackets of the field symbols indicate the difference to data objects and are obligatory. You can declare field symbols in any procedure and in the global declaration section of an ABAP program, but not in the declaration section of a class or an interface. You can use a field symbol in any operand position in which it is visible and which match the typing defined using typing.
    After its declaration, a field symbol is initial - that is, it does not reference a memory area. You have to assign a memory area to it (normally using the ASSIGN statement) before you can use it as an operand. Otherwise an exception will be triggered.
    eg.
    FIELD-SYMBOLS <fs> TYPE ANY.
    DATA: BEGIN OF line,
            string1(10) VALUE '0123456789',
            string2(10) VALUE 'abcdefghij',
          END OF line.
    WRITE / line-string1+5.
    ASSIGN line-string1+5(*) TO <fs>.
    WRITE / <fs>.
    output:
    56789
    56789
    reward if helpful
    anju

Maybe you are looking for