Error using Page Items in PL/SQL Triggers

Hello all,
I am trying to use a page item value in my PL/SQl trigger statement.Following is my trigger
create or replace TRIGGER "cts_apps_temp_insert"
BEFORE INSERT ON CTS_APPS_TEMP
FOR EACH ROW
DECLARE
vComputer_ID NUMBER;
vTemp varchar(200);
BEGIN
select computer_id into vComputer_ID from cts_hardware_info where computer_name = v('P105_DEVICE_NAME');
INSERT INTO CTS_SERVER_APP_CUSTOMER(SERVER_ID,DEPT_APP_REL_ID,TECHNICAL_MANAGER,FUNCTIONAL,APPLICATION_COORDINATOR,MODIFYUSERID,DATEOFMODIFICATION)
VALUES (vComputer_ID,:NEW.DEP_APP_REL_ID,:NEW.TECHNICAL_MANAGER,:NEW.FUCNTIONAL_MANAGER,:NEW.APPLICATION_COORDINATOR,v('APP_USER'),sysdate);
END;
But am getting an error when I try to insert the data from the form
ORA-01403: no data found ORA-01403: no data found ORA-06512: at "ESDBA.cts_apps_temp_insert", line 5 ORA-04088: error during execution of trigger 'ESDBA.cts_apps_temp_insert'
Error Unable to process row of table CTS_APPS_TEMP.
OK
I tried printing the value of v('P105_DEVICE_NAME'); from a pl/sql block...It doesnt print anything..
Can anyone please tell mw why the page item value is becoming null?
Is there any other way I can use the Page item value in the trigger?
Thanks in Advance,
Nehal
Edited by: user11122439 on Jun 23, 2009 11:27 AM

Thanks for helping me out Tony.
It is a single row form. But the same form is used many time to add records for that particular server..
In the first form the user enters the server details. In the second form they need to associate applications with the server name they entered in the first form.
They can add any number of such applications.
The contenst in my form are
Server_name: ( read only field populated by the name they entered in the first form)
application_name:
Manger1:
Manager2:
When the user clicks on add button the applcaition should be associated to the server he added in the first form.For this I need the Id of the Server_name he added in the first form.
I also need to store this info in a temporary table apart from the original Server-App relationt able. Thats the reason I had database trigger which was also adding stuff to a temporary table apart from adding the relationships to the main table.
But even if we frget about hte temporary table can you please tell me how I can use the Page item value in form 1 and get its id from database and use it to insert server-app relation in second form?

