Present the new record

Hi friends. I would like to hear about it from you all.

Requirement is that I have a form with text employee_name field. If I write A only in this area, it will search in the EMP table, that all a gift and will accomplish in the below (example adam, alan all will be displayed in the list). If the user is to type a new name that is not there in the EMP table it is insert the EMP table with the new name, but giving it a random id, because I have the function the user DBMS_RANDOM. I need to insert the new name with number next to that inserted the last.

here for empno random number is affecting DBMS_RANDOM function is getting used, but I want my system to take nextval for empno.

And I want this press button "submit".

For the implementation, I created a JavaScript in the page on the main form. the code is:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.js"> </script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css" type="text/css" />
 
<script type="text/javascript">
$( function() {
    
    $("#P1_EMPLOYEE").autocomplete({
        source : function( request , response) { 
                        data = getEmployee(request.term);
                        response( data );
                 } ,
        focus  : function(event , ui){
                    event.preventDefault();
                 }
 
    });
});
 
function getEmployee(key)
{ 
      var ajaxRequest = new htmldb_Get( null , '&APP_ID.' , 'APPLICATION_PROCESS=getEmployee' , 0);
   ajaxRequest.addParam( 'x01' , key);
   ajaxResult = ajaxRequest.get(); 
   
   return ((ajaxResult.length>0)? ajaxResult.split( ',' ):null);
 
}
</script>
and has created an application process with process point getEmployee "on request: run this application process when requested by the process of the page.
declare
   l_str varchar2(100);
   i number;
f number:=0;
begin
   l_str := wwv_flow.g_x01;
   i := 0;
 for c1 in ( select ENAME  from emp where upper(ENAME) like upper(l_str) || '%')
   loop
f:=1;
       if i = 0 then
          htp.prn(c1.ENAME);
          htp.br();
       else
         htp.prn(c1.ENAME);
          htp.br();
       end if; 
       i := i + 1;
   end loop;

if (f=0) then
insert into emp(empno,ename) values (DBMS_RANDOM.VALUE (1,3),l_str);
end if;

end;
I would like to hear from you all.

Thanks in advance

Concerning

Published by: User_Apex on August 12, 2010 07:18

Hello

Error in this line
Return ((ajaxResult.length>0)? ajaxResult.split (","): null);

It should be
Return ((ajaxResult.length>0)? ajaxResult.split ("<-BR>"): null);

No before hyperphe between< and="">

also
change

TO

Kind regards
Shijesh

Tags: Database

