Rollback and process page PL/SQL
HelloI have a page of process that is triggered when you click on the button. I voluntarily put a wrong in the third UPDATE variable name, but it never restores.
It returns a page by mistake, but updates 1 and 2 are performed.
Do you know why?
BEGIN
UPDATE cons_appel ca
SET ca.consommateur_id =: P67_CONSERVER
WHERE ca.consommateur_id =: P67_SUPPRIMER;
: P67_ROWCOUNT: = NUMBER OF ROWS SQL %;
UPDATED cons_document cd
SET cd.consommateur_id =: P67_CONSERVER
WHERE cd.consommateur_id =: P67_SUPPRIMER;
: P67_ROWCOUNT2: = NUMBER OF ROWS SQL %;
DELETE FROM cons_consommateur cc
WHERE cc.id =: P67_SUPPRIMER;
: P67_ROWCOUNT3: = NUMBER OF ROWS SQL %;
EXCEPTION
WHILE OTHERS
THEN
ROLLBACK;
: P67_MESSAGE_ERREUR: = SQLERRM;
END;
Just use local variables:
DECLARE
l_rowcount1 PLS_INTEGER;
l_rowcount2 PLS_INTEGER;
BEGIN
UPDATE cons_appel ca
SET ca.consommateur_id = :P67_CONSERVER
WHERE ca.consommateur_id = :P67_SUPPRIMER;
l_rowcount1 := SQL%ROWCOUNT;
UPDATE cons_document cd
SET cd.consommateur_id = :P67_CONSERVER
WHERE cd.consommateur_id = :P67_SUPPRIMER;
l_rowcount1 := SQL%ROWCOUNT;
DELETE FROM cons_consommateur cc
WHERE cc.id = :P67_SUPPRIMER;
:P67_ROWCOUNT3 := SQL%ROWCOUNT;
:P67_ROWCOUNT := l_rowcount1;
:P67_ROWCOUNT2 := l_rowcount2;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
:P67_MESSAGE_ERREUR := SQLERRM;
END;
Please use--------.
...\
Labels to preserve the formatting of the code.
Tags: Database
Similar Questions
-
button with message of confirmation and process of PL/SQL
HY!
I need a button with a confirmation message ("really do you want... (' = > OK, cancel)
If the user clicks "OK" the PL/SQL process should do an insert.
For the button, I defined Action: "javascript:confirmSubmit('Would_you...?','RESUBMIT')."
and in the header of the document I have:
<script type="text/javascript"> //<![CDATA[ function confirmSubmit(msg,req){ if(req==null){req='Submit'} var confSub = msg; if(confSub == null){ confSub= confirm("Would you ...?"); }else{ confSub= confirm(msg);} if (confSub==true){doSubmit(req);} } //]]> </script>
The process of PL/SQL does not work after pressing the button (I choose the right button to "When Button pressed").
But the process works well, if I choose any State of the button.
Why is it like that?
And how can I get there?
Hello
How about using apex.confirm ( JavaScript API )? Then you can condition the process based on the REQUEST.
Welcome.
-
How to call function of a process Page PL\SQL Javasrcipt
Hello
I have a javascript function say - function1 () defined in the Page header.
I have a page PL\SQL process after the header.
How can I call the javascript function - function1 () - of PL\SQL Page process.
Thank you
DeepakHi Michael,
I have a page PL\SQL process after the header.
Since it's after the header (in the rendering phase) process, I think that this will call the JS? Please correct me if I'm wrong :-)
See you soon,.
Hari -
Version 4.1.1.00.23
Hello
I have a HTML box that contains Page elements for the user to select values to add records.
The Page is a Page of PL/SQL process that is triggered by a button.
I put a Massage of success in the area of Messages on the process of Page in the properties of the success and error, but there are not displayed.
I also tried: apex_application.g_print_success_message: = ' we inserted records. " At the end of the process.
It is on the theme: 13. Blue-grey
How can I get the message to display?
Can what additional information I give?
Thank you
Joe
Design has changed direction to another page.
The message is displayed correctly.
Thank you
Joe
-
What is the correct syntax to reference a page point (P23_ID, for example) in a process of PL/SQL page after submit?
TexasApexDeveloper wrote:
Variable binding is preferred: P23_ID you can also use & P23_ID. (variable substitution notation).
Bind variable and static text substitution references are not interchangeable. For example, static text substitution references cannot be used in allocation targets:
:P23_ID := 'foo'; -- valid &P23_ID. := 'bar'; -- syntax error (or something weird or sinister due to SQL injection)
Substituting static text references should be avoided in SQL and PL/SQL code because of the risk of behavior topic SQL injection and / odd error because of values containing quotes, etc.
-
Redirect to the new page of pl sql / process page?
Hello
I'm working on a page with a form for users to download the data. When you press the "submit" button, it runs a process Page. After the process is complete (i.e., to insert a new record of DB) we need to create a branch to a new page with treatment notes (defined in the process). I tried to save the notes to an item on the first page and then configure a branch that fires "to submit, after treatment...". ' and includes notes in the industry, setting the value of an item on the new page. It works in part but seems to truncate the value of the notes. Is there a limit to the length of the string that can be passed via a branch page?
Or is there a better way to do it? Maybe there is a way to branch directly in the process? If so, it would be easier because I wouldn't have if all goes well define a page element, just to pass this value along to the new page.
Thank you
Steve
Hi Steve. 1234555 - Oracle,
Agree with the suggestion of fac586:
The value of the item on the new page can be defined directly in the process, or later without including the value in the branch (make sure that the direction is not clear the session state in the target page). Even better would be to give notes a structure to put them in a collection and displays them using a report.
Here's how you can do if your process is PL/SQL:
DECLARE L_NOTES VARCHAR2(512); BEGIN -- process for insertion and setting notes -- setting notes item on page to be branched APEX_UTIL.SET_SESSION_STATE('P2_NOTES', L_NOTES); -- redirecting/branching to the page APEX_UTIL.REDIRECT_URL ( P_URL => 'f?p=' || :APP_ID || ':2:'|| :APP_SESSION ||'::NO:::' ); END;
Reference:
I hope this helps!
Kind regards
Kiran
-
How to marry conf msg and led process page Javascript
Hi people
Am Newbie on VISTA / Oracle XE / Apex 4.0.1...
I have an issues with a status column table and a MyDelete button on my page. I don't want to remove button led line: want to rather than to change the status of line that I always my data in itself for verification purposes.
Fortunately, my app works when I click on the MyDelete button and executes the PL/SQL process of page upd status of the line in question published.
But I want to do is have a msg of confirmation via Javascript that runs when the user presses MyDelete allow them to proceed or not.
Looked in the documentation and online of the Oracle App Builder manual it is an example of calling Javascript by a button. In their example, if the user confirmed that want to remove dosubmit('Delete') command then takes place.
I assumed that I had no need of the 'delete' on the dosubmit and thus deleted but when I click on MyDelete the Javascript works OK, but when I click on Yes to confirm the treatment it IE chg of State rather than true delete my page process is not running.
Many thanks as always, if anyone can suggest how to fix / where I'm wrong!Hello
DoSubmit JavaScript takes as request parameter you want to submit. You can use
doSubmit('DELETE');
Or any string REMOVE instead and make your conditional update process managed by this request.
In the document and example above DELETE is just request that you send.Kind regards
Jari -
Process of PL/SQL error, the display of msg in the same page?
Hello
I have a process of PL/SQL. When the process completes successfully and the branch. After the treatment. Action points to the same page and with "include the success of process message" enabled, the success message is displayed on the same page. When I error in the page, a new page appears with the error and a link for the user to return to the Application (ie the previous page). Is it possible in this case error, or when I use RAISE_APPLICATION_ERROR error message displayed on the same page as a page of success?
TIA
Published by: Ms on 10 Δεκ 2009 07:51 πμTIA,
See the analysis of Re: update of a collection should error wire. It will provide the info you are looking for :-), I hope it
See you soon,.
Hari -
Pop - up a page of page process of pl/sql
Hello
I have a code of page validation (pl/sql return error text function) and a process of page (pl/sql code), they are both
assosiated with a button saying "Button1". I bring up a new page, click on the button after validations
are performed. For this I use the code
How can I put this javascript code in the page process(PL/Sql)?. Y at - it no other mechanism to bring up a page ofjavascript:popUp2('f?p=&APP_ID.:25:&SESSION.::&DEBUG.::P25_ERROR_CODE:10', 140,140);
the pl/sql code itself. Help, please
Thank you
TJAssign the sequence 1 to your conditional branch - unconditional branch, for all other process must have a higher number of next... LOAD_POPUP is the request made by the Branch - once you change the branch, you will see a texfield for demand. Condition is request = Expression1 - put the name of the button in there.
Denes Kubicek
-------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------- -
Using 'Redirect to Page' and ' Action to update SQL ' together
When I finished to modify data in the fields on page 3, I want to commit my changes and redirect to page 6.
On page 3, under the heading ' Action when the button clicked ", if I select"Submit Page"and" Action to UPDATE SQL ', my changes are committed to the database, but I am not redirected to page 6 (which, of course, makes perfect sense).
If I select "redirect to Page in this application" and "action SQL UPDATE", comes the redirection to page 6, but my changes are not committed to the database.
What I am doing wrong?
Using the version online at apex.oracle.com.Mark T. says:
When I finished to modify data in the fields on page 3, I want to commit my changes and redirect to page 6.On page 3, under the heading ' Action when the button clicked ", if I select"Submit Page"and" Action to UPDATE SQL ', my changes are committed to the database, but I am not redirected to page 6 (which, of course, makes perfect sense).
If I select "redirect to Page in this application" and "action SQL UPDATE", comes the redirection to page 6, but my changes are not committed to the database.
What I am doing wrong?
You must submit the page, then branch of the page 6.
(You can review pages similar to the sample application or another application to see how things are handled it.)
-
By the way the values and the process of PL/SQL call via a column binding
Hi all
I have a report and a link on one of the columns that you take you to another page and passes the data from the report to this page. Everything works well. In addition to picking up the details of the report, that I join the link to call a process page before it goes to the next page by using some of the values picked up in the report. This I can go to work by changing the link to a URL and put in some javascript that is to say javascript:doSubmit('TEST_PROCESS'); By doing this "Lose" the opportunity to pass the info according to the report, via the link.
Can someone give me a clue as to how I can achieve both please? I guess I need to create my own javascript function, but I don't know how to enter the information of a line in a report to send.
Concerning
HelenHelen:
JavaScript works against the current page's HTML elements. Application parts are NOT HTML elements and can therefore be manipulated directly from Javascript.
CITY
-
Pl/sql can I use TCL (commit, rollback and savepoint) in the triggers?
can I use TCL (commit, rollback and savepoint) in the triggers?
Published by: 794244 on September 11, 2010 08:05Welcome to the forum.
The exact same question was asked here recently:
TCL in TRIGGERRead the Concepts in the Oracle Documentation (and do some research yourself) will help you understand how Oracle.
See:
http://www.Oracle.com/pls/db102/homepage
http://www.Oracle.com/pls/db112/homepageConcepts:
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14220/TOC.htm
http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/TOC.htm -
Case statement in the process Page
Request Express 3.2.1.00.11
I put the following code in an anonymous block (will return no error) for a process Page;
BEGIN INSERT INTO DAD_ASSESSMENT_REQUEST ( tenure_id , client_id ) VALUES ( :P10101_TENURE_ID , :P10101_CLIENT_ID ); END;
But when I put a statement case it throws the following error;
1 error has occurred ORA-06550: line 7, column 3: PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification ORA-06550: line 3, column 1: PL/SQL: SQL Statement ignored
BEGIN INSERT INTO DAD_ASSESSMENT_REQUEST ( tenure_id , client_id , (CASE WHEN (:P10101_MEASURE_OPTION = 'AREA') THEN estimated_area_ha WHEN (:P10101_MEASURE_OPTION = 'LINE') THEN estimated_length_km END) ) VALUES ( :P10101_TENURE_ID , :P10101_CLIENT_ID , :P10101_X ); END;
Why is this code not work and it is possible to use a case statement in a Page Apex process
Concerning
Ben
Benton says:
Request Express 3.2.1.00.11
I put the following code in an anonymous block (will return no error) for a process Page;
- BEGIN
- INSERT
- IN DAD_ASSESSMENT_REQUEST
- (tenure_id
- client_id
- )
- VALUES
- (: P10101_TENURE_ID)
- ,: P10101_CLIENT_ID
- );
- END;
But when I put a statement case it throws the following error;
- 1 error has occurred
- ORA-06550: line 7, column 3: PL/SQL: ORA-01747: specification user.table.column, table.column or invalid column ORA-06550: line 3, column 1: PL/SQL: statement ignored
- BEGIN
- INSERT
- IN DAD_ASSESSMENT_REQUEST
- (tenure_id
- client_id
- (CASE
- WHEN (: P10101_MEASURE_OPTION = 'SPACE') THEN estimated_area_ha
- WHEN (: P10101_MEASURE_OPTION = 'LINE') THEN estimated_length_km
- END)
- )
- VALUES
- (: P10101_TENURE_ID)
- ,: P10101_CLIENT_ID
- ,: P10101_X
- );
- END;
Why is this code not work and it is possible to use a case statement in a Page Apex process
Of course, it is possible to use a CASE statement or expression (it is the latter) in a page APEX process. However, it is not possible to use an invalid syntax while doing so. Part of a clause INSERT INTO can contain only static column names.
In general the SQL expressions (and also the bind variable, another cause frequent errors of syntax) can be used only in
- the projections of the SELECT queries and subqueries
- the right side of the disposals in the SET update clause
- the lists of VALUES of INSERTs
- WHERE clause predicates
ReemaPuri wrote:
Try this
INSERT
IN DAD_ASSESSMENT_REQUEST
(tenure_id
client_id
estimated_area_ha
estimated_length_km
)
VALUES
(: P10101_TENURE_ID)
,: P10101_CLIENT_ID
, (SELECT CASE WHEN: P10101_MEASURE_OPTION = 'SPACE' AND THEN: P10101_X)
OTHERWISE, NULL END OF DOUBLE)
, (SELECT CASE WHEN: P10101_MEASURE_OPTION = 'LINE' THEN: P10101_X)
OTHERWISE, NULL END OF DOUBLE)
);
It's a good idea, but it can be simplified, eliminating unnecessary subqueries:
insert into dad_assessment_request ( tenure_id , client_id , estimated_area_ha , estimated_length_km) values ( :p10101_tenure_id , :p10101_client_id , case when :p10101_measure_option = 'AREA' then :p10101_x end , case when :p10101_measure_option = 'LINE' then :p10101_x end);
-
Appeal process page javascript
Hello
I have a simple code below that I want to run inside the page point process = load after.
From now on, I have this under DA loading of the page, but its not always running.
I have a page where I have a similar process of the page but it resets something and it works every time. I think if some how I can put this java code within this process of page then it would be too much work each time.
This javascript basically reduced to a minimum the bar side navigation
$('#t_Button_navControl').click (); Thanks in advance.
Minimizing the t_Button_navControl will not work with a process of pl/sql page.
You need a process of loading page but apex saves the State of the last. So what happens:
1 time: t_Button_navControl opens and you close with the DA
2 time: t_Button_navControl gets closed by default (stored in a cookie I think) and you should not run the DA
What you essentially need to check is the following:
If ($("#t_Button_navControl").hasClass ("is-active") == false) {$('#t_Button_navControl').click ();}
Take a look at my new plugin code. I deal with the same problem.
https://github.com/tobiasarnhold/UILayout-UT
Best regards
Tobias
-
How a pl/sql procedure immediately after the action of page submit/SQL insert?
I have an entry form where the user enters data and click on the button create which then inserts a record into a table.
I want to do a few p/sql additional treatment immediately after the record is inserted, using the value of the primary key.
I tried to create a process page after submit as well as a DA pull on the change of the primary key element, but nothing does.
Where should I put my code so that my plsql is triggered immediately after the presentation of the page, and after a successful insertion of the folder?
Any ideas are appreciated!
Thank you
John
Thanks Andre - I had a bug in my pl/sql. A simple process page after submitting is working as expected.
Maybe you are looking for
-
Docking station for Satellite A200
Hello! Could someone please inform me of what docking station / port replicator is compatible with my laptop Satellite A200? I searched online, so now I'm totally confused. I've seen several USB docking stations 2 which seem to be well, but I'm not s
-
Problem starting on my Satellite L50-B-1DZ
Hello I have problem when I boot from the room as first priority set bios settings, the disc never start, need to install window, but unable to do it,the dvd is bootable and I tried different discs, but result is still the same
-
Analysis of the system.
Free Edition Avira Antivirus starts to scan and about 14% of what the whole system hangs until I manually closed.
-
Windows Activation Technologies
Hello ' I get a 'pop up' that tells me that my Windows is not genuine! When it is. I find it embarrassing. Help would be appreciatted to get rid of it. Thanks Lindsay
-
How to restore deleted files accidentally in the homegroup
Can anyone help? I was working on my laptop but I accidently deleted a file folder in the residential group, that the folder has disappeared from the homegroup. It is not in the Recycle Bin on my PC or my laptop. I've tried various searches of files