Pl/sql process select into

hi all
i created some items on page
p102_a1,p102_a2,p_102_a3....p102_a6
i want to do a process before header with a loop which will insert to this items some value from table
for i in 1..6 do
loop
select employee_id
into :p102_a ||to_char (i)
from employees where serial = 1
so he will insert to all the items(p102_a1..p102_a6) the employee_id
which returns only one row and the same row
is it possible to do such a thing in pl/sql ?
please help
thanks

"user622321",
You are exhibiting very, very, bad manners here on this OTN forum. You've been posting the same questions (about Application Express) in the Database forum, the 10g Grid Control forum, and here. Then in this forum you found an existing thread that had nothing to do with your question, then you changed the subject of the thread and tacked your question on the end. What are you thinking?
Finally, your questions are unclear. They are the kind of questions that invite others to do work for you, first by requiring them to ask you for more information. For questions like this, you should write one or two very clear paragraphs describing your situation, explain what approaches you have already tried or thought about, and what specific aspects you need help with.
You need to go to the Application Express home page (http://www.oracle.com/technology/products/database/application_express/index.html) and look through all the links, especially the Documentation and Tutorials resources. Complete the 2-Day Plus Developer's Guide and look at the Advanced Tutorials. Download the User's Guide and study it.
Finally, change your handle so that it shows a friendlier name, preferably one that includes your first name. Also put at least your first name in your profile.
If you will please abide by rules of etiquette like these and show that you are willing to put in some work on your end, you'll find the contributers here very helpful and friendly. And most of them aren't even as grumpy as I am.
Scott

Similar Messages

  • MS-SQL - Oracle SELECT INTO conversion problem...

    Under MS-SQL (T-SQL) Select statement is defined as follows:
    SELECT select_list
    [INTO new_table_]
    ^^^^^^^^^^^^^^^^^^^^^
    FROM table_source
    [WHERE search_condition]
    [GROUP BY group_by_expression]
    [HAVING search_condition]
    [ORDER BY order_expression [ASC | DESC] ]
    Q:How under PL/SQL can one redirect sorted (ORDERed BY) results
    from SELECT query to another table.
    Slawek
    null

    I have asked the question because of the following reason:
    I have a large select query that returns rows from a table in
    different sort orders depending on user inputs, and I wonder if
    there is any way to return just the rows between two specified
    positions.
    I figured that I'm going to either create one temporary table
    with all the data (1000 records for example), sort the data in
    the prefered order and use the rownum method to obtain the row
    range (works fine under T-SQL). Other way is to try an inline
    view that return the rownumber. I can then restrict the numer of
    fields, e.g.
    select empid, rowNumber from emp,
    (select empid as id, rownum as rowNumber from emp) x
    where empid = id
    and rowNumber between 2 and 5
    The problem is that under Oracle the subquery is not allowed to
    have an ORDER BY clause (even if it had, rownum reflects row
    numbers before they were sorted) and there is no SELECT into
    TABLE_NAME.
    Michael Malicky (guest) wrote:
    : Slawek (guest) wrote:
    : : Under MS-SQL (T-SQL) Select statement is defined as follows:
    : : SELECT select_list
    : : [INTO new_table_]
    : : ^^^^^^^^^^^^^^^^^^^^^
    : : FROM table_source
    : : [WHERE search_condition]
    : : [GROUP BY group_by_expression]
    : : [HAVING search_condition]
    : : [ORDER BY order_expression [ASC | DESC] ]
    : : Q:How under PL/SQL can one redirect sorted (ORDERed BY)
    results
    : : from SELECT query to another table.
    : : Slawek
    : Order by is irrelevant when creating a new table out of a
    : query, as the rows are NOT stored in any order in a table.
    : The syntax for creating a new table out of an existing one
    : is:
    : CREATE TABLE new_table AS
    : SELECT select_list FROM old_table
    : WHERE ...
    : etc.
    : /mike
    null

  • "Select * into table internal_table from database_table" in native SQL

    Dear All,
    Is it possible to insert into internal table from database table in native sql instead of open sql? Regarding single values it's clear, just to use ":variable_name". But how to map internal table? RDBMS Oracle version > 9. If it's possible and you know how to do it, please, give some code example.
    Thank you,
    Pavel

    Hi ,
    Here is the code snippet for the native sql .
    select * from zwf_role into table i_wfroles." where role_id ='CAO'.
      loop at i_wfroles into wa_wfroles.
        EXEC sql.
          insert into   ROLES_MASTER_SAP
                 values (:wa_wfroles-ROLE_ID,:wa_wfroles-ROLE_NM,
                        :wa_wfroles-ROLE_DESC,:wa_wfroles-PAR_ROLE_ID,
                        :wa_wfroles-WF_ROLE_ORDER,:wa_wfroles-ROLE_TYPE )
        ENDEXEC.
        if sy-subrc = 0 .
          suc_rec_cnt = suc_rec_cnt + 1.
        else.
          fail_rec_cnt = fail_rec_cnt + 1.
        endif.
    *              ( ROLE_ID,ROLE_NAME, ROLE_DESC,PARENT_ROLE_ID,ROLE_ORDER,
    *                  ROLE_TYPE )
      endloop.
    zwf_role database table has the same files
    Regards
    Girish

  • SQL: select into

    Hello. In both sybase and sql server, you
    can create on-the-fly tables in sql by
    simply doing a
    select column
    into newtable
    from oldtable
    where blahblahblah
    When I do the same in sql (not pl/sql)
    I get the following error:
    SQL> select empno
    2 into myemp
    3 from emp
    4 where ename = 'SMITH';
    into myemp
    ERROR at line 2:
    ORA-00905: missing keyword
    Is it possible to do this kind of select into
    in Oracle?
    Thanks!

    I believe the syntax you're looking for is:
    create table <tablename>
    as select *
    from (<original statement>)
    More examples are available in the Migration Workbench docs

  • How to SELECT * into a SQL table incremntally by date?

    I have a SQL Server table called "tblProducts".
    Sometimes I backup this table by making a copy of it with this simple query:
    SELECT *
    INTO [test01].[dbo].[tblProducts_20141206]
    FROM [test01].[dbo].[tblProducts]
    Every time when making a backup, the date is included in the table name.
    I would like to create a SQL Job that runs this kind of query once every week.
    Is it possible to maybe in a stored procedure or declaring a variable to achieve this that allows the backed-up table name to be named like [tblProducts_todaysDate]?
    Thanks.

    hi ,dchencm
    i just want to point out the some bad effect of this pratice
    first point is
    when your db has be corrupt,your backup out of work
    i think you should backup your table to other db ensure that when your db has be corrupt you still have real backup
    just like
    SELECT *
    INTO [test01_backup].[dbo].[tblProducts_20141206]
    FROM [test01].[dbo].[tblProducts]
    another point is your pratice is total amount of backup not  incremental backup
    when your table  become bigger and bigger ,and then the number of record reach several million or several ten million or several hundred million, you must import all  data the table have
    so, this is not a good idea
    i just suggest  apply replication or logshipping etc to copy the diff data the table proceded is the better
     the steps of detail  as following
    step 1
    USE [test01]
    GO
    /****** 对象: StoredProcedure [dbo].[sp_ImportBackupData] 脚本日期: 12/25/2010 16:47:49 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[sp_importbackupdata]
    AS
    BEGIN
    BEGIN
    DECLARE @date DATETIME ,
    @sql VARCHAR(1000)
    SET @date = GETDATE()
    SET @sql = 'SELECT * INTO [test01].[dbo].[tblProducts_'
    + CONVERT(VARCHAR(8), @date, 112)
    + '] FROM [test01].[dbo].[tblProducts]'
    EXEC (@Sql)
    END
    END
    step 2
    USE [msdb]
    GO
    /****** 对象: Job [import data] 脚本日期: 02/22/2011 09:22:44 ******/
    BEGIN TRANSACTION
    DECLARE @ReturnCode INT
    SELECT @ReturnCode = 0
    /****** 对象: JobCategory [Database Engine Tuning Advisor] 脚本日期: 02/22/2011 09:22:44 ******/
    IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'Database Engine Tuning Advisor' AND category_class=1)
    BEGIN
    EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=N'Database Engine Tuning Advisor'
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    END
    DECLARE @jobId BINARY(16)
    EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'sp_importbackupdata',
    @enabled=1,
    @notify_level_eventlog=0,
    @notify_level_email=0,
    @notify_level_netsend=0,
    @notify_level_page=0,
    @delete_level=0,
    @description=N'sp_importbackupdata',
    @category_name=N'Database Engine Tuning Advisor',
    @owner_login_name=N'sa', @job_id = @jobId OUTPUT
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    /****** 对象: Step [import data] 脚本日期: 02/22/2011 09:22:44 ******/
    EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'import data',
    @step_id=1,
    @cmdexec_success_code=0,
    @on_success_action=1,
    @on_success_step_id=0,
    @on_fail_action=2,
    @on_fail_step_id=0,
    @retry_attempts=0,
    @retry_interval=0,
    @os_run_priority=0, @subsystem=N'TSQL',
    @command=N'exec sp_importbackupdata',
    @database_name=N'sss',
    @flags=0
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N'import frequency',
    @enabled=1,
    @freq_type=8,
    @freq_interval=2,
    @freq_subday_type=1,
    @freq_recurrence_factor=1,
    @active_start_time=20000
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)'
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    COMMIT TRANSACTION
    GOTO EndSave
    QuitWithRollback:
    IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
    EndSave:
    the schedule time is 2 am  in the midnight  every monday 
    Certainly, you can edit it for yourself

  • Pl/SQL Select Into

    Hello,
    is there a difference between the command 'select into' in Regions with 'pl/sql function returning Query' and 'Pl/sql amonymous block'.
    select MAX(maxgroups) into groupno from Table where trackid=:P_ITEM2 and col1=:P_ITEM2;
    This statement works only in the Region-'Pl/sql amonymous block.
    Can somebody help me please,
    I really can't find the reason!
    Moni

    Hi Marc,
    I' ve found out that the select statement works, the problem is that the items have no value.
    When I display the content of the item in the Region-Topic ‚Test – &P32_Item.’ it is displayed correctly.
    Maybe I’m calling the item in the pl/sql in a wrong way??
    lg
    Moni

  • Using SELECT INTO statement to transfer data from one DB to another?

    Hello,
    I need to move data from an SAP table to another downstream SQL server box without flat file in between. I have set up the DBCON interface, so that my ABAP code on SAP can connect to the remote SQL Server, then I can run INSERT command as Native SQL inside the ABAP.
    However, INSERT has performance problem. The best performer as I can find is SELECT INTO statement. But then I am stuck at how to use SELECT INTO to query my local SAP table and send (via INTO) to remote database. I am not even sure whether I should use Open SQL or Native SQL.
    Any suggestion? BTW, I understand the limitation of Native SQL, but we are OK to use it.
    Thanks!

    It appears that this is some kind of migration project due to the scope of the data contained in the single file? If so whatever you do is like ly to be trow away once the migration of data is completed.
    You have a couple of options:
    1) Get the data extracted from HFM in multiple files instead of one bulk file, broken down by scanario,year & period
    2) Take the single data dump file produced by FDM and manipulate it yourself to get the data in a more usuable format for processing through FDM.
    Option 2 could be achieved via any ETL tool or a custom file parsing script. What may be more attractive to you and allow you to fully leverage your investment in FDM is that you could use the PULL adapter that ships as part of the FDM adapter suite to perform this transformation exercise. The PULL adapter takes a flat file input and allows you to use all the in built functionality of FDM to transform it and output a modified flat file (or series of flat files). You could use it to produce multioload files or a series of files broken down by scenario,year,period.
    Whatever you do I would suggest that break the single data file down into smaller chunks as this will help with the iterative debugging process you will inevitably have to undetake whislt migrating the data to the new application.

  • #FLOW_OWNER#  in pl/sql process

    I am trying to use #FLOW_OWNER# substitution string in pl/sql processes so I dont have to hard code the schema name. This substitution string works fine if I use it in a report for example 'select * from #FLOW_OWNER#.APEX_APPLICATION_PAGE_IR_COL'
    However if I use it an insert in pl/sql process, I get the following error.
    ORA-06550: line 5, column 2: PL/SQL: ORA-00911: invalid character ORA-06550:
    Here is the code
    insert into ssm_help(application_id,application_item_id,help_item,help_desc,help_type_id)
    (select :P11_APPLICATION_ID, :P11_APPLICATION_ITEM_ID, report_label,'Enter Help',(select help_type_id from ssm_help_type where help_type_code='REPORT_COLUMN')
    FROM
    #FLOW_OWNER# .APEX_APPLICATION_PAGE_IR_COL;
    Any ideas what the problem is ? Thanks.

    Hi,
    I once used the global substitution variable APEX_APPLICATION.G_FLOW_SCHEMA_OWNER, but I had to encapsulate the query in an EXECUTE IMMEDIATE block.
    Here's my example:
    DECLARE
      l_flows_owner VARCHAR2(32);
      l_query VARCHAR2(2000);
      l_count NUMBER(10,0);
    BEGIN
      l_flows_owner:=APEX_APPLICATION.G_FLOW_SCHEMA_OWNER;
      l_query:='SELECT COUNT(DISTINCT APPLICATION_ID)
                FROM '||l_flows_owner||'.APEX_APPLICATIONS';
      EXECUTE IMMEDIATE l_query INTO l_count;
      RETURN l_count;
    END;This will work in your case too.
    -Udo

  • Dynamic SQL in PL/SQL process

    Hi all,
    I just found out Dynamic SQL doesn't work in PL/SQL process.
    working example using SQL:
    declare
    retval number;
    begin
    select count(*) into retval from emp;
    :P1_EMP_COUNT := retval;
    end;
    NOT working example using dynamic SQL:
    declare
    retval number;
    l_sql varchar2(4000);
    begin
    l_sql := 'select count(*) into retval from emp';
    execute immediate l_sql;
    :P1_EMP_COUNT := retval;
    end;
    What have I done wrong? Could anyone please help?? :)
    Chris

    Hi Jarola,
    Actually, your version works just as well. I had a typo in my code so I got a typo... Thank you very much. Now I got 2 version of codes that works... Sorry about the fact the Since I mark the other suggestion as "Correct", I can only mark your post as "Helpful" but yours is actually "Correct" just as well... How can I somehow get you the credit you deserved? Please let me know, Okay? Thanks again...
    Chris :)

  • Javascript in pl/sql process block

    Hi,
    Can someone please tell me why this code is not working.....
    I have put this in my pl/sql process....
    htp.p('<script language=javascript>');
    htp.p('var r=confirm("This is a duplicate record , do you want to proceed?");');
    htp.p('if (r==true)');
    htp.p('{document.wwv_flow.submit();}');
    htp.p('else{ }');
    htp.p('</script>');
    Please help
    thanks and regards,
    deepa

    What you need, in your case, is the reverse approach
    – calling PL/SQL from JavaScript code – which is
    possible, using AJAX...
    It seems like what you are trying to do is a
    validation process. Pressing the button should fire a
    JavaScript code, which in turn will fire an on-demand
    PL/SQL procedure, and according to the returned
    results will display a confirm dialog boxHi Arie,
    This is exactly what I am struggling to do, but I don't think is working...is there a good example somewhere, with good documentation saying what goes where? I've tried looking at Carl's On-Demand page example and I just can't tell if I'm following it correctly.
    Based on what is entered in P4_PROJECT_NUM, I need to verify that the value isn't already in the database when the user tabs out of the field.
    My javascript for page 4 (in HTML Header):
    function checkCO()
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=validate_value',4);
    get.add('ID', $x('P4_PROJECT_NUM').value)
    gReturn = get.get();
    if(gReturn) // if function return true
    alert($x('P4_PROJECT_NUM').value + ' already exists in database.');
    get = null;
    //-->
    </script>
    My onDemand process, from the Application Processes:
    declare
    v_count number;
    cursor cr_check_co is
    select count(*)
    from usd_changeorders
    where chg_ref_num = v('ID');
    begin
    open cr_check_co;
    fetch cr_check_co into v_count;
    close cr_check_co;
    if (nvl(v_count, 0) = 0) then
    return true;
    else
    return false;
    end if;
    end;
    I am calling the javascript from the onBlur event of the field I want verified.
    I am getting an alert, but it is displaying every time, whether the value is valid or not.
    Can you tell me what I am doing wrong?
    Thanks!!
    Janel

  • Refreshing Page after PL/SQL Process Completes

    Reader's Digest Condensed Version: I have been unsuccessful searching the forum for a method to Refresh the current page AFTER the execution of a PL/SQL Process defined on the same page.
    War & Peace Version: I have a page which displays multiple records for editing on P1001. I also utilize a checkbox in combination with a button to perform some intermittent steps. Essentially, the user selects a row to "clone" by checking the appropriate checkbox and clicking the "clone" button. The first thing the button executes is a JavaScript function on page P1001, which calls a popup window (P1010) so the user can select a new value for the primary key. This is required to maintain data integrity of course and avoid duplicate records. Page P1010, contains two text fields with Popup links for each. The user can either enter their values directly, or use the link which will calls another JavaScript function to call a popup page P2 to display the results of an SQL query. Once the user makes their selections, another JavaScript function on P1010 passes back the selected values and stores them in hidden variables on P1001. At this point, I want my PL/SQL process, CLONE_RECORD, to execute examining the values from the record to-be-cloned and the new primary key values. The PL/SQL checks the database to see if the record already exists. If it does not, then validation of the data occcurs and a SQL insert string (myInsertSQL) is generated. I then "execute immediate myInsertSQL;" and "commit;" from within my PL/SQL. The procedure terminates, and at this point I want the original page P1001 to refresh. If the insert was successful, the new cloned record should be displayed along with the other previously displayed records.
    I am having issues with the timing because I am able to insert the cloned record into the database, but I have to manually refresh my page to see the resulting new record. I know that PL/SQL is executed on the server and that JavaScript is executed at the browser, but how can I synchronize my process, or at least perform an HTML POST(?) to refresh the page at the end of my PL/SQL procedure?
    As always, any assistance is greatly appreciated.
    MovingTarget
    PS. I am using HTMLDB 2.0 so please be kind.

    MovingTarget,
    Before I get into this I want to make sure you understand that in general, unless it's a really long process, you want the submitting page to have an On Submit process that calls your PL/SQL process. Then you can provide a branch back to the same page if you like or to any other page for that matter. Also, the PL/SQL error handling in ApEx is not too great right now but there are plans to improve it in the next version. In the mean time you have to use some tricks if you want to display "pretty" messages on exceptions.
    I'll tell you how I would approach this and let you tell me why it would not work or what I'm not getting...
    You have a main page, that in order to submit, needs a pk value populated from a popup (pu1), which in turn calls another popup (pu2). I'll create an imaginary situation in which I might have the same pages... I'm populating a users table (legacy) with a pk that is a combination of the employee's dept and name. The pu1 shows departments and pu2 shows emps in those departments.
    So, I click "add new user", then click on a button that opens pu1. I see the departments and then click on another button that opens pu2 to see the names. I click on a name and user JavaScript to close the popups and populate and item on the parent page with a string that is made from the employees department and name. NOW I click "save". The page submits and calls a PL/SQL process that passes in the values from the parent page to the INSERT process. After the process is run a branch redirects the user back to the same page and displays the success message from the PL/SQL process.
    I hope that didn't just make things worse! lol
    Dan

  • Page having PL/SQL process and Automatic Row Process for 2 different tables

    Hi,
    I have a page containing 2 regions A & B.
    Region-A content would be updated to table T1(PK : Ticket#).
    Region-B content would be inserted into table T2(PK: Attachment# ; FK: Ticket#).
    Region-B is used for uploading a file content into T2.
    Since I cannot use 2 DML processes on the page for 2 different tables with a common column, so I have a PL/SQL process to update the record into T1 and an Automatic Row Process(DML) for inserting into T2.
    Now the issue is in Region-B when I select a file using 'Browse' button and click on Upload button to fire the Automatic Row Process, the success message is displayed but the file is not uploaded into the table. But when I moved the entire Region-B and the Automatic Row Process to a different page and clicking Upload is working fine and inserting the record into the table along with the file content.
    An item P10_TICKET_NUMBER with source type as Database column with source value as TICKET_NUMBER is used in Region-A.
    I have gone through the forums and found some of the threads below
    Re: 2 Automated Row Processes for one page?
    Re: Error when trying to create 2 Forms on same page on 2 tables with ID as
    where people facing similar issues but here I have followed the solution provided(with one PL/SQL process and other Automatic process) in the threads but still issue persists.
    Can anyone throw some light on this please.
    Thanks,
    Raj.

    Hi Teku,
    You just have a look at this thread, where u can find a solution for your problem.
    INSERTING Records into Second table based on First table Primary Key
    hope this helps.
    Bye,
    Srikavi

  • PL/SQL Process Error

    Hello All,
    I am creating my first PL/SQL Process in APEX and I am having some issues. The Code is as follows:
    DECLARE
    a INT;
    BEGIN
    Select ON_TRACK_NUM INTO a from TBL_CMR_TRIAL Where PK_TRIAL = 2;
    IF a=1 THEN UPDATE TBL_CMR_PROJECT
    SET ON_TRACK = 'Yes'
    WHERE PK_PROJECT = :P4_FK1_PROJECT;
    ELSEIF a=0 THEN UPDATE TBL_CMR_PROJECT
    SET ON_TRACK = 'No'
    WHERE PK_PROJECT = :P4_FK1_PROJECT;
    END IF;
    END;
    I have larger plans for this code but this is the first step where I have hard coded in the number 2. Pretty much it is supposed to look at the ON_TRACK_NUM field for this particular row and if it is 1 change another field in another table to Yes or if 0 then No.
    The errors I am getting are:
    1 error has occurred
    ORA-06550: line 12, column 8: PLS-00103: Encountered the symbol "A" when expecting one of the following: := . ( @ % ; ORA-06550: line 17, column 4: PLS-00103: Encountered the symbol ";" when expecting one of the following: if
    I feel like I am probably really close to getting this right but I have some small syntax wrong. Could anyone please take a look and give a hand? Thanks.

    You can't use a as a variable name. Try a_num.
    DECLARE
       a_num int;
    BEGIN
       Select ON_TRACK_NUM
         INTO a_num
         from TBL_CMR_TRIAL
        where PK_TRIAL = 2;

  • Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

    Apex 4.1
    Oracle 11g
    I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
    Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
    Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
    I tried creating a dynamic action for on click of the add button but get the following error:
    The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
    I went to the templates and found:
    Substitution Strings
    Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
    Substitution String
    Referenced
    From
    Description
    #LINK#
    Yes
    Template
    To be used in an "href" attribute
    #JAVASCRIPT#
    No
    To be used in an "onclick" attribute
    #LABEL#
    Yes
    Template
    Button Label
    #BUTTON_ATTRIBUTES#
    No
    Button Attributes
    #BUTTON_ID#
    No
    Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
    I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
    Suggestions please on how to fix the template or change the P400_DISPLAY value?

    The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
    So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
    What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
    Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
    Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
    Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
    See the problem?
    Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
    I bet it is the first issue but, take a look at these.
    Cheers,
    -Joe

  • Select Into statement in db function - query from granted schema table

    problem with "select into" in db function in 10.2
    There are two schemas. 'mdbdev' is the master database and 'devusr' is granted SELECT table access to execute queries in mdbdev schema.
    with devusr, in SQL, I'm able to execute the following query
    select wm_concat(strConcatedCountryList)
    from (select country_name as strConcatedCountryList from mdbdev.country_master mdbcm
    where mdbcm.country_ship_status = <param?>
    order by country_name)
    but when I use the same query in function/procedure with "select into", the compilation failed with error *"table or view does not exist"*
    FUNCTION GETCOUNTRYLISTTOSHIP (SHIP_STATUS IN NUMBER)
    RETURN VARCHAR2
    IS
    var2CountryList VARCHAR2(1000);
    BEGIN
    select wm_concat(strConcatedCountryList) INTO var2CountryList
    from (select country_name as strConcatedCountryList from mdbdev.country_master mdbcm
    where mdbcm.country_ship_status = <value of SHIP_STATUS>
    order by country_name);
    return var2CountryList;
    END;
    Please advise/help/hint :)

    David, Justine, Thank you. The facts from this forum post helped a lot to get the solution.
    The query helped a lot (select * from all_tab_privs_recd where owner = 'MDBDEV' and table_name = 'COUNTRY_MASTER").
    there was a grant using ???(donno wht DBA said) and no direct SELECT grant on that country_master to "devusr". grant command executed. Now, it works :)

Maybe you are looking for