Similar Messages

  • Enhancement Request : Subscriptions where IR uses Page Items.

    I'd like to request an Enhancement.
    I'd like report subscriptions to keep track of the current values of any page items in the sql statement when the subscription is stored.
    Currently any Interactive Reports that use page items run fine interactively, but subscriptions fail due to the page items having no values.

    Oh ok I see what you're trying to do but that's not what I meant.
    1. If your IR filters based on a page item and is a subscribable report, you have no choice but to work a NVL (or some other means) in there in order to make a true condition when the page item is null or nonexistent in order for the report to work at all during subscription.
    2. If you never want the user to be able to query all rows in the application (that is, force them to enter something in the page item), you'll need a not-null validation on the page so when they submit their page item change that it validates not-null.
    3. Use the filter in the IR (but NOT referencing a page item) such that the user can save/subscribe to an IR with the desired filter such that they get the properly-filtered named IR.
    Does that make sense?

  • Does anyone know how to delete a template created in error using PAGES?

    I created some templates in error using PAGES and cannot figure out how to remove them/delete them.  Anyone know how to do this?  Fran

    Look in the More like this on the right.

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • How To Use a Hidden Page Item within an SQL Report Query without Submitting

    Hi,
    Using: Oracle ApEx 3.0.1
    I have an sql report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value enetered to my hidden item, so that it can be used within the where condition of my sql but this would need to be done without actually submitting the form.
    At the moment, I can set the value via an on-demand process but my SQL is still not returing any values as the hidden page item within the query is not set (as page has not been submitted).
    Can anybody please assist as I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
    Thanks.
    Tony.
    Edited by: Tony F. on Nov 12, 2011 1:39 AM

    You can set a session value using a dummy ajax call e.g:
    Add the following to the 'Function and Global Variable Declaration' region
    function f_set_item(pThis){
      var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',1);
      get.add('P1_ID',pThis.value)
      gReturn = get.get();
      get = null;
    }Where P1_ID is the session value to be set. Then call the function in the usual way e.g.
    javascript:f_set_item(this);
    I hope that helps
    Shunt

  • Problem using Page items in trigger

    Hello all,
    I have a requirement in my application in which I need to use a page item in my trigger..
    My basic requiremtn is I have 2 forms to enter data..I need the name entered int he first form to be displayed in the second form, since am associating the data entered in the 2nd form to the name entered in the 1st form..
    In my 2nd form where I need this, am setting the Source of Server_Name to P105_DEVICE_NAME. But I need this info to enter the details to the table..So I ve created the folowwing trigger.
    create or replace TRIGGER "cts_apps_temp_insert"
    BEFORE INSERT ON CTS_APPS_TEMP
    FOR EACH ROW
    DECLARE
    vComputer_ID NUMBER;
    vTemp varchar(200);
    BEGIN
    vTemp := :P105_DEVICE_NAME;
    select computer_id into vComputer_ID from cts_hardware_info where computer_name = vtemp;
    INSERT INTO CTS_SERVER_APP_CUSTOMER(SERVER_ID,DEPT_APP_REL_ID,TECHNICAL_MANAGER,FUNCTIONAL,APPLICATION_COORDINATOR,MODIFYUSERID,DATEOFMODIFICATION)
    VALUES (vComputer_ID,:NEW.DEP_APP_REL_ID,:NEW.TECHNICAL_MANAGER,:NEW.FUCNTIONAL_MANAGER,:NEW.APPLICATION_COORDINATOR,v('APP_USER'),sysdate);
    END;
    But am getting an error executing this
    Compilation failed, line 5 (10:44:08) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
    PLS-00049: bad bind variable 'P105_DEVICE_NAME'
    Is there any other way to access the Page Items from the trigger?
    Thanks,
    Nehal

    Thanks Tyson. I have changed it but I still get the same error.
    For some reason, The value of P105_DEVICE_NAME is becoming null.
    I tried executing the following in SQL workshop.
    begin
    dbms_output.put_line('skdjaldjakdjalkdj');
    dbms_output.put_line(v('P105_DEVICE_NAME'));
    end;
    and got the following output
    skdjaldjakdjalkdj
    Statement processed.
    0.00 seconds
    It doesnt print anything for v('P105_DEVICE_NAME').
    Any idea why this is happening?
    Thanks,
    Nehal

  • Using page items in a report region

    Hi all,
    I am attempting to query a database table using values from two page items.
    SEARCH_FIELD is the field in which a query constraint is being applied
    SEARCH_CONDITION is the the query constraint condition being applied
    So, for example, I tried setting SEARCH_FIELD to AMOUNT and SEARCH_CONDITION to %22%.
    When I put the line 'AMOUNT LIKE :SEARCH_CONDITION' at the end of the query it returns the rows that do match the constraint.
    When I put the line ':SEARCH_FIELD LIKE :SEARCH_CONDITION' it displays "no data found."
    The debug shows it parse query, bind SEARCH_FIELD, bind SEARCH_CONDITION, determine column headings, then parse and bind again, and print column headings, and row loop: 15 row(s). Then the message "no data found." It should return a single row, but it does not.
    Any reason why apex doesn't like this?
    Thanks in advance,
    T.

    Sorry for the reply delay...
    The region is an SQL Query. The source is:
    Select NUMBER, DATE_LOGIN, DATE_LOGOUT, FORM.FORM_NAME as "Form", Person.L_Name||', '||Person.F_Name as "REQUESTER", DEPARTMENT.DEPARTMENT_NAME, ACCOUNT#, SUBCODE.SUBCODE as "Subcode", AMOUNT, DESCRIPTION, SENTTO.LOCATION as "Sent To", (Select Person.L_Name||', '||Person.F_Name from PERSON WHERE AUTHORIZED_BY=PERSON.ID) as "Authorized By" from SIGNATURETBL, PERSON, DEPARTMENT, FORM, SENTTO, SUBCODE WHERE REQUESTER=PERSON.ID AND DEPARTMENT=DEPARTMENT.ID AND FORM=FORM.ID AND SENT_TO=SENTTO.ID AND SIGNATURETBL.SUBCODE=SUBCODE.ID AND :SEARCH_FIELD LIKE :SEARCH_CONDITION
    If :SEARCH_FIELD has the value of 'AMOUNT' and :SEARCH_CONDITION has the value of '%22%' the regions says that no data was found. If :SEARCH_FIELD, in the query, is replaced by AMOUNT then the query does return the proper rows.
    Can you not reference an item to determine a column constraint?
    Thanks for any input

  • List of Values using page item variable

    I know there has to be a simple solution to my problem but I cannot figure it out. Any assistance would be greatly appreciated.
    I have a Shared list of values that I want to reuse on several of my pages. I have tried (I thought) all the variable possibilities but cannot figure out how to reference the page item in my list of values.
    Original code:
    select app_name d, app_sys_id f
    from ops_application
    where :P32_RADIO2 = 'Application'
    union
    select db_name d, db_id f
    from ops_database
    where :P32_RADIO2 = 'Database'
    Doesn't work:
    select app_name d, app_sys_id f
    from ops_application
    where 'P'||:APP_PAGE_ID||'_RADIO' = 'Application'
    union
    select db_name d, db_id f
    from ops_database
    where 'P'||:APP_PAGE_ID||'_RADIO' = 'Database'
    I also have tried 'P'||v('APP_PAGE_ID')||'_RADIO'
    'P'||&APP_PAGE_ID.||'_RADIO'
    'P&APP_PAGE_ID._RADIO'
    'P'||:APP_PAGE_ID||'_RADIO'
    Thanks,
    Gayle
    Edited by: user8116955 on Sep 27, 2010 12:25 PM

    Gayle,
    I haven't tried this, but what about
    where v('P'||:APP_PAGE_ID||'_RADIO') = 'Application'That should allow you to build up the name of the page item dynamically, and then test the value...
    A lower-quality solution would be to use an application item rather than a page item, as then you'd know the name ahead of time.
    Let me know if this works,
    -David

  • Error Using New-WebServiceProxy cmdlet with SQL Agent Powershell Subsystem

    I created a powershell script to connect to SSRS via web service so I can cache reports in the database and expose them directly through our application. The script works fine when I run it through Powershell directly, but when I try running it through the
    SQL Agent Powershell subsystem I am getting a strange error:
    "A job step received an error at line 61 in a PowerShell script. The corresponding line is '$RS = New-WebServiceProxy -Class 'RS' -Namespace 'RS' -Uri $reportServerURI -UseDefaultCredential  '. Correct the script and reschedule the job. The error
    information returned by PowerShell is: 'Could not load file or assembly 'file:///C:\WINDOWS\TEMP\yfqiivtg.dll' or one of its dependencies. The system cannot find the file specified.  '.  Process Exit Code -1.  The step failed."
    I am using SQL Server 2014, SSRS 2014, Windows 8.1. The only difference I can think of is that when I run Powershell from the OS, I am using v 4.0 whereas when I run it from SQL Agent it loads v 2.0. My understanding is that v 2.0 supports the New-WebServiceProxy
    cmdlet, so I'm not convinced the version discrepancy is the culprit. Any ideas what might be causing this?
    On a side note, is there a way to have SQL Agent use Powershell 4.0 for the subsystem? v 2.0 feels a little dated for SQL Server 2014.

    Hi WilliamW,
    When creating a PowerShell job step, there is only one security context available, which is the "SQL Server Agent Service Account." That means that if you intend to execute PowerShell scripts from SQL Agent Job steps, the SQL Server Agent
    service account must have appropriate permissions.
    According to your error message, I recommend to check if the SQL Server Agent service account has access to the folder where the scripts live, as well as the folder C:\WINDOWS\TEMP.
    In addition, when we execute a PowerShell job step in SQL Server, SQL Server Agent subsystem run the sqlps utility, and the sqlps utility launches PowerShell 2.0 and imports the sqlps module. If you need to run a PowerShell v4.0 script from a SQL Server
    Agent job, you can create a proxy account to run the agent job which contains PowerShell script. For more details, please review this similar blog:
    Run a PowerShell v3 Script From a SQL Server Agent Job.
    Thanks,
    Lydia Zhang

  • Error using column from a pl/sql recordtype.

    DECLARE
    CURSOR stg_raw_cur IS
    SELECT * from dwh_stg.stg_raw where rownum <=5;
    TYPE stgrawarr IS TABLE OF stg_raw_cur%ROWTYPE;
    stg_raw_rec stgrawarr;
    v_id number;
    BEGIN
    OPEN stg_raw_cur;
    LOOP
    FETCH stg_raw_cur BULK COLLECT INTO stg_raw_rec LIMIT 100;
    EXIT
    WHEN stg_raw_cur%NOTFOUND;
    END LOOP;
    CLOSE stg_raw_cur;
    END;
    Error at line 1
    ORA-06550: line 22, column 23:
    PLS-00302: component 'RAW_STG_ID' must be declared

    You declared stg_raw_rec as a nested table of records. So in order to access record attribute raw_stg_id you need to specify array element it belongs to. For example:
    stg_raw_rec(1).raw_stg_idor
    stg_raw_rec(2).raw_stg_idIf you want display all of them, use loop:
    for i in 1..stg_raw_rec.count loop
    v_id := stg_raw_rec(i).raw_stg_id;
    dbms_output.put_line (stg_raw_rec(i).raw_stg_id);
    end loop;Also, your code loops through cursor bulk fetching into stg_raw_rec up to 100 rows at a time. Keep in mind, BULK COLLECT does not append - it overrides. Therefore after the loop stg_raw_rec will have up to 100 last rows, not all the rows.
    SY.

  • Progressbar color setting using page item value

    Hey guys! I hope this is not the wrong forum to ask for your help, but since I need to accomplish it in Apex I though I'd just give it a try here.
    Have been reading, working many hours on this issue without finding the proper solution.
    I have a progressbar, which and a page_item. The progressbar's status is set according to my page_item. It works all fine so far.
    Now the problem is that I want to change the colouring of the progressbar depending on the percentage achieved. In order to do this however, I would have to know how to change or override the default ui-theme colouring for this jQuery progressbar.
    My code right now is:
    <script type="text/javascript">
    $(function(){
       var pValue=$v('P1110_COUNTSTAT') ;
       $("#progressbar").progressbar({ value: pValue });
    </script>I tried to add progressbar.style.background = "red"; which colours the background and not the "overlay element". I read the entire source code but couldn't figure out how to address this part of the progressbar.
    If anybody here has some experience with this, please let me know!
    Many thanks,
    Seb

    Hi,
    If you define class like
    <style type="text/css">
    .bar_red { background:red!important; }
    .bar_blue { background:blue!important; }
    </style>And then with jQuery add and remove class e.g.
    $('.ui-progressbar-value').removeClass('bar_blue');
    $('.ui-progressbar-value').removeClass('bar_red');
    if(something){
      $('.ui-progressbar-value').addClass('bar_blue');
    }else if(something){
      $('.ui-progressbar-value').addClass('bar_red');
    }br, Jari

  • Using SQL Query for page item source does not insert populated value

    Hi All,
    Following are the attribute details of a certain page item on an edit form:
    Display As: Text Field
    Page Item Source Type: SQL Query
    Source value Expression: SELECT a from tab where id = 'ABC'
    Although the field appears populated on the screen, but the value is not inserted in the table.
    Can anyone help on this?
    Thanks in advance,
    Annie

    Annie:
    One solution is to define a pl/sql function that given a date will return the 'run-date'. Something like create or replace function get_prod_date(p_date in date) return date is
    retval date;
    begin
    select run_date into retval from tab_x where run_date=p_date;
    return retval;
    end;Change the Source Type for the page-item back to 'Database Column'
    Set Source value or expression to the 'database column name'
    Set 'Post calculation computation' to be
    get_prod_date(:pxx_date)
    Varad

  • Default Value for Page Items

    Hi,
    I use page items quite heavily in my workbooks to allow the user to filter the recordsets as they require.
    Some of these page items are based on dates - i.e. Extract Date (my underlying tables are updated on a daily basis, so the Extract Date soon contains several values).
    Is there any way I can set the Page Item to show the latest (MAX) Extract Date when the work book is opened?
    Many thanks
    Mark

    Hi all
    Also, when alternate sorts are in use these will generally trigger Discoverer to add the NOREWRITE hint to the SQL, which can cause horribly slow performance.
    I used to use alternate sorts a lot but these days I use them very sparingly. When I want a list of values to come up in a certain order I now use a custom folder and add the ORDER BY in there. This allows the list to come up right when my users are picking and stops the NOREWRITE hint, but it also removes the alternate sorting from the display.
    There are other causes for the inclusion of NOREWRITE hint but this is the main one.
    Best wishes
    Michael

  • A page item on page 'SCHEDULE' at location 34,488 requires rasterization, but is too large to rasterize. Resize it smaller and try again

    I keep getting this error,
    A page item on page 'SCHEDULE' at location 34,488 requires rasterization, but is too large to rasterize. Resize it smaller and try again

    This basically means that there is an object that has its top left corner at x: 34 y: 488 which is too large to be rasterized, it could be due to any large object that is extreme wide or tall.
    Try to check page content and then resize it to verify the behavior. Please let me know how it goes.
    Thanks,
    Sanjit

  • 'All' Page Items

    I have a discover report that uses 'Page Items' and summarizes the results. I would like to include an All on my Page Items which would allow me to display all of the page items summarized together. Is this possible in Discover or do I need to use Oracle Reports or Forms?
    John
    null

    in 4i, All is supported for Crosstabs. Pierre
    null

Maybe you are looking for

  • Video playback to TV on older iPod

    I have an older iPod, Gen 2 or 3 (bought Spring '04). Can I move a file recorded by my PC (a TV show) via Windows Media Player onto my iPod, then take the iPod on the road, use video cables from www.speckproducts.com (which I know would work with new

  • Mail not recognizing servers

    I have an iMac G4, recently updated to 10.4.4 (big error?). The last two days, several of our Mail accounts (I have 5) either gave me the "offline" tilde when I brought the program up, or it worked fine. Manually going on line and "get new mail" woul

  • HP OfficeJet J4580 All-in-one not printing the top of page

    My HP OfficeJet J4580 has had many problems in the past, but they always have seemed to work themselves out. Currently the issue is that it cuts off the entire top edge of my paper. I am a college student and it's mandatory that my format and margins

  • Dual-monitor color management?

    So I've got a dual-monitor setup running OS 10.7 on a Mac Pro, and color management in Bridge CS5.1 on my second screen is a mess. Both monitors have been individually calibrated with a Pantone Huey Pro (not perfect, but generally pretty consistent a

  • Poor quality in preview - image is blurry

    To date, I have not had any issues with the preview quality matching the actual image quality. I have not made any hardware por software changes.  Image files are in raw, jpg and tiff formats. This issue appears to be only with raw files.  The image