Proper use of htmldb_util.set_session_state

Looking for a way to set a page variable from a trigger.
I have an app that needs a variable set from within an insert trigger. I would like to let the user see the value of that variable on the page after the insert is complete.
Can I use htmldb_util.set_session_state for that?
Thanks.

See
Re: HTMLDB_TOOLS by Vikas need some helps about rollback(Urgent !!!)
The problem is that htmldb_util.set_session_state does a COMMIT and as you know trigger code is not allowed to have a commit (ORA-04092: cannot COMMIT in a trigger)
What you could try doing is create a little procedure as a autonomous transaction as a wrapper around htmldb_util.set_session_state
create or replace procedure my_set_session_state
p_item_name in varchar2,
p_item_value in varchar2
is
   PRAGMA AUTONOMOUS_TRANSACTION;
begin
htmldb_util.set_session_state(p_item_name,p_item_value);
end;
/and call that from your trigger.
Hope this helps.

Similar Messages

  • HTML DB 1.6  (Apex) htmldb_util.set_session_state and Trigger

    Hi everybody,
    I have two “1.6 HTML-DB applications”: “Number 1” and “Number 2” which I use the same « before insert » trigger.
    But, in application “Number 2”, I want to skip some instructions, I want to put a condition.
    Firs of all, I would add an element “abc” in the page 1 of application “Number 1” to affect it the “Yes” value and in the page 1 of application “Number 2” to affect it the “No” value.
    First of all, I taught to add a condition in the trigger.
    begin
    If abc = ‘yes’ then
    def……..
    Xyz……
    End if;
    Azb…..
    Yjn……
    End;
    But, someone told me to use “htmldb_util.set_session_state”, but I’m not sure to fully understand the reason to use that. Can someone could help me ?
    Thanks. Bye.

    Firstly, I would never put ApEx page item references directly in a trigger. Surely, you can refer to the underlying column value that's supposed to be coming in rather than a page item. This might mean that you create a separate procedure to do your insert operation but it keeps things a bit cleaner and, to my way of thinking, more manageable.
    Second, just null out the value of the page item (with a computation or a process) when you click the create button - after the value has been used and properly inserted into the table.
    Earl

  • Proper Use Of Sessions

    Hi everyone,
    My fellow developers and I were having a discussion as to the proper use of sessions in a web application built with Servlets. The situation was we were building a method to get search results from a database and we wanted to have the ability to limit the number of results displayed per page.
    One method of doing this was to get the entire search result, load that into a hashtable or some other data structure, and put that into a session variable to preserve the hashtable.
    The other method was to re-query the database every time the person clicked the 'view next' button and get a new result set every time.
    I tend to favor the use of session variables to maintain the ResultSet...as I was taught that database connections are expensive and should be limited. However, according to one of the other developers, storing objects (especially when they are potentially large) in session variables is not recommended.
    So what do you guys think? Should be store large objects in session variables, or should we re-query the database every time the person loads the page?
    As a side note, the servers we use are quite robust, but we know that that is not an excuse to write in-efficient code.

    Its a trade off between memory and database access.
    Storing stuff in session is expensive in terms of memory.
    The more stuff you store in session, the more overhead there is with each user of the system.
    Querying the database each time saves you memory on the app server, but means more work for the database.
    Which is better? As always it depends.
    - How many users are projected for the system? More users means you want to keep the session as light as possible.
    - Is the query is hugely expensive to run? A long running query that only returns a few records - you would want to cache that in session.
    - Are you able to limit the result set data returned via the database? Some database support this, some don't. ie if you did a database query each time would you have to step through "5 pages" of data to get to display the "6th" page, or could you just get the data for page 6 using row numbers?
    Database connections themselves aren't that expensive to acquire if you are using connection pooling, but they are still a limited resource.
    Hope that helps some,
    evnafets

  • Proper use of END-OF-SELECTION event in report programme

    Hi,
    If we will write "WRITE" statements in side START-OF-SELECTION then it will help me to display the output.Then what is the need of END-OF-SELECTION .
    Can any body please tell me the <b>proper use of END-OF-SELECTION event in report programme.</b>

    This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started.
    <b>In report programs using LDB for every value selected the program issues the output, to control this you would use END-OF-SELECTION.</b> Now if you call your output in this event, the output is made only after all the values are selected as per the selection criteria.
    suppose while coding, u need a logic like below:
    if a condition is satisfied continue with the report
    and if not satisfied, then display a message and end the report.
    then u can code like below.
    start-of-slection.
    if a = <condition>.
    do the following.......
    else.
    stop.
    end-of-selection.
    write: 'THIS IS END'.
    stop command triggers end-of-slection from anywhere.
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Proper use of Field symbol .. please help

    what is the proper use of field symbol in sap abap ?
    Moderator Message: Please do a proper search for such basic questions.
    Edited by: kishan P on Sep 13, 2010 4:01 PM

    hi Gopal,
    The parameter is used to color a cell in ALV grid.
    See this example how it is used
    http://www.sap-img.com/abap/line-color-in-alv-example.htm
    take a closer look at the code where the info is passed
    MOVE 'MATNR' TO wa_color-fname.
            MOVE '6'         TO wa_color-color-col.
            MOVE '1'         TO wa_color-color-int.
            MOVE '1'         TO wa_color-color-inv.
            APPEND wa_color TO it_color.
    Cheers
    VJ
    If it helps dont forget to mark points

  • Proper use of location in metadata

    I'm building my library of images now with LR and want to get started on the right foot. I store on CD. In Metadata "Location" I have entered the CD volume name as a way of identifying where the images are stored. But now I am wondering if the Metadata "Source" under workflow would be a better place to record the CD name such as "2007_03_08b" Can someone point me down the correct path so I don't regret my actions after thousands of images later? Thanks

    <blockquote><span style="font-size: 90%><i>In Metadata "Location" I have entered the CD volume</i></span></blockquote>The IPTC metadata location is intended to store the physical location the shot was taken (as in "Museum", "City Hall", "Home"). It is also recommended to fill out the other location fields (Country, State, City) to make proper use of the Location Metadata Browser.<br /><br />Alexander.<br><span style="font-size: 75%; color: #408080">-- <br>Canon EOS 400D (aka. XTi) &bull; 20" iMac Intel &bull; 12" PowerBook G4 &bull; OS X 10.4 &bull; LR 1 &bull; PSE 4</span>

  • Proper use of stacked sequence structure

    Hello
    I have been reading this forum up and down, trying to figure out what the proper use of a stacked sequence struckture is.
    The reason i ask was that almost evryone in this forum thinks it is miss used / and or hides code. And that there is berrer ways of doing it.
    I ask this question, wondering what is the PROPER use of SSS?
    attached is the code so you can see what i am doing. As you will see, the code in the SSS are all the same for each frame, only channel number and numeric indicator is different, making upscaling more efficiant.
    Faster readings is not an issue since i will be slowing it down later on, so we get a visual value evry 5-10 seconds or so.
    keep in mind i am a novice at LabView, and all input is much appreciated.
    Attachments:
    r read 1ch.vi ‏52 KB

    TorbH wrote:
    I tried using array as you showed, but i fail to get it to work properly, well it works as it should but i want it to be able to stop with a button, when i did that only channels 202 - 206 stopped. 201 kept going.
    The reason for me to have this opportunity is that later i will connect channels 207-212. and they also will need to be started/stopped seperatly.
    Put the stop button inside of the loop.  The button is read with the terminal.  The terminal is read outside of the loop, so it will have the same value for every iteration of your loop.  By moving the terminal inside of the loop, your terminal will be read every iteration and you can therefore abort the loop.
    TorbH wrote:
    Also, frome here on out, how would i go ahead and use the data? Can i in a "state machine" use several for loops to perform the same tasks as i had in my previous version?
    A state machine is actually just a single loop.  You can use a state macine with other loops, you just need to be careful of how you pass the data around.
    State Machine
    Producer/Consumer
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Proper use of Iphone

    Does anyone know here the proper use of Iphone?
    1. Im wondering if it's okay if we expose it to sunlight? or sun raise?(walking in the street)
    2. and in Charging mode. we cannot safely remove the iphone in the Computer if its fully charge, is it safe to remove the usb without doing the safely remove?
    3. Is it okay if we charge it overtime? (ex. if we forgot to remove it?)

    1. Im wondering if it's okay if we expose it to sunlight? or sun raise?(walking in the street)
    Not a problem but you don't want to expose an iPhone to extreme heat such as being left in a vehicle.
    2. and in Charging mode. we cannot safely remove the iphone in the Computer if its fully charge, is it safe to remove the usb without doing the safely remove?
    Not required. When the iPhone is connected to your computer, it is not connected as an external drive which requires being ejected or safely removed before being disconnected from the computer.
    3. Is it okay if we charge it overtime? (ex. if we forgot to remove it?)
    Yes. Doing so will not cause any damage.

  • Proper use of undefined

    Proper use of undefined
    Leslie:  I bet you have an answer for this one...
    I am on version 6.0.7.1 (1961)
    My goal is to check and see if a dictionary is not present because its permission was accidently set to NONE.
    When I use this ISF nothing happens...
       if (serviceForm.TRA_INSTRUCTION == undefined)  
       alert('Service form is missing the Instructions dictionary')
    but if I change it to a double negative it works
       if (!serviceForm.TRA_INSTRUCTION != undefined)
       alert('Service form is missing the Instructions dictionary')
    Is this the way that the use of "undefined" was intended - or did I miss something in class.   Like I said, the double negative works fine,  But I would think that "equal to undefined" would work too.
    Thank you
    Daniel

    What you're trying to do is figure out if the dictionary object is defined. The more technically correct expression to do this would be to compare the typeof the object (ie, typeof serviceForm.TRA_INSTRUCTION) to "undefined" -- that would work with an equivalence expression. A longer discussion of, or reference to, object usage in JavaScript should ensue, but it's Saturday. (I think your original attempt is a little like comparing values in a relational database to null -- nothing is ever equal

  • Proper Use of States

    I have a question about how to properly use states.
    I am developing an application that requires login.
    I have two primary states, Authenticated and Unauthenticated. Once the user authenticates successfully, they are taken from the Unauthenticated state to the Authenticated state.
    Under the Authenticated state, I have a menu bar. When a menu item on the menubar is clicked, the application switches to a sub-state of the authenticated state that contains a TitleWindow with the content that I want to display. When the user clicks the close button of the TitleWindow, the application switches back to the Authenticated state.
    For those of you that know, is this proper use of States in Flex?

    As you can see in this sample code, the big factor is the size of the first view in the ViewStack. All the other views "might" be limited based on the size of the first view.
    The first view does not have to necessarily display first, that can happen programmatically, so at startup you could set the ViewStack selectedIndex to something other than 0.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      verticalGap="20" horizontalAlign="center">
      <mx:LinkBar dataProvider="{vs1}"/>
      <mx:ViewStack id="vs1">
        <mx:VBox label="One" width="300" height="200" backgroundColor="0xFFFFFF"/>
        <mx:VBox label="Two" width="600" height="400" backgroundColor="0x00FF00"/>
        <mx:VBox label="Three" width="150" height="100" backgroundColor="0x0000FF"/>
      </mx:ViewStack>
      <mx:Spacer height="50"/>
      <mx:LinkBar dataProvider="{vs2}"/>
      <mx:ViewStack id="vs2">
        <mx:VBox label="One" width="600" height="400" backgroundColor="0xFFFFFF"/>
        <mx:VBox label="Two" width="300" height="200" backgroundColor="0x00FF00"/>
        <mx:VBox label="Three" width="150" height="100" backgroundColor="0x0000FF"/>
      </mx:ViewStack>
    </mx:Application>
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Proper using of index for parallel statement execution

    Hi all,
    I've created index for my table
    CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);It was before I started to think about parallel statement execution. As far as I've heard I should alter my index for proper using with parallel hint. Could you please suggest the way to go?

    marco wrote:
    Hi all,
    I've created index for my table
    CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);It was before I started to think about parallel statement execution. As far as I've heard I should alter my index for proper using with parallel hint. Could you please suggest the way to go?when all else fails Read The Fine Manual
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements006.htm#autoId63

  • Proper use of installFromAirFile() function in ApplicationUpdater

    We have an AIR client app that is composed of several sub programs. We want to be able to push out automatic updates to all the programs. We have a system set up so that each program can download its own update. For reliability purposes we would like to instead download one large AIR package and have the sub programs install themselves from AIR packages on the local drive.
    According to the documentationn found here:
    http://help.adobe.com/en_US/AIR/1.5/jslr/air/update/ApplicationUpdater.html#installFromAIR File%28%29
    You are supposed to be able to install from a locally stored AIR file but I can't seem to get it to work within a test program. Can anyone give me a hand working out the proper syntax?

    So I managed to figure it out, sorta.
    I didn't end up using the installFromAirFile() function at all. I was able to use the applicationUpdater normally by just pointing it to a local update.xml which pointed it to a local update.air file. Here is what I did.
    private function Update():void
         var update:File = File.applicationDirectory;
         update =  update.resolvePath("Update.updaterTest.xml");
         var updater:ApplicationUpdater = new ApplicationUpdater();
         updater.updateURL = update.url;
         updater.addEventListener(UpdateEvent.INITIALIZED, onUpdateInit);
         updater.addEventListener(DownloadErrorEvent.DOWNLOAD_ERROR, onErrorEvent);
         updater.addEventListener(ErrorEvent.ERROR, onErrorEvent);
         updater.addEventListener(StatusFileUpdateErrorEvent.FILE_UPDATE_ERROR, onErrorEvent);
         updater.addEventListener(StatusUpdateErrorEvent.UPDATE_ERROR, onErrorEvent);
         updater.initialize();
    private function onUpdateInit(event:UpdateEvent):void
         event.currentTarget.checkNow();
    private function onErrorEvent(event:ErrorEvent):void
         Alert.show(event.toString());
    With the update.xml formatted like this.
    <?xml version="1.0" encoding="utf-8"?>
    <update xmlns="http://ns.adobe.com/air/framework/update/description/1.0">
      <version>1.1</version>
      <url>app:/updaterTest.air</url>
      <description>
        <![CDATA[
          Update
        ]]>
      </description>
    </update>
    This seems to work like a charm.

  • Proper use of the term "Podcast"

    A media company recently started advertising that they "Podcast" recent shows. In reality, they offer a program that listeners can down load and install. From there, the software allows you to access, listen to and save mp3 files to one's hardrive. From there, they can be imported to iTunes.
    Their files are not accessible directly from iTunes in the Podcast section of the Music Store.
    Is this a proper and legal use of the term "Podcast"?

    As I understand it, a podcast is something that is automatically fetched from the Internet and added to your portable audio player, most often via RSS to iTunes to iPod. The term "podcast" existed before Apple built the feature right into iTunes, so despite the fact that the name refers to iPods, the term isn't limited podcasts listed in the iTunes Music Store.
    In this specific case, I think you're correct in your assumption. Since it doesn't sound like the new episodes are fetched automatically nor are they automatically synched with a portable audio player, I don't think the term "podcast" should be used. However, people misuse computer terms all the time, even big media companies, so I wouldn't get too upset about it.

  • Proper use of a Lookup table and adaptations for NET

    Hello,
    I need to create a few lookup tables and I often see the following:
    create table Languages
    Id int identity not null primary key (Id),
    Code nvarchar (4) not null,
    Description nvarchar (120) not null,
    create table Posts
    Id int identity not null primary key (Id),
    LanguageId int not null,
    Title nvarchar (400) not null,
    insert into Languages (Id, Code, Description)
    values (1, "en", "English");
    This way I am localizing Posts with language id ...
    IMHO, this is not the best scheme for Languages table because in a Lookup table the PK should be meaningful, right?
    So instead I would use the following:
    create table Languages
    Code nvarchar (4) not null primary key (Code),
    Description nvarchar (120) not null,
    create table Posts
    Id int identity not null primary key (Id),
    LanguageCode nvarchar (4) not null,
    Title nvarchar (400) not null,
    insert into Languages (Code, Description)
    values ("en", "English");
    The NET applications usually use language code so this way I can get a Post in English without using a Join.
    And with this approach I am also maintaining the database data integrity ...
    This could be applied to Genders table with codes "M", "F", countries table, transaction types table (should I?), ...
    However I think it is common to use int as PK in lookup tables because it is easier to map to ENUMS.
    And know it is even possible to map to Flag Enums so have a Many to Many relationship in an ENUM.
    That helps in NET code but in fact has limitations. A Languages table could never be mapped to a FLags Enum ...
    ... An flags enum can't have more than 64 items (Int64) because the keys must be a power of two.
    A SOLUTION
    I decided to find an approach that enforces database data integrity and still makes possible to use enums so I tried:
    create table Languages
    Code nvarchar (4) not null primary key (Code),
    Key int not null,
    Description nvarchar (120) not null,
    create table Posts
    Id int identity not null primary key (Id),
    LanguageCode nvarchar (4) not null,
    Title nvarchar (400) not null,
    insert into Languages (Code, Key, Description)
    values ("en", 1, "English");
    With this approach I have a meaningfully Language code, I avoid joins and I can create an enum by parsing the Key:
    public enum LanguageEnum {
    [Code("en")
    English = 1
    I can even preserve the code in an attribute. Or I can switch the code and description ...
    What about Flag enums? Well, I will have not Flag enums but I can have List<LanguageEnum> ...
    And when using List<LanguageEnum> I do not have the limitation of 64 items ...
    To me all this makes sense but would I apply it to a Roles table, or a ProductsCategory table?
    In my opinion I would apply only to tables that will rarely change over time ... So:
        Languages, Countries, Genders, ... Any other example?
    About the following I am not sure (They are intrinsic to the application):
       PaymentsTypes, UserRoles
    And to these I wouldn't apply (They can be managed by a CMS):
       ProductsCategories, ProductsColors
    What do you think about my approach for Lookup tables?
    Thank You,
    Miguel

    >>IMHO, this is not the best scheme for Languages table because in a Lookup table the PK should be meaningful, right?<<
    Not necessarily. The choice to use, or not to use, a surrogate key in a table is a preference, not a rule. There are pros and cons to either method, but I tend to agree with you. When the values are set as programming terms, I usually use a textual value
    for the key. But this is nothing to get hung up over.
    Bear in mind however, that this:
        create table Languages
          Id int identity not
    null primary key
    (Id),     
          Code nvarchar (4)
    not null, Description nvarchar
    (120) not
    null,
    is not equivalent to
        create table Languages
          Code nvarchar (4)
    not null primary
    key (Code),     
          Description nvarchar (120)
    not null,
    The first table needs a UNIQUE constraint on Code to make these solutions semantically the same. The first table could have the value 'Klingon' in it 20 times while the second only once.
    >>However I think it is common to use int as PK in lookup tables because it is easier to map to ENUMS.<<
    This was going to be my next point. For that case, I would only change the first table to not have an identity assigned key value, as it would be easier to manage at the same time and manner as the enum.
    >>. A Languages table could never be mapped to a FLags Enum ...<<
    You could, but I would highly suggest to avoid any values encoded in a bitwise pattern in SQL as much as possible. Rule #1 (First Normal Form) is partially to have 1 value per column. It is how the optimizer thinks, and how it works best.
    My rule of thumb for lookup (or I prefer the term  "domain" tables, as really all tables are there to look up values :)), is all data should be self explanatory in the database, through data if at all possible. So if you have a color column,
    and it contains the color "Vermillion", and all you will ever need is the name, and you feel like it is good enough to manage in the UI, then great. But bear in mind, the beauty of a table that is there for domain purposes, is that you can then store
    the R, G, and B attributes of the vermillion color (254, 73, 2 respectively, based on
    http://www.colorcombos.com/colors/FE4902) and you can then use that in coding. Alternate names for the color could be introduce, etc. And if UserRoles are 1, 2, 3, and 42 (I have seen worse), then
    definitely add columns. I think you are basically on the right track.
    Louis
    Without good requirements, my advice is only guesses. Please don't hold it against me if my answer answers my interpretation of your questions.

  • Proper use of ConnectionPool in occi

    Hi,
    I am developing a client server application using Windows server 2003 x64, Oracle 11.1.0.6.0 client connecting to oracle 10.1.0.2.0 database, Visual studio 2008, visual c++ 9.
    The scenario is something like this,
    upon receiving the client request, the server executes a stored procedure as per the request. I have a number of classes thru which the stored procedure gets called. Currently, in every method of these classes, I am creating new connection to the database as follows..
    +Environment *env = Environment::createEnvironment(Environment::OBJECT);+
    +Connection *conn = env->createConnection( USERID, PASSWORD, ORACLESID );+
    But now I want to use a ConnectionPool to improve performance of the application.
    My question is, where do I create the ConnectionPool object so that it is accessible from all the methods of the classes?

    Got it!!
    I did the following..
    Declare the Environment and StatelessConnectionPool objects above main function.
    +oracle::occi::Environment *env;+
    +oracle::occi::StatelessConnectionPool *connPool;+
    +int tmain(int argc, TCHAR* argv[])+
    +{+
    +......+
    +}+
    Then declare these objects as EXTERN from wherever you want to access them.
    +extern oracle::occi::Environment *env;+
    +extern oracle::occi::StatelessConnectionPool *connPool;+
    +//Method that uses these objects+
    The objects can directly be used in the methods where the they are declared as 'extern'.
    Enjoy!

Maybe you are looking for

  • BDB3017 error

    Hi, I'm trying to change default page size (16K on my system) using set_pagesize method of Db class. But any values greater than 16K causes the following error during execution of my code BDB3017 unable to allocate space from the buffer cache Abort (

  • Does closed captioning features work in the trial version?

    I'm trying to update the font and color in Captivate 5 using the trial version and my mouse arrow shows horizontal and then it locks up my computer.  Please help; any advice would be greatly appreciated.  Thanks

  • BI Production System

    Hi, In our company, we are planning to go live in a couple of weeks and are running tight on schedule. I have been assigned the work of checking the BI production system. The transportation from Test to Production has not happened so far, but I got t

  • BTE's used for project systems master data.

    Hi , Can anyone tell me what are the BTE's used for project systems master data. Tcode used are CJ01,  Cj02,  CJ20N,  CJ12,  CNMASS When master data is changed or created BTE should trigger. Regards Subin

  • Execute on shutdown/rmmod on shutdown

    I managed to disable beep on shutdown so it's kind of fix to this problem. Its mentioned here as blue note under Audio: https://wiki.archlinux.org/index.php/ASUS_N550JV It can be done by unloading audio module "snd_hda_intel" on shutdown/sleep, so it