What's wrong in my ondemand insert processes

All,

I write ondemand basic process in order to insert the record when the button is clicked,

Here is my not seem valid but do not insert:

process level ondemand App:

--------------------------------------------------

DECLARE

EmpName varchar2 (50);

BEGIN

-some_var1: = my_package.my_function (: P1_EMPNO,: P1_DEPTNO);

insert into testemp values ('TEST INSERT');

insert into testemp values(:P1_EMPNAME);

HTP.p (some_var1);

exception

while others then

HTP.p ('exception1');

END;

THEN call process ondemand in javascript & global declaration of the page section:

---------------------------------------------------------------------

function insert_fnc()

{

var ajaxRequestd = new htmldb_Get (null, &. APP_ID "APPLICATION_PROCESS is insert_employee", & APP_PAGE_ID.);

ajaxRequestd.add ('P1_EMPNAME', $v ('P1_EMPNAME'));

ajaxResult = ajaxRequestd.get ();

ajaxRequestd = null;

Alert ("value is =" + $v ('P1_EMPNAME'));

Return ajaxResult;

}

to my surprise it is not even insert values hard-coded, so what could be the problem here?

using apex 4.2

Thank you in advance.

Hello

I guess that your process on request gives an error because you have not declared variable some_var1

Kind regards

Jari

Tags: Database

