Fetch from variable (dynamic)

Hi,
I have data with 4 fields in one internal table.
Last field have 108 records.like (040.952,957......).
i want to fetch each record from internal table and concatenate 'A' and lastfield in one variable.
First time variable have value A040.(A040 is a data base table).
i want to fetch all values from A040 with the input of first field of internal table and place it into main internal table.
(each time variable having diferent values,value acts as database table,those are having different structures)
EX:
Main itab.(i written code for itab)
f1       f2    f3      f4
200   1      dfg    040
234   2       dfgh 952
235   3     asd     040
241   5     wer     957
now i need like this.
loop at itab.
concatenate A itab-f4 into V_var.
select * from (v_var)
into ........? (please fill here )
where f1 = itab-f1.
And final output i need.
f1       f2    f3       f4       k1   k2                k 3    k4       k5
200   1      dfg     040     v      a                 cvb   125
234   2      dfgh   952     X       t                         125    material
235   3     asd     040    n       a                  cvn  125
241   5     wer     957    c     material                           123
in variable different values are stored,and those having deiffernet structure.my problem with into statement.
Please help me ....

FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,  
                            <ls_outtab> TYPE ANY,
                              <l_fld> TYPE ANY.
DATA:struct_type TYPE REF TO cl_abap_structdescr,
         comp_tab    TYPE cl_abap_structdescr=>component_table.
Creation of the output table.
struct_type ?= cl_abap_typedescr=>describe_by_name( p_tabnam ).
comp_tab = struct_type->get_components( ),
comp_fld    TYPE cl_abap_structdescr=>component.
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>.
THE dynamic select
SELECT          *   
  FROM     (p_tabnam)   
   INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>  
    WHERE    (lt_where). 
*display of the results
LOOP AT <lt_outtab> ASSIGNING <ls_outtab>.
  LOOP AT comp_tab INTO comp_fld. 
    ASSIGN COMPONENT comp_fld-name OF STRUCTURE <ls_outtab> TO <l_fld>.  
   WRITE: <l_fld>.
  ENDLOOP.  
SKIP.
ENDLOOP.
for more information check
https://webphl07.phl.sap.corp/~sapidb/011000358700002805272003E