Similar Questions

  • Since 10.11 I have not been able to download via the usb port of my Davis Vantage weather station. No solution of tech Davis on the issue even with the new recorder of events in the resort. Is there a problem with the usb?

    Since 10.11 I have not been able to download via the usb port of my Davis Vantage weather station. No solution of tech Davis on the issue even with the new recorder of events in the resort. Is there a problem with the usb?

    What Mac? (details)

  • Is it possible that when the new record is inserted in a table then this empty inserted record is automatically displayed without scrolling?

    Mr President.

    Is it possible that when the new record is inserted in a table then this empty inserted record is automatically displayed without scrolling?

    Because I change the size property of the table 5 range and my new record is inserted at no 10.

    When I click the addRecord button the new parallel line does not appear, do scroll down to see it.

    I want that we don't have to scroll down.

    The line is displayed automatically.

    as shown in the photo my behavior of page.

    scrolling.png

    Concerning

    If you just need the newly created line to be visible,

    You can simply set contentDelivery = 'immediate' and displayRow = "selected".

    P.S. the blog mentioned above only.

    See you soon

    AJ

  • Validation before the move to the new Record?

    I think it should be relatively simple, but I had no chance of finding a good example. (I'm very new to ADF, 2nd week of play with him)

    I created a simple form (af: form the tag) and adding a my control of data in as controls inputText field. I need to add more, but right now I would like to see a work.

    Then, I added the operations back and forward my data as command buttons control.

    When the user clicks command buttons, if the page has been changed, I will commit the changes before moving to the new record.

    I think I need to create a bean and call one of its methods to perform these actions, but I have not found a good example to do so. I don't know what is opposed to use to access the functionality needed from the bean.

    Here is my current form:
    <? XML version = "1.0" encoding = "UTF - 8"? >
    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
    < f: view xmlns:f = "http://java.sun.com/jsf/core" xmlns:af = "http://xmlns.oracle.com/adf/faces/rich" >
    < af:document title = "description.jsf" id = "d1" > "
    < af:messages id = "m1" / >
    < af:form id = "f1" >
    < table border = "0" style = "padding: 20px;" outline-style: none; margin: 0px; border-width: 0px; do-family: Arial, Helvetica, without serif. font-size: x-large; ">
    Description < tr > < td > < table > < /tr >
    < b >
    < td >
    < af:inputText value = "#{bindings." Simple Desc.inputValue}' = 'true '.
    required = "#{bindings." DESC.hints.Mandatory}.
    columns = "#{bindings." Desc.hints.displayWidth}.
    maximumLength = "#{bindings." DESC.hints.Precision}.
    shortDesc = "#{bindings." DESC.hints.ToolTip}"id ="it1.
    lines = autoSubmit "6" = "true" >
    < f: validator binding = "#{bindings." DESC. Validator} "/ >"
    < / af:inputText >
    < table >
    < /tr >
    < /table >
    < p / >
    < af:commandButton actionListener = "#{bindings." Previous.Execute text}"="previous ".
    Disabled = "#{!}" bindings. PartialSubmit Previous.enabled}"="true"id ="cb1"/ >
    < af:commandButton actionListener = "#{bindings." Next.Execute text}"="next ".
    Disabled = "#{!}" bindings. Next.Enabled}.
    partialSubmit = "true" id = "cb2" / >
    < / af:document >
    < / f: view >

    I would be grateful of any advice or suggestions people have.

    Add a button of validation to your page, then merge operations in a pod of support.
    See: https://blogs.oracle.com/shay/entry/doing_two_declarative_operatio

  • The new Records real-time display

    I developed a CRM that is based on this post to a database of prospects.  The CRM index page performs a select query and displays a filtered recordset based on the SQL code.  This index page is updated every 30 seconds by an update of the Meta tag.  But I think there must be a more robust and efficient method.  Ideally, I would like to have a popup is displayed each time that the new record messages when clicked would reveal the details of the record.  And if such a robust method exists, which could better the overall updating of the data other than a Meta Refresh?  Any direction you can advise would be appreciated.
    .

    Some of which can easily be done with JavaScript and a function that makes calls to ColdFusion AJAX to check new records, on a timer (30 seconds).  You can use WebSockets which offers the display in real time, but according to the rate of data change, which might be overkill.

    For example, look at how this site or Google followed new messages using AJAX. If you are connected to these forums, your avatar at the top of the screen may have a white number in an orange circle to the left of the avatar - stating that you have new messages or updates waiting for your attention.  If you have no messages or elements, the circle disappears.  While new messages or items arrive in your Inbox, reappears in the circle and the number will change.  This is done via AJAX requests that ask the service Inbox on a given time interval. In your application, you will need to decide what is the appropriate interval (or make a user setting which gives them options such as 30 seconds, 1 minute, 5 minutes, etc.).

    All this is done without refreshing the entire page (what does refresh Meta Tag).

  • Display of the results of the new record

    Hello world

    I am new to Coldfusion, so I need a little hand holding. Here's what I'm trying to do with two tables in a SQL Server 2005 database issue:

    Suppliers
    CompanyID
    Company
    Contact
    Address
    State


    States
    StateID
    StateAbbrev
    StateName

    The status in the suppliers Table line is a FK link to the StatesID line in the States table.

    I use a drop-down menu to add the new provider on the Web site. I am able to insert the new provider very well, that is wonderful.

    My problem, however, is on the results page. After the new record is inserted, the user is automatically transferred to a results page where they can see the new provider.

    For the State, he sees the StateID of the States table. All that is fine and dandy, but I would like to be able to show "NJ" instead of "5" in the State.

    No help for me on this... Of course love... do all the time!


    But I'm a little excited...

    I think you just need to use a join in the query that returns the new information suppier. Here's the basic idea

    SELECT s.Company, s.Contact, s.Address, s.CompanyID, st. StateAbbrev
    PROVIDER s INNER JOIN States st WE s.State = st. StateID
    WHERE s.Supplier = #IDOfNewSupplier #.

  • Why insert the new record is a strange behavior?


    Hello world

    My version of Jdeveloper is 11.1.2.3.0.
    I have a link command, on, click on this link im popup trigger command with showpopupbehaviour.
    Popupfetchlistener im createInsert of operation and inserting some required attributes using the setAttribute method in the new row of the table.
    Inside pop up I have dialogue, inside, dialogue I dragged a few attributes of EO based VO on the page. And have the OK button.
    When you click on ok button it pulls dialogListener, where im running commit operation.

    Now everything works fine without error, but the file does not appear when I run this query VO in Toad. What can be the reason?

    Note: I have a primary column, so I tried to hard code value (ex: empno = 898) and saved only record twice, but the second time it is throwing error as primary key attribute
    cannot be set to double, but in the table, I see no new inserted record.


    If the record is not inserted how it can show the primary key constraint error when I try to register the same new record?
    If the record is inserted then why it does not appear in the table?

    IM totally confused with this behavior of my pop up insert in the registration of the new table.

    Your entries will be really useful.

    Thank you.

    Hello

    Problem solved when I used Commit h.

    this.getDBTransaction () .commit ();

    Thank you.

  • How to pre-fill a field before inserting the new record in the same block

    I'm obviously new to the forms and need help! I need to insert new records based on the lodge currently in the same block.

    In the block, I specify a lodge (lodge 0000) and run the query for this particular lodge. I want to insert new records
    for lodge 0000. The number of dressing room must be pre-fill with lodge 0000 and I have to do is enter the others
    provide the information.

    How to make a form to pre-fill the field lodge?

    Instead of global variables, why do you not use "Form settings" which are specific to your form? You can use them in the property 'Initial value' similar to global variables.

  • How to create the new record of web service in the ADF?

    Hello, I use JDeveloper 11.1.2.3.0. I created a class and published as a web service. I created a web method like this:

       public void addNewRow(MyObject cob)

    {

    MyAppModule myAppModule = new MyAppModule();

    try {

    ViewObjectImpl vo = myAppModule.getMyVewObject1();

    ================> vo object is now null

    Row r = vo.createRow();

    r.setAttribute("Param1", cob.getParam1());

    r.setAttribute("Param2", cob.getParam2());

    vo.executeQuery(); getTransaction().commit();

    }

    catch (Exception e) { e.printStackTrace(); }

    }

    As I have written in the code, myAppModule.getMyVewObject1 () returns a null object. I do not understand why! AFAIK AppModule must initialize the object itself, when I call "getMyVewObject1()", but maybe I'm wrong, or maybe that's not the way it should be for the web methods. Has anyone ever have this problem? Any help would be much appreciated.

    You must use Configuration.createRootApplicationModule () to create the new instance of AM.

    Example: creating root Application Module Instance & #8211; Oracle ADF | Techiecook & #039; s Nook

    Also, the methods in your AM can be automatically exposed as service web soap:

    Andrejus Baranovskis blog: Web Service Interface for molten Oracle 11 g ADF BC Application Module

    And note that your code has other issues, for example:

    vo.createRow () will not automatically add this line to the View object.

    vo.executeQuery () is not necessary...

    Dario

  • Position of the new record in a table

    When I click CreateInsert button, a new blank record inserted above record previously selected in a table element. Can I configure components so after clicking on CreateInsert, the record is displayed in the bottom of the list (as last record)?
    Thank you
    Sergey Nikiforov

    Hello

    Replace your insertRow method in the implementing class ViewObject and write the code below

    int rangesize is getViewObject () .getRangeSize ();.
    getViewObject (.setRangeSize(-1));
    super.insertRowAtRangeIndex (getViewObject () .getRowCount (), line);
    getViewObject () .setCurrentRow (row);
    getViewObject () .setRangeSize (rangesize);

    Concerning
    B.Ram

    Edited by: Ramprasadb on July 8, 2010 19:02

  • Add new records to the table while ESX online

    Hello

    I want to add some new drives in a RAID 5 Array existing VMFS-store of data running on my Fibre Channel SAN, on which there is already a logic unit number.

    Can I add these discs with no problems so my 2 ESX hosts are online, and access to the existing database

    Objective final is to inreasing the size of the array by creating another logic unit number with the freespace added and then creating a new data store

    Thanks in advance,

    Alessandro

    It depends on your San. If that supports the extension line of a RAID set, you'll have no problems. But you need to enlarge the VMFS data store later. As far as I know, this is not possible with ESX 3.5. As single VMFS partition is allowed per LUN think about presenting the new disk as a new LUN space.

    You can add this new LUN as an extension to the VMFS data existing store to get this one expanded.

    Another solution would be to remove all the guests of the existing VMFS (if you Storage VMotion which can be done online), destroy that one and create a larger on the expanded LUN.

    AWo

    VCP 3 & 4

    \[:o]===\[o:]

    = You want to have this ad as a ringtone on your mobile phone? =

    = Send 'Assignment' to 911 for only $999999,99! =

  • When adding new record create id data and the static information

    Hi, I have a tabe datbase like this:

    CREATE TABLE 'paper')
    'id_paper' INTEGER (11) NOT NULL AUTO_INCREMENT,
    'sample_url' varchar (50) COLLATE utf8_general_ci NOT NULL DEFAULT ",
    PRIMARY KEY ('id_paper')


    When I add the new record, I need the "sample_url" field to automatically add this information:

    images/15_sample.jpg.

    images - is subfolder where my pictures are stored
    15. is id_paper (primary news NuméroAuto ID)
    _sample.jpg - static and must be added.

    I use adobedeveloper Toolbox to generate code with minor changes, I'm no guru php either.

    I retrieve my data like this:

    SELECT
    Paper.ID_PAPER,
    Paper.sample_url,
    Concat ("< img src = images /', sample_url, ' ' ' width ="66"height ="174"/ >") AS sample
    Of
    paper

    I use this code to add fields:

    Add columns
    $ins_paper-> setTable ("paper");
    $ins_paper-> addColumn ("sample_url", "STRING_TYPE", "POST", "sample_url");
    $ins_paper-> setPrimaryKey ("id_paper", "NUMERIC_TYPE");

    It's php for the text box:

    < b >
    < class td = "KT_th" > < label for = "sample_url" > sample_url: < / label > < table >
    < td > < input type = "text" name = "sample_url" id = "sample_url" value = "<?" PHP echo KT_escapeAttribute ($row_rspaper ['sample_url']); ">" size = "32" / >
    <? PHP echo $tNGs-> displayFieldHint ("sample_url");? > <? PHP echo $tNGs-> displayFieldError ("paper", "sample_url");? > < table >
    < /tr >


    What should I change?

    I think in this line here:
    < td > < input type = "text" name = "sample_url" id = "sample_url" value = "<?" PHP echo KT_escapeAttribute ($row_rspaper ['sample_url']); ">" size = "32" / >
    I need to add php code to get the primary key ID and my static text too, but how?

    Hello

    Well the modified code is irrelevent at this stage. The custom trigger should do the trick. Test on my test server here it worked fine. So, something is missing. I was even going to the point of adding nothing to the sample_url field and he was always fill the db.

    It's my registerTriggers

    $ins_paper-> registerTrigger ('STARTER', "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
    $ins_paper-> registerTrigger ("FRONT", "Trigger_Default_FormValidation", 10, $masterValidation);
    $ins_paper-> registerTrigger ("END", "Trigger_Default_Redirect", 99, "paper.php? done");
    $ins_paper-> registerTrigger ("AFTER", "Trigger_LinkTransactions", 98);
    $ins_paper-> registerTrigger ("ERROR", "Trigger_LinkTransactions", 98);
    $ins_paper-> registerTrigger ("AFTER", "Trigger_Custom", 50);

    Maybe you can post a txt file with the uninstall code?

    I really think at this point it's something small.

  • How to discover the field that has been activated in a time-new-record-instance

    Suppose that: a block several record. The user is positioned on a record existing on the land has

    Action: the user clicks on blank (new) record field B

    Question: How can I discoverer was clicked on field B in the times-news-record-instance? Already tried: system.current_item and: system.trigger_item. They both contain "field.

    Published by: user473811 on August 26, 2010 04:56

    Hello

    For the new record of recording/empty if the user tries to access any field, then cursor won't allow access this field. It will go to the first field in this block navigation or you use any variable as trigger_item/current_item system, etc. You can test when you click on any field cursor will go with force to the first field of navigation of this block. So in the case you always it will return A FIELD, which is correct. If the cursor remains on the field, then it will return this the name field that you can test for all previous records by accessing any field at random.

    -Clément

  • Error when creating new record in the jspx page.

    Hello! I have error when you try to post the new record in the jspx page (see: http://my.jetscreenshot.com/2677/20100820-oo8z-19kb)

    DB I trigger and in the EO primary key attribute I Type set to DBSequence.

    Where is the problem and what to do?

    Best regards, Debuger

    @Sireesha excellent point!

    @Debugger the reason why you get the error, it is you're missing an af:convertNumber, however, as said Jean Lou, why even put a DBSequence field on your screen?

    John

  • Simple question on the passage of ID variables in a url after you add a new record

    Hello;
    I know it's a simple question, I have a brain block. I'm going from a form and insert a new record in the db, but after I insert the new record, I want to pass the ID variable that gets are entrusted to him. How can I do this?

    It's my code to insert:

    < cfset EventDate = "#DateFormat(form.eventDate,"mm/dd/yyyy") #" >
    < datasource = "" #APPLICATION.dataSource # cfquery "dbtype ="ODBC">"
    INSERT INTO events
    (title, eventDate, eventTime, location, contact, telephone, fax, email, URL, sponsor, body)
    VALUES (< cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.title #" >,)
    < cfqueryparam cfsqltype = 'cf_sql_date' value = "" #EventDate # ">,"
    < cfqueryparam cfsqltype = "cf_sql_time" value = "#form.eventTime #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.location #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.contact #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.phone #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.fax #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.email #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form. "URL #" >.
    < cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.sponsor #" >.
    < cfqueryparam cfsqltype = "cf_sql_longvarchar" value = "#form.body #">) "
    < / cfquery >
    < cflocation url = "events_RecordView.cfm" >

    In the cflocation I want to pass the variable ID, how about a new record?

    Thank you.

    CFmonger

    Try this. This will select in the query exactly what was inserted just enter the id and pass id just to get in the variable. If two people fill out the form at the same exact time, that assure that they are redirected to the appropriate page.

Maybe you are looking for