Similar Questions

  • What is wrong with this sequence, it does not work when, after 3 inserts, I add a new record with the trigger it gives an error.

    Mr President.

    What is wrong with this sequence, it does not work when, after 3 inserts, I add a new record with the trigger it gives an error.

    --SL_CUSTOMERS table data
    
    
    INSERT INTO SL_CUSTOMERS VALUES(1,'Kamrul Hasan',NULL,NULL,'Moghbazar', 'Dhaka','0456789123',NULL,NULL,NULL,'Y',NULL);
    INSERT INTO SL_CUSTOMERS VALUES(2,'Rabiul Alam',NULL,NULL,'Motijheel', 'Dhaka','0567891234',NULL,NULL,NULL,'Y',NULL);
    INSERT INTO SL_CUSTOMERS VALUES(3,'Shahed Hasan',NULL,NULL,'2-G/1,2-2,Mirpur', 'Dhaka','0678912345',NULL,NULL,NULL,'Y',NULL);
    
    
    
    

    CREATE SEQUENCE  "ALIZA"."SL_CUSTOMERS_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER  NOCYCLE ;
    
    
    CREATE OR REPLACE TRIGGER SL_CUSTOMERS_TRG 
    BEFORE INSERT ON "ALIZA"."SL_CUSTOMERS"   
    FOR EACH ROW   
    BEGIN   
    IF :NEW.CUSTOMER_ID IS NULL OR :NEW.CUSTOMER_ID < 0 THEN  
      SELECT SL_CUSTOMERS_SEQ.nextval   
        INTO :NEW.CUSTOMER_ID  
        FROM DUAL;   
      END IF;   
    END;   
    /
    
    
    
    

    When I try to insert several records with the seq.nextval it gives error

    violation of primary key.

    INSERT INTO "ALIZA"."SL_CUSTOMERS" (CUSTOMER_NAME) VALUES ('sdfsd')
    ORA-00001: unique constraint (ALIZA.SL_CUSTOMERS_PK) violated
    ORA-06512: at line 1
    
    
    
    
    One error saving changes to table "ALIZA"."SL_CUSTOMERS":
    Row 4: ORA-00001: unique constraint (ALIZA.SL_CUSTOMERS_PK) violated
    ORA-06512: at line 1
    
    
    
    
    
    
    
    

    Concerning

    Mr President.

    I find the solution by creating a function before the triiger

    as below

    CREATE SEQUENCE  "ALIZA"."SL_CUSTOMERS_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER  NOCYCLE ;
    
    CREATE OR REPLACE FUNCTION get_SL_CUSTOMERS_vId RETURN VARCHAR2 AS
    BEGIN
       RETURN SL_CUSTOMERS_SEQ.NEXTVAL;
    
    END;
    /
    
    CREATE OR REPLACE TRIGGER SL_CUSTOMERS_TRG
    BEFORE INSERT ON "ALIZA"."SL_CUSTOMERS"
    FOR EACH ROW
    DECLARE
    dummy VARCHAR2(200);
    BEGIN
      dummy := get_SL_CUSTOMERS_vId();
      :NEW.CUSTOMER_ID := dummy;
    END;
    /  
    

    It works very well

    Thank you all for the suggestions.

    Concerning

  • computer started to randomly restart. What to do with the tools I have to try to find what is wrong?

    I am running Windows XP sp3, out of nowhere, my computer started to randomly restart. What to do with the tools I have to try to find what is wrong?

    Hello ccsmudge,

    Often, we see crashes as a result of a program from loading at startup.
    To solve these, we use the clean boot troubleshooting.
    The following describes this process:
     
    In addition, if you can zip the contents of the c:\Windows\minidump folder and put it on a public folder to http://skydrive.live.com , then we can take a peek to see if and why we are bluescreening and restart all of a sudden.
     
    Best regards
    Matthew_Ha
  • I am trying to download the trial version of Adobe Pro XI but the Download Assistant does not display it in the list despite the signing in. What is wrong with him?

    I am trying to download the trial version of Adobe Pro XI but the Download Assistant does not display it in the list despite the signing in. What is wrong with him?

    I had the same problem - my solution:

    1. If you create a connection to Adobe, make sure that you click the verification link in the email sent to you to verify your account.

    2. I leave the download Assistant, then began the process to download the original page download Assistant - he asked if I wanted to run the already downloaded version, which I chose.

    3. once the download wizard opens again, I logged in using my newly created connection and then, he showed the free trial in the product list (it has not been listed as free, but it was).

    My download is happening now - about 1 hour to go.

  • Insert processes with loop

    Hi all

    I have a procedure that runs when the entered information is correct. Also, I have an insertion process when the information is not correct, that it automatically inserts the information to the log table after her attempt three times. The process work well, but my problem is, when the attempt is that more that three times, the process will insert the information every time after the 3rd attempt.
    For example: I try 6 times with wrong information and insertion process ignores the first three and then it will insert the 3, 4, 5 and 6. in four lines. In fact, I want that this process has only to insert the last of them (6) in a single line four not 3,4,5 and 6 lines.

    Here is my method:

    BEGIN
    If (: P2_LOG_COUNT > = 3) then
    INSERT
    IN QUEST_LOG
    (USER_NAME, LOG_COUNT, DATE_CREATED, IP_ADDRESS)
    VALUES (: P2_USER_NAME,: P2_LOG_COUNT, SYSDATE, (select OWA_UTIL.get_cgi_env ('REMOTE_ADDR') of double));
    end if;
    END;

    I appreciate your help.

    Thank you

    Stéphane

    Create another element hidden P2_QUEST_ID

    BEGIN
      IF :P2_LOG_COUNT = 3 THEN
        INSERT INTO QUEST_LOG (USER_NAME, LOG_COUNT, DATE_CREATED, IP_ADDRESS)
        VALUES (:P2_USER_NAME, :P2_LOG_COUNT, SYSDATE,(select OWA_UTIL.get_cgi_env ('REMOTE_ADDR') from dual))
        RETURNING ID INTO :P2_QUEST_ID;
      ELSEIF (:P2_LOG_COUNT>=4) then
        UPDATE QUEST_LOG SET LOG_COUNT = LOG_COUNT+1
        WHERE ID = :P2_QUEST_ID;
      END IF;
    END;
    
  • It is the charger supplied with the phone. But my iPad charger is more than 2 years works great on my phone. What's wrong

    Whenever I plug my charger into my iPhone more 6 seconds I get a pop that says this accessory may not be recognized and will not take a charge. It is the charger supplied with the phone. But my iPad charger is more than 2 years works great on my phone. What's wrong? And why won't my charger. I also have another charger at work that the phone recognizes even plug me the charger in but that works well on a co-workers phone. Suggestions?

    Help here > power adapters using iPad with iPhone, iPad and iPod - Apple Support

  • My browser is running do not. I uninstall, install several times. Uninstall cookies, delete the data from the user, install in another user - no reaction. What's wrong? Help, please

    My browser is running do not. I uninstall, install several times. Uninstall cookies, delete the data from the user, install in another user - no reaction. What's wrong? Help, please

    Start Firefox in Safe Mode {web link} by holding down the < shift >
    (Mac options)
    key and then from Firefox. Is always the problem?

    Start your computer in safe mode with network. Then launch Firefox.
    Try the sites secure web. Is always the problem?

    Start the computer in Mode safe;
    Free online encyclopedia

  • I changed my avatar picture, but it is not displayed in my circle of avatar! What's wrong???

    I changed my avatar picture, but it is not displayed in my circle of avatar! What's wrong???

    You have to be level 3 before you can have a custom avatar. Keep at it

  • I got a Apple Watch yesterday and since put in place and paired him and everything, but now I can not unlock it or look at anything on the watch because it won't let me.  Any ideas as to what is wrong or what I am doing wrong?

    I got a Apple Watch yesterday and since put in place and paired him and everything, but now I can not unlock it or look at anything on the watch because it won't let me.  Any ideas as to what is wrong or what I am doing wrong?

    Hello

    If you have not already done so, it could be that you want to configure your watch with these settings:

    -On your iPhone, in the application of Eve, go to: My Watch (tab) > General > detection of wrist - it lights up.

    -On your iPhone, in the application of Eve, go to: Watch My > password > code turn on (choose a password Simple or more complex).

    -Also on the password settings screen, select Unlock with iPhone.

    After putting on your wrist, your watch don't unlock then after whatever you do first: unlock your watch manually (by entering the access code) or unlock your iPhone.

    Then, it will remain unlocked (including when the screen is idle) until you remove it from your wrist. When you remove your watch, it locks automatically.

    More information:

    https://help.Apple.com/watch/#/apd748b87e2a

  • My Icloud account does not work. As soon as I try to connect my PC know "this browser is not supported. What went wrong and what can do?

    My Icloud account does not work. As soon as I try to connect my PC know "this browser is not supported. What went wrong and what can do? I previously used the same connection to my account for a long time without any problem. My PC I have a tie with Windows 8

    < personal information deleted by host >

    Hi bengtfrombelgentier,

    Welcome to the communities of Apple Support! I'm sorry to hear that you are experiencing these problems access iCloud. If you are unable to access iCloud.com due to an error of supported browser, you can check the browser requirements set out in the following article:

    Requirements for iCloud - Apple Support

    Concerning

  • iCloud stop somehow. When I go into settings &gt; ICloud. It is grayed out. Mg nothing happens when I touch it. What's wrong?

    WWhen I go to settings > ICloud. When I press ICloud. It doesn't do anything. It is grayed out. What's wrong?

    Select this check box. Go to settings > general > Restrictions > allow changes > accounts > turn off.

  • My ipad used to print on my printer HP B210, now, it won't. What's wrong? iPad 1

    My ipad used to print on my printer HP B210, now, it won't.  What's wrong?  (iPad 1)  Everything is connected correctly, am online and print very well to my HP laptop.  The iPad is the printer, but after trying to communicate with her, he says that the printer is offline (i.e. is not)

    Hi, I decided to turn off my printer and unplug the unit.  Also turned off of my iPad.  Waited about 30-60 seconds and plugged into the printer, powered on the iPad.  We have lift-off!  It works now!  Thanks for responding.

  • E HP 4500 printer won't stay on, but for 3-5 seconds. What's wrong?

    My printer HP e-4500 will not remain, but 3-5 seconds then turns off.  What's wrong?  What can I do about it?

    [Moved from the community centre of Participation]

    Hello

    Search HP Support

    http://support.HP.com/us-en/

    or post in the Forums of HP.

    Don

  • Why can't I down load microsoft word or Adobe, I can't open my files or use the word what is wrong?

    why I can not load Word or adobe my computer let me I can not open my files what is wrong?

    Hi marycookexr,

    What happens when you try to download or install?  You have a Setup for Microsoft Word disk?

    Please visit the following link to install Adobe Reader:

    http://get.Adobe.com/reader/

    In addition, if you do not have the software set to install for Word, please see the following link to install a Word Viewer:

    http://www.Microsoft.com/download/en/details.aspx?displaylang=en&ID=4

    I hope this helps!

  • What's wrong is tracert report?

    Referring to the following picture, I would like to know what's wrong on 1 test with tracert.

    Request timed out.

    The first connection fails?

    Thanks in advance for your suggestions

    http://I1093.Photobucket.com/albums/i438/junk000/pinging.jpg

    Hello

    Try to post your query in the sub category.

    http://TechNet.Microsoft.com/en-us/ms772425.aspx

    Hope this information is useful.

Maybe you are looking for

  • The 6s IPhone problems

    This just started today, my IPhone 6s seems not to want to connect to my wifi, or something blocking to receive or send data that is messages, open applications that use internet, but I can browse the internet, as there was no problem and I can still

  • Run the specified case the value found in the table

    Hello, I am trying to build a VI that looks for a specific (in time) value in a table and if the duration is greater than or equal to this value, a specific case is executed. So far I have been successful if the value is only "equal to" but not "supe

  • I couldn't connect to the internet by cable?

    I couldn't connect to the internet? If I set a static ip address, I can connect. But if I checked, get the IP autometicaly, I couldn't connect to the internet. I have a computer more on network all work very well and connect to the internet. only my

  • closing button missing - windows 7 Home premium

    A day without any reason at all, my options to stop and restart my computer disappeared from my Start menu.Only options are Log Off, lock and change username (change username is not highlighted, so I can't select it). I use Windows 7 Home Premium edi

  • Why can't activate my windows 7 again?

    I bought a commercial 32 and 64-bit windows 7, but before receiving, he bought an another 32-bit and installed on my computer. I then installed the 32-bit of the commercial Pack on my wife. Given that my computer will support 64 bit, I installed this