Similar Messages

  • Call a Automatic Row Fetch from a Dynamic Action

    Hi,
    can I execute the Automatic Row Fetch from a dynamic action?
    I only found this post (Dynamic Actions to call Automatic Row Processing (DML) but the link where the solution is does not work :(
    Thanks,
    Edited by: Elena.mtc on 09-nov-2012 5:46

    Elena.mtc wrote:
    I forgot to say, for several reasons, I don't want to submit the page. So that's where I find the complexity in calling the ARf.
    Thanks.You cannot fire the ARF because it is designed to run when the page is rendered and it cannot be called as a standalone
    Create a dynamic action as follows to fetch the form detials
    Action: Execute PL/SQL Code
    PL/SQL Code:
    begin
      select ename, job, mgr, hiredate, sal
        into :P4_ENAME, :P4_JOB, :P4_MGR, :P4_HIREDATE, :P4_SAL
        from emp
       where empno = :P4_EMPNO;
    exception
      when others then
        null;
    end;
    Page Items to Submit: P4_EMPNO
    Page Items to Return: P4_ENAME,P4_JOB,P4_MGR,P4_HIREDATE,P4_SAL
    See this working example: http://apex.oracle.com/pls/apex/f?p=32940:4
    Login as test/test
    If you want to make it more dynamic you can query the APEX metadata to find the form items on your current page
    select * from apex_application_page_db_items
    where page_id =:APP_PAGE_ID
    and application_id = :APP_ID;

  • How to fetch indivdual rows from a dynamic query.

    Hi,
    I wish to fetch the individual rows returned from a dynamic query.
    if my dynamic query is:
    dyn_stmt := select col1, col2, col3
    from tab1;
    The query returns multiple rows.
    Then how to fetch individual rows of this query ?
    Please explain.

    declare
      cur_test sys_refcursor;
      c1 varchar2(30);
      c2 number;
      c3 date;
    begin
      dyn_stmt := select col1, col2, col3 from tab1;
      OPEN cur_test FOR dyn_stmt;
      LOOP
        FETCH cur_test INTO c1, c2, c3;
        IF cur_test%NOTFOUND THEN
          EXIT;
        END IF;
        -- Process this row
      END LOOP;
      CLOSE cur_test;
    END;

  • How to fetch env. variable from OC4J instance

    At the launch of my application I want to fetch a variable value we have created on the iAS server at the application's OC4J instance level and under "Server Properties". I am unable to fetch anything using getHttpServletRequest() method. Does anyone know how to access OC4J server environment variables from an application?
    TIA,
    S

    See metalink note 268481.1 Re-creating ASM Instances and Diskgroups.

  • Fetch from cursor variable

    Hello,
    I have a procedure, which specification is something like that:
    procedure proc1 (pcursor OUT SYS_REFCURSOR, parg1 IN NUMBER, parg2 IN NUMBER, ...);Inside the body of proc1 I have
    OPEN pcursor FOR
      SELECT column1,
                  column2,
                  CURSOR (SELECT column1, column2
                                    FROM table2
                                  WHERE <some clauses come here>) icursor1
          FROM table1
       WHERE <some clauses come here>;In a PL/SQL block I would like to execute proc1 and then to fetch from pcursor. This is what I am doing so far:
    DECLARE
      ldata SYS_REFCURSOR;
      larg1 NUMBER := 123;
      larg2 NUMBER := 456;
      outcolumn1 dbms_sql.Number_Table;
      outcolumn2 dbms_sql.Number_Table;
    BEGIN
      some_package_name.proc1 (ldata, larg1, larg2, ...);
      FETCH ldata BULK COLLECT INTO
        outcolumn1, outcolumn2,...,  *and here is my problem*;
    END;
    /How can I rewrite this in order to get the content of icursor1 ?
    Thanks a lot!

    Verdi wrote:
    How can I rewrite this in order to get the content of icursor1 ?
    Firstly ref cursors contain no data they are not result sets but pointers to compiled SQL statements.
    Re: OPEN cursor for large query
    PL/SQL 101 : Understanding Ref Cursors
    Ref cursors are not supposed to be used within PL/SQL or SQL for that matter, though people keep on insisting on doing this for some reason.
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/static.htm#CIHCJBJJ
    Purpose of Cursor Variables
    You use cursor variables to pass query result sets between PL/SQL stored subprograms and their clients. This is possible because PL/SQL and its clients share a pointer to the work area where the result set is stored.A ref cursor is supposed to be passed back to a procedural client language, such as Java or .Net.
    If you want to re-use a SQL statement in multiple other PL/SQL or SQL statements you would use a view.

  • Issue while Passing Values to Variable Dynamically in ODI

    Hi All,
    We are trying to pass values to ODI variable dynamically. The value passed is File path. We are successfully able to achieve this when we are passing the relative path i.e. ‘..\demo\xml’ but while we are trying to pass the absolute path i.e. ‘D:\ODI\oracledi\demo\xml\’ we are getting the below given error in the Load step of the interface..
    com.sunopsis.sql.SnpsMissingParametersException: Missing parameter
    at com.sunopsis.sql.SnpsQuery.completeHostVariable(SnpsQuery.java)
    at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
    at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.i(e.java)
    at com.sunopsis.dwg.cmd.g.y(g.java)
    at com.sunopsis.dwg.cmd.e.run(e.java)
    at java.lang.Thread.run(Unknown Source)
    Googling for the same has yielded the following results :-
    •     if the file name has : in it then ODI will consider it as a binding variable rather path. .. So try relative path. – Relative Path is working but we need to achieve this by giving absolute path.
    •     make sure you are using LKM File to SQL rather SQL to SQL. – We have tried by 3 different LKMS—File to SQL, SQL to SQL and SQL to Oracle but the error is same in all.
    Any pointers regarding the same will be very helpful.
    Thanks In Advance.
    Regards,
    Abhishek Sharma

    Hi Cezar,
    Thanks for the response. The issue here is we are picking this path from a table. We have FILE_PATH column in one database table and in ODI variable we have given SQL query as 'Select FILE_PATH from tablename'. Then we are taking the refresh value of this variable and passing it on to our interface.
    If the Path in table is given as relative path it works , else for absolute path it doesnt work. How can we achieve the solution recommended by you in this case. The FILE_PATH value in table may change, so we need to pick the file from whatever path it fetches from the select statement. Hence we cannot hard code it here.
    Please suggest.
    Thanks Again.
    Regards,
    Abhishek Sharma

  • Help!!! slow fetch from cursor

    I have a problem fetching records from a ref cursor returned by a procedure.
    Basically I play both a PL/SQL developer and DBA roles for a development and production Oracle 9.2.0.6 databases hosted on separate Sun Solaris 5.8 servers. The problem PL/SQL signature is shown below, and it basiccally dynamically constructs a large querry (I will call global querry) which is a UNION ALL of 16 smaller querries and opens the cursor parameter for this dynamically constructed querry. The entire querry is assigned to a VARCHAR2(20000) variable, and is normally a little over 15,000 bytes in size. The returned cursor is used to publish the querry result records in Crystal reports. The problem is that the entire process of executing and fetching the result records from the procedure is taking as much as 25 minutes to complete. On investigation of the problem by executing the procedure with a PL/sql block in sqlplus, and adding timing constructs in the execution of the procedure and fetches from the returned cursor, I discovered to my shock that the procedure executes consistently in 1 second (second is the granularity of the timer), but each record fetch is done in a minimum of 16 seconds. All efforts to tune the database memory structures to improve the fetches have yielded very small improvements bringing down the fetch times to about 11 seconds. This is still unacceptable. Is there anybody out there who can suggest a solution to this problem?
    Procedure signature:
    sp_production_report ( p_result_set IN OUT meap_report.t_reportRefCur,
    p_date_from IN VARCHAR2,
    p_date_to IN VARCHAR2,
    p_agency_code IN INTEGER DEFAULT NULL,
    p_county_code IN INTEGER DEFAULT NULL,
    p_selection IN INTEGER DEFAULT 0);
    Test block in sqlplus:
    declare
    -- Local variables here
    i integer;
    v_start INTEGER;
    v_end INTEGER;
    v_end_fetch INTEGER;
    v_cnt INTEGER := 0;
    v_end_loop INTEGER;
    v_elapsed INTEGER;
    v_cur meap_report.t_reportRefCur;
    v_desc VARCHAR2(300);
    v_hh VARCHAR2(300);
    v_meap INTEGER;
    v_bp INTEGER;
    v_ara INTEGER;
    v_tot INTEGER;
    BEGIN
    -- Test statements here
    DBMS_OUTPUT.ENABLE(100000);
    SELECT TO_NUMBER ( TO_CHAR(SYSDATE, 'SSSSS')) INTO v_start FROM DUAL;
    sp_production_report ( p_result_set => v_cur,
    p_date_from => '07/01/2008',
    p_date_to => '07/31/2008',
    p_selection => 0);
    SELECT TO_NUMBER ( TO_CHAR(SYSDATE, 'SSSSS') ) INTO v_end FROM DUAL;
    FETCH v_cur INTO v_desc, v_hh, v_meap, v_bp, v_ara, v_tot;
    SELECT TO_NUMBER ( TO_CHAR(SYSDATE, 'SSSSS') ) INTO v_end_fetch FROM DUAL;
    WHILE v_cur%FOUND LOOP
    v_cnt := v_cnt + 1;
    FETCH v_cur INTO v_desc, v_hh, v_meap, v_bp, v_ara, v_tot;
    END LOOP;
    SELECT TO_NUMBER ( TO_CHAR(SYSDATE, 'SSSSS') ) INTO v_end_loop FROM DUAL;
    v_elapsed := v_end_loop - v_end;
    DBMS_OUTPUT.PUT_LINE ( 'Procedure (p_selection 0) executed in ' || TO_CHAR ( (v_end - v_start) ) || ' seconds.' );
    DBMS_OUTPUT.PUT_LINE ( 'Fetched 1st record in ' || TO_CHAR ( (v_end_fetch - v_end) ) || ' seconds.' );
    DBMS_OUTPUT.PUT_LINE ( 'Procedure (p_selection 0) :' || TO_CHAR (v_cnt) ||
    ' records fetched in ' || TO_CHAR ( v_elapsed ) || ' seconds.' );
    CLOSE v_cur;
    END;

    And why not use timestamps instead of dates? They get subsecond resolution:
    declare
            t1 timestamp;
            t2 timestamp;
            d1 INTERVAL DAY(3) TO SECOND(3);
    begin
            t1 := systimestamp;
            dbms_lock.sleep(1.45);
            t2 := systimestamp;
            d1 := t2 - t1;
            dbms_output.put_line('Start:    '||t1);
            dbms_output.put_line('End:      '||t2);
            dbms_output.put_line('Duration: '||d1);
    end;
    /As for how to speed up your fetch, that depends on how the SQL the cursor is based on is constructed. Without that you need to refer to Rob's post.

  • Logic for retreiving the values from a dynamic internal table

    Hi all,
    I have an issue with the logic to fetch data from a dynamic internal table into fields. let me give you guys an example the sy-tfill = 9 (subject to vary). I need to populate the fields.
    Regards,
    Sukumar

    Hi,
    this is for printing out the info in a dynamic table,
    it will work likewise to insert data.
    PARAMETERS:
      p_tabnam TYPE tabname DEFAULT 'DB_TABLE_NAME'.
    DATA:
      lv_dref TYPE REF TO data,
      ls_dd03l LIKE dd03l,
      lt_fieldname TYPE TABLE OF fieldname,
      ls_fieldname TYPE fieldname.
    FIELD-SYMBOLS:
      <fs> TYPE STANDARD TABLE,
      <wa_comp> TYPE fieldname,
      <wa_data> TYPE ANY,
      <wa_field> TYPE ANY.
    REFRESH lt_fieldname.
    SELECT * FROM dd03l INTO ls_dd03l
                       WHERE as4local = 'A'
                         AND as4vers  = '0000'
                         AND tabname  = p_tabnam
                       ORDER BY position.
      ls_fieldname = ls_dd03l-fieldname.
      APPEND ls_fieldname TO lt_fieldname.
    ENDSELECT.
    IF NOT ( lt_fieldname[] IS INITIAL ).
      CREATE DATA lv_dref TYPE TABLE OF (p_tabnam).
      ASSIGN lv_dref->* TO <fs>.
      SELECT * FROM (p_tabnam) INTO TABLE <fs>.
      WRITE:
        / 'CONTENTS OF TABLE', p_tabnam.
      LOOP AT <fs> ASSIGNING <wa_data>.
        SKIP.
        WRITE:
          / 'LINE', sy-tabix.
        ULINE.
        LOOP AT lt_fieldname ASSIGNING <wa_comp>.
          ASSIGN COMPONENT sy-tabix OF STRUCTURE <wa_data> TO <wa_field>.
          WRITE:
            / <wa_comp>, <wa_field>.
        ENDLOOP.
      ENDLOOP.
    ENDIF.
    grtz
    Koen

  • How to assign local variable to global variable dynamically in adobe livecycle designer 7.1

    Hi All,
    i want to assign my textfield value to global variable dynamically.so that where ever i want , i will access my global variable.so it is possible in adobe livecycle designer 7.1. kindly suggest me method.Thanks in advance.
    Thanks & Regards
    Ganesh

    Please remove all adobe livecycle designer versions from your local pc.
    restart your pc to be sure, that all temp data is deleted.
    download the newest ald version from service.sap.com and install it.
    have fun with developing adobe forms with sap transaction sfp.

  • To display records fetched from the DB through ALBPM, in a custom JSP

    I want to display the records fetched from the database through ALBPM in a custom JSP as a table.
    Currently I am fetching the records and putting them in a BPM object group and sending it to the JSP as a BPM object. Now in the JSP I am trying to iterate and create a table to display the fetched data using the JSTL tag ==&gt;
    &lt;c:forEach ...... &gt;
    &lt;/c:forEach&gt;
    But I am always getting the following error in ALBPM workspace:
    The task could not be successfully executed. Reason: 'java.lang.RuntimeException: /webRoot/customJSP/CustomerSearch1.jsp(29,2) No such tag forEach var in the tag library imported with prefix c'
    Though there is a tag forEach var in the JSTL?? How to solve this error or is there any altrnative way to display the records in a JSP ??
    Thanks,
    Suman.

    Hello. I use custom JSP and it works well. You have to make sure 2 things:
    a) You have imported the libs, including these lines in your JSP:
    <%@ page session="true" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://fuego.com/jsp/ftl" prefix="f" %>
    b) The variable you are using in the "forEach" statement is stored in the BPM object you pass to the JSP in the call.
    Hope this helps.... Bye

  • How to filter results from 4 dynamic list menus depandant on how many of them are selected

    I have a search page with a form with 4 list menus and 1 submit that post the results to the results page. I can create a record set that either retrieves the correct data from my database if a selection is made from all four menus Or i can create the recordset if only 3 menus have a selection or the same for 2 menus and 1 menu. However i want the user to be able to make a selection from either 1, 2, 3 or all 4 of the menus and the exact data be retrieved. At present if i try to combine the recordset using AND and ORs the results are not specific enough, for example the 4 menus are Location, Type, Price & Style if a user selects from all 4 i only want to retrieve data that matches all 4 criteria, but at the same time if the user selects only 2 of the menus the i want it to retrieve data that matches specifically those 2 variables. I´m not actually sure if i should be creating a more advanced sql query of if its the php side of things that i need to look at. This is my first dynamic site so please be aware i´m still a learner where php and sql is concerned. Please can anyone help?  

    Hey there,
    Thanks for replying,
    I too am using Dreamweaver recordset, my local server is XAMPP ( apache php mysql), i´have pasted my sql recordset below to give an idea of what i´m trying to do, however this does not work as i´m trying to select the exact data based on 4 menus PRICE TYPE LOCATION and BEDS, and also want the search to work if the user only selects options from either 1, 2, 3 or 4 of the menus, with the code as it is if the user select only two options from 2 of the menus the results don´t just find (for example) all results for location AND price they find all results for the location varibale OR the price variable rather than a match for both, if you see what i mean?
    Any suggestions?  
    SELECT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number`
    FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid
    WHERE (location=varloc AND price = varprice AND type=vartype AND beds=varbed ) OR (price=varprice AND location=varloc AND type=vartype) OR  (price=varprice AND location=varloc AND beds=varbed) OR (price=varprice AND beds=varbed AND type=vartype) OR  ( location=varloc AND type=vartype AND beds=varbed) OR  (price=varprice AND location=varloc) OR (price=varprice AND type=vartype) OR (price=varprice AND beds=varbed) OR (type=vartype AND location=varloc) OR (type=vartype AND beds=beds) OR (location=varloc AND beds=varbed) OR (price = varprice OR beds=varbed OR type=vartype OR location=varloc)
    ORDER BY detailstable.trueprice ASC
    Look forward to receiving your thoughts,
    Linda
    Date: Wed, 21 Oct 2009 14:36:33 -0600
    From: [email protected]
    To: [email protected]
    Subject: how to filter results from 4 dynamic list menus depandant on how many of them are selected
    Hiya,
    I'm just doing my first dynamic site too, and am at a similar level to yourself.
    Can you give us more info re the site. What software, eg Dreamweaver etc are you using, and is your server using PHP or ASP etc?
    For what I've used, I amended the SQL side of things in the recordset in Dreamweaver. That way, you can test the SQL as you're setting up the recordset.
    Let me know how you're going on anyway
    Cheers
    Andy
    >

  • Fetch from cursor when no records returned

    Hi,
    I've got the following question / problem?
    When I do a fetch from a cursor in my for loop and the cursor returns no record my variable 'r_item' keeps the value of the previous fetched record. Shouldn't it contain null if no record is found and I do a fetch after I closed and opend the cursor? Is there a way the clear the variable before each fetch?
    Below you find an example code
    CURSOR c_item (itm_id NUMBER) IS
    SELECT DISTINCT col1 from table1
    WHERE id = itm_id;
    r_item  c_item%ROWTYPE;
    FOR r_get_items IN c_get_items LOOP
      IF r_get_items.ENABLE = 'N' THEN       
          open c_item(r_get_items.ITMID);
          fetch c_item into r_item;
          close c_item;
          IF  r_item.ACCES = 'E' then
               action1
          ELSE                 
               action2
          END IF;
      END IF;
    END LOOP;  Thanx

    DECLARE
        CURSOR c_dept IS
          SELECT d.deptno
          ,      d.dname
          ,      d.loc
          ,      CURSOR (SELECT empno
                         ,      ename
                         ,      job
                         ,      hiredate
                         FROM   emp e
                         WHERE  e.deptno = d.deptno)
          FROM   dept d;
        TYPE refcursor IS REF CURSOR;
        emps refcursor;
        deptno dept.deptno%TYPE;
        dname dept.dname%TYPE;
        empno emp.empno%TYPE;
        ename emp.ename%TYPE;
        job emp.job%TYPE;
        hiredate emp.hiredate%TYPE;
        loc dept.loc%TYPE;
    BEGIN
       OPEN c_dept;
       LOOP
         FETCH c_dept INTO deptno, dname, loc, emps;
         EXIT WHEN c_dept%NOTFOUND;
         DBMS_OUTPUT.put_line ('Department : ' || dname);
         LOOP
           FETCH emps INTO empno, ename, job, hiredate;
           EXIT WHEN emps%NOTFOUND;
           DBMS_OUTPUT.put_line ('-- Employee : ' || ename);
         END LOOP;
      END LOOP;
      CLOSE c_dept;
    END;
    /like this...

  • Getting the value of variable dynamically

    Hi Gurus,
    How can i get a value of a variable dynamically through user input?Is it possible to get it interacively?
    my reqiurement is to control my loop according to the user supplied value for the flag variable.
    if the user gives the flag as 'Y' loop should continue.else loop should terminate in a PL/SQL block
    here is a piece of code
    CREATE OR REPLACE procedure c is
    flag1 varchar2(10):='Y';
    begin
    while flag1 <> 'N' loop
    dbms_output.put_line('Enter the value.....' );
    +*<< Here I have to get the value of flag1 from user .How to get the user value>>*+
    end loop;
    end;
    Please advice
    Edited by: user5203944 on Nov 18, 2008 3:01 AM

    To add my 2 cents worth you can not get where you want with sqlplus calling PL/SQL
    You have 2 problems
    SQLPLUS has no loop construct and not much in the way of conditional capabilities.
    PL/SQL can not talk to a terminal.
    If you use an &variable in an anonymous block, it is evaluated by sqlplus before the parse of the block takes place.
    Nothing you do in the block can change its value.
    dbms_output.put_line buffers everything output to it and then sqlplus outputs it all after the block completes.
    You can accept variables in sqlplus and pass them into an anonymous block for use, but you would have to exit the block if you wanted to ask something based on a condition determined in the block. You would then have no way to re-enter that block within the sqlplus session.
    Host language programs do not have this problem. You can use ProC ProCOBOL, OCI, Visual Basic, and web interfaces.
    Unless you are on windows you can use a shell script (Unix, Linux or VMS) to do what you want.
    You can accept the variable in the script within a loop. You can call sqlplus silently passing the variable on the command line. You can use the variable command to define variables that will be set in pl/sql blocks use selects of these :variables to set defined sqlplus &variables. You can spool files that will then be processed by the shell language. All this can be done in that shell loop.
    In other words you can do anything you need. You do need to understand your tools and their limitations. You can not use sqlplus commands in pl/sql for example.
    Edited by: Old DBA on Nov 18, 2008 7:31 PM

  • Can data be fetched from Oracle Database to ApEx websheets?

    Hi,
    Oracle 11g R2
    ApEx 4.2.2
    We are in need of giving an MRU form for the customized data by the users. The number of columns will be defined dynamically by the end user. We thought of using apex's standard tabular forms, but they cannot have dynamic columns. We also thought of having manual tabular forms using apex collections, but there is a limitation that the collection can have maximum of 50 character datatypes, 5 numeric, 5 date and 1 each for clob and blob. The number of columns at runtime may exceed these numbers. so we ruled out this. We then thought of using apex websheets. We know that the data can be fetched from Oracle database to websheet reports, but the reports cannot be edited. We know that the data grid gives option to edit the data, but I couldnt find a way to fetch the data from database to it.  I understand that the data in the apex websheets can be queried from apex's meta tables apex$_ws_... views and somehow in a back door way of doing these can be updated to the business tables. But we also need to fetch the data  from Oracle database to the grid. I do not want to insert into the apex$_ws tables as Oracle does not support it. Is there any other possibility?
    Thanks in advance.
    Regards,
    Natarajan

    Nattu wrote:
    Thanks for your reply. Actually it is a data that is fully customized by the end user. These custom attributes are really stored as rows and a complex code returns them as columns at run time. So the number of columns is different user to user based on the number of rows they have.
    They'd never have got that far if I'd been around...
    They now want to edit them in a tabular form as well.
    Well once you've implemented one really bad idea, one more isn't going to make much difference.
    It rather sounds like you've got people who know nothing about relational databases or user interfaces responsible for the design of both. You need to be very, very, worried.

  • Perofrmance issue on data fetch from db table

    Dear Experts,
    I have one requirement which explained below step wise.
    Step - 1 : I have a parameter on selection screen from where i ll get my ebeln value (User Input field) and that ebeln i ll check in ekpo table for validations.
                  If valid i  keep it in a variable gw_ebeln.
    Step - 2 : Need to fetch lifnr fron ekko based on gw_ebeln value.
    Step - 3 : Need to fetch adrnr from lfa1 based on lifnr (Previously fetched from ekko table in step 2)
    Step - 4 : Need to fetch email field from adr6 table based on adrnr value (Previously fetched from lfa1 table in step 3)
    Step - 5 : Now for these mail id , I need to send mail by given fm.
    My question is : I can create structure for step 2 , step 3, step 4 and by using " for all entries " in select statement i ll fetch my mail id in step 4.
    So instead of creating structure and then use for all entries , I can fetch by using "select single" statement for step 2 , step3 step 4.bcz i am fetching only one field from all 3 table.
    So which one is better performance wise and why ?
    I need more and clear clarifications on these difference.
    Please provide me suggestions.
    Thanks & Regards,
    Ajit Sarangi

    Hi Ajit,
    We are referring item table EKPO. Multiple entries are possible.
    To append the values in final internal table, we are going to process the LOOP. Inside loop, we should not use the Select statement, that decreases the performance. Database Interaction process should not done inside Loop...Endloop.
    That's why we are creating the Internal table for processing the values. Since we need limited number of fields in the particular table, we are creating our own structure in the program.
    For this case, For all entries will give better performance with compare to Select Single.
    Regards
    Rajkumar Narsimman

Maybe you are looking for

  • I have multiple phones, how do i set them all up on icloud?

    Is there a way to set all phones up in one iCloud, or does each phone have to be set up separately?

  • ITunes 11.1.4.62 my iPhone 3GS.

    I have upgraded to iTunes 11.1.4.62 and it no longer recognizes when I connect my iPhone 3GS. Windows 8.1 recognizes it ok. iTunes has no problem syncing my ancient iPod. I have tried reinstalling iTunes, deleting all iTunes programmes and drivers an

  • How to show image from within a symbol

    Howdy, EA, Win7 I've imported an img on to my stage, converted it to a symbol (and unchecked autoplay). Then I deleted the img from the stage, the symbol w/img still remains in the Assets > Symbols section. What I want to do now is simply have the im

  • Startup error: this version is not correctly localized.  Use the English version.

    I have Itunes running on Win7 ;  its my home laptop (lenovo G770).  A PC-tech cleaned up my registry and shrank my bloated list of startup programs.  After that was done, my laptop booted better.  However, iTunes won't start: the message is "This ver

  • Combining several songs into one album

    I have numerous songs from different artists that I want to combine into one album, so that when I browse using either Cover Flow or Album View, all those songs will be listed under one album. After over two hours of searching on the Internet I found