Sequence in apex
Hello,
i create a sequence.when i build a form and assign that sequence.it work ok.but when i delete a single record then
next time the delete sequence no is miss and generate next no.
like current cursor = 10
i delete the 10th record
then current cursor = 11
i want that every time i delete any record then the max no pick.
Hi ,
If your creating the sequence it will come like that only.
Check with the below code
select sequencename.nextval from dual;if you want to create from deleted sequence you have to use the seperate table for that and also
you can use manual count.
you are deleting the record from table not in the sequence.
Cheers,
Shan
Similar Messages
-
After page submit, cursor is displaced :(
Hi there developers!
Probleb:
I have a textfiled that always submits when "Enter" is pressed.(Redirects to the same page)
But the problem is that when i press "Enter"(or "SUBMIT" button) and the page is submitted and redirected to the same page, my cursor(focus) goes to next textfield. I want it to stay on the first textfield. In any other languages and programming environments there are "TAB sequences". "Sequence" in APEX
is only for display or process order.
Is it possible to control that in APEX.
Best Regards,
Ruslan.Yes and No. there is no such parameter as tab-sequence (like in app developer ide's), but if you play around with item parameter "Sequence" - its not only the position in the window, it also works as tab operator. tab also tabs to other page objects like images, buttons and labels but if you put the form correctly - it works like a charm.
take a large form page, tab through it: 1) it tabs items (text fields) 2) tabs buttons 3) tabs browser fields (addess bar) 4) tabs item labels. so its kinda working..
try putting cursor on the first item that has to be filled with the script i pasted. -
APEX 4.0 : parametrize a sequence of display of the saved IR's
APEX 4.0
From an interactive report (IR), we saved several public IR’s (with various choices of column, sort, group by, …). When the user wants to choose a saved IR, APEX presents a list of the saved IR’s like this presentation :
1. xxxxxx
2. xxxxxx
3. xxxxxx
4. xxxxxx
For this list, how to parametrize a sequence of display of the saved IR’s (a logical sequence for the user) ?
Thank you for your help.Hi "user12045065" (please change your forum handler),
what does APP_USER show for you? Is it the same for all users?
I'm not sure if I fully understood your sentence "in Apex I use no authentication and have a function validate the user logon".
Does that mean you are NOT using a "custom authentication scheme" for that? If you answer that question with yes, how should APEX be able to distinguish the different users? And I still don't understand why you don't use it, because also with a "custom authentication scheme" you can redirect the user to the page he is privileged for.
Regards
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
APEX Sequence number when passing data from different instances
Hello there,
I have a question for you guys.
I have an application sitting in my Production area, and the one in test needs to be up-to-date (the data). So I grab the excel file, truncate the table in my test area and load the table from prod into the one in TEST.
The problem with this is that when I tried to insert a record to the table it gave me the unique constrain error. Because the sequence for the table in test next number is 500 and the last number (primary key) in PROD is 10,000.
I tried to change that number in APEX but it won't alow me to. The only thing I can change is the minimum and the maximum value.
Can I change the min to 10,001 so it can now start fro there or what would you recommend to shance the last sequence number of the table to 10,001?
Regards,
Ruben TapiaHi,
Copy your sequence SQL e.g. to notepad. Drop that sequence.
Edit SQL in notepad by changing number after START WITH to be 10001.
Then just recreate sequence from your edited SQL =)
Br,Jari -
Sequence generated keys in Apex
In APEX, what is the best way to handle INSERTs when the primary key is generated from a SEQUENCE (triggers not allowed).
Thanks,
MikeHi,
How trigger will harm that ?????
You trigger could be like
create or replace
TRIGGER MY_TBL_TRG_TRG
BEFORE INSERT ON MY_TBL
FOR EACH row
BEGIN
IF inserting THEN
IF :NEW.PK_ID IS NULL THEN
SELECT MY_TBL_PK__SEQ.nextval
INTO :NEW.PK_ID
FROM dual;
END IF;
END IF;
END;If you insert table and supply PK value, it would not generate it from sequence.
You should check shop rules.
Regards,
Jari -
How to create a sequence for an particular item in my apex form
Hi friends,
I created an database application, of a form with a report, and it is working fine...
But in my form, i have a requirement....The below are the existing fields in my form
issue no
created by
start date
status
priority
due date
Among these fields in my form i need to create a 'Sequence' for my field "issue no",
So that whenever i opened the form the 'issue number' must generate automatically like 1 for the first time, 2 for the second time and so on..
For that i created a sequence
CREATE SEQUENCE "ORDERS_SEQ"
MINVALUE 1
MAXVALUE 999999999999999999999999999
INCREMENT BY 1
START WITH 1000
NOCACHE
NOCYCLE;
But for validation where i need to write the sequence query for the particular item 'issue no'....i dont have any idea of where to write the validation query for the sequence..
please tell where i need to write in step wise manner..please help me friends...
As the below is my validated sequence query for item 'issue no'
'select seq.issue_id.nextval into issue_no'
This is my above validation query whether the query that i mentioned is right..if not let me know the validation query..
And also i need where to apply this validation query in steps..
Thanks in advance
Regards,
Harry...Harry,
Rik is on the right track. Here is a sample insert trigger: Would need to substitute you sequence ORDERS_SEQ with my sequence las_log_seq, how you define or use timestamps is up to you.
DROP TRIGGER LASDEV.BINS1_LAS_LOG_TBL;
CREATE OR REPLACE TRIGGER LASDEV."BINS1_LAS_LOG_TBL"
BEFORE INSERT
ON las_log_tbl
FOR EACH ROW
BEGIN
-- Description: Insert log_seq, creation_dt, creation_id,
-- lst_updt_dt and lst_updt_id.
-- Maintenance:
-- Date Actor Action
-- ==== ===== ======
-- 07-Sep-2010 J. Wells Create.
:new.creation_id := nvl( v( 'app_user' ), user );
:new.creation_dt := SYSDATE;
:new.lst_updt_dt := :new.creation_dt;
:new.lst_updt_id := :new.creation_id;
SELECT las_log_seq.NEXTVAL
INTO :new.las_log_seq
FROM DUAL;
END bins1_las_log_tbl;
/Heff -
Capture Web Cam image in APEX and Upload into the Database
Overview
By using a flash object, you should be able to interface with a usb web cam connected to the client machine. Their are a couple of open source ones that I know about, but the one I chose to go with is by Taboca Labs and is called CamCanvas. This is released under the MIT license, and it is at version 0.2, so not very mature - but in saying that it seems to do the trick. The next part is to upload a snapshot into the database - in this particular implementation, it is achieved by taking a snapshot, and putting that data into the canvas object. This is a new HTML5 element, so I am not certain what the IE support would be like. Once you have the image into the canvas, you can then use the provided function convertToDataURL() to convert the image into a Base64 encoded string, which you can then use to convert into to a BLOB. There is however one problem with the Base64 string - APEX has a limitation of 32k for and item value, so can't be submitted by normal means, and a workaround (AJAX) has to be implemented.
Part 1. Capturing the Image from the Flash Object into the Canvas element
Set up the Page
Required Files
Download the tarball of the webcam library from: https://github.com/taboca/CamCanvas-API-/tarball/master
Upload the necessary components to your application. (The flash swf file can be got from one of the samples in the Samples folder. In the root of the tarball, there is actually a swf file, but this seems to be a different file than of what is in the samples - so I just stick with the one from the samples)
Page Body
Create a HTML region, and add the following:
<div class="container">
<object id="iembedflash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240">
<param name="movie" value="#APP_IMAGES#camcanvas.swf" />
<param name="quality" value="high" />
<param name="allowScriptAccess" value="always" />
<embed allowScriptAccess="always" id="embedflash" src="#APP_IMAGES#camcanvas.swf" quality="high" width="320" height="240"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" mayscript="true" />
</object>
</div>
<p><a href="javascript:captureToCanvas()">Capture</a></p>
<canvas style="border:1px solid yellow" id="canvas" width="320" height="240"></canvas>That will create the webcam container, and an empty canvas element for the captured image to go into.
Also, have a hidden unprotected page item to store the Base64 code into - I called mine P2_IMAGE_BASE64
HTML Header and Body Attribute
Add the Page HTML Body Attribute as:
onload="init(320,240)"
JavaScript
Add the following in the Function and Global Variable Declarations for the page (mostly taken out of the samples provided)
//Camera relations functions
var gCtx = null;
var gCanvas = null;
var imageData = null;
var ii=0;
var jj=0;
var c=0;
function init(ww,hh){
gCanvas = document.getElementById("canvas");
var w = ww;
var h = hh;
gCanvas.style.width = w + "px";
gCanvas.style.height = h + "px";
gCanvas.width = w;
gCanvas.height = h;
gCtx = gCanvas.getContext("2d");
gCtx.clearRect(0, 0, w, h);
imageData = gCtx.getImageData( 0,0,320,240);
function passLine(stringPixels) {
//a = (intVal >> 24) & 0xff;
var coll = stringPixels.split("-");
for(var i=0;i<320;i++) {
var intVal = parseInt(coll);
r = (intVal >> 16) & 0xff;
g = (intVal >> 8) & 0xff;
b = (intVal ) & 0xff;
imageData.data[c+0]=r;
imageData.data[c+1]=g;
imageData.data[c+2]=b;
imageData.data[c+3]=255;
c+=4;
if(c>=320*240*4) {
c=0;
gCtx.putImageData(imageData, 0,0);
function captureToCanvas() {
flash = document.getElementById("embedflash");
flash.ccCapture();
var canvEle = document.getElementById('canvas');
$s('P2_IMAGE_BASE64', canvEle.toDataURL());//Assumes hidden item name is P2_IMAGE_BASE64
clob_Submit();//this is a part of part (AJAX submit value to a collection) two
}In the footer region of the page (which is just a loading image to show whilst the data is being submitted to the collection [hidden by default]) :<img src="#IMAGE_PREFIX#processing3.gif" id="AjaxLoading"
style="display:none;position:absolute;left:45%;top:45%;padding:10px;border:2px solid black;background:#FFF;" />If you give it a quick test, you should be able to see the webcam feed and capture it into the canvas element by clicking the capture link, in between the two elements - it might through a JS error since the clob_Submit() function does not exist yet.
*Part 2. Upload the image into the Database*
As mentioned in the overview, the main limitation is that APEX can't submit values larger than 32k, which I hope the APEX development team will be fixing this limitation in a future release, the workaround isn't really good from a maintainability perspective.
In the sample applications, there is one that demonstrates saving values to the database that are over 32k, which uses an AJAX technique: see http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html#LARGE.
*Required Files*
From the sample application, there is a script you need to upload, and reference in your page. So you can either install the sample application I linked to, or grab the script from the demonstration I have provided - its called apex_save_large.js.
*Create a New Page*
Create a page to Post the large value to (I created mine as 1000), and create the following process, with the condition that Request = SAVE. (All this is in the sample application for saving large values).declare
l_code clob := empty_clob;
begin
dbms_lob.createtemporary( l_code, false, dbms_lob.SESSION );
for i in 1..wwv_flow.g_f01.count loop
dbms_lob.writeappend(l_code,length(wwv_flow.g_f01(i)),wwv_flow.g_f01(i));
end loop;
apex_collection.create_or_truncate_collection(p_collection_name => wc_pkg_globals.g_base64_collection);
apex_collection.add_member(p_collection_name => wc_pkg_globals.g_base64_collection,p_clob001 => l_code);
htmldb_application.g_unrecoverable_error := TRUE;
end;I also created a package for storing the collection name, which is referred to in the process, for the collection name:create or replace
package
wc_pkg_globals
as
g_base64_collection constant varchar2(40) := 'BASE64_IMAGE';
end wc_pkg_globals;That is all that needs to be done for page 1000. You don't use this for anything else, *so go back to edit the camera page*.
*Modify the Function and Global Variable Declarations* (to be able to submit large values.)
The below again assumes the item that you want to submit has an item name of 'P2_IMAGE_BASE64', the condition of the process on the POST page is request = SAVE, and the post page is page 1000. This has been taken srtaight from the sample application for saving large values.//32K Limit workaround functions
function clob_Submit(){
$x_Show('AjaxLoading')
$a_PostClob('P2_IMAGE_BASE64','SAVE','1000',clob_SubmitReturn);
function clob_SubmitReturn(){
if(p.readyState == 4){
$x_Hide('AjaxLoading');
$x('P2_IMAGE_BASE64').value = '';
}else{return false;}
function doSubmit(r){
$x('P2_IMAGE_BASE64').value = ''
flowSelectAll();
document.wwv_flow.p_request.value = r;
document.wwv_flow.submit();
}Also, reference the script that the above code makes use of, in the page header<script type="text/javascript" src="#WORKSPACE_IMAGES#apex_save_large.js"></script>Assuming the script is located in workspace images, and not associated to a specific app. Other wise reference #APP_IMAGES#
*Set up the table to store the images*CREATE TABLE "WC_SNAPSHOT"
"WC_SNAPSHOT_ID" NUMBER NOT NULL ENABLE,
"BINARY" BLOB,
CONSTRAINT "WC_SNAPSHOT_PK" PRIMARY KEY ("WC_SNAPSHOT_ID")
create sequence seq_wc_snapshot start with 1 increment by 1;
CREATE OR REPLACE TRIGGER "BI_WC_SNAPSHOT" BEFORE
INSERT ON WC_SNAPSHOT FOR EACH ROW BEGIN
SELECT seq_wc_snapshot.nextval INTO :NEW.wc_snapshot_id FROM dual;
END;
Then finally, create a page process to save the image:declare
v_image_input CLOB;
v_image_output BLOB;
v_buffer NUMBER := 64;
v_start_index NUMBER := 1;
v_raw_temp raw(64);
begin
--discard the bit of the string we dont need
select substr(clob001, instr(clob001, ',')+1, length(clob001)) into v_image_input
from apex_collections
where collection_name = wc_pkg_globals.g_base64_collection;
dbms_lob.createtemporary(v_image_output, true);
for i in 1..ceil(dbms_lob.getlength(v_image_input)/v_buffer) loop
v_raw_temp := utl_encode.base64_decode(utl_raw.cast_to_raw(dbms_lob.substr(v_image_input, v_buffer, v_start_index)));
dbms_lob.writeappend(v_image_output, utl_raw.length(v_raw_temp),v_raw_temp);
v_start_index := v_start_index + v_buffer;
end loop;
insert into WC_SNAPSHOT (binary) values (v_image_output); commit;
end;Create a save button - add some sort of validation to make sure the hidden item has a value (i.e. image has been captured). Make the above conditional for request = button name so it only runs when you click Save (you probably want to disable this button until the data has been completely submitted to the collection - I haven't done this in the demonstration).
Voila, you should have now be able to capture the image from a webcam. Take a look at the samples from the CamCanvas API for extra effects if you wanted to do something special.
And of course, all the above assumed you want a resolution of 320 x 240 for the image.
Disclaimer: At time of writing, this worked with a logitech something or rather webcam, and is completely untested on IE.
Check out a demo: http://apex.oracle.com/pls/apex/f?p=trents_demos:webcam_i (my image is a bit blocky, but i think its just my webcam. I've seen others that are much more crisp using this) Also, just be sure to wait for the progress bar to dissappear before clicking Save.
Feedback welcomed.Hmm, maybe for some reason you aren't getting the base64 version of the saved image? Is the collection getting the full base64 string? Seems like its not getting any if its no data found.
The javascript console is your friend.
Also, in the example i used an extra page, from what one of the examples on apex packages apps had. But since then, I found this post by Carl: http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html - I would use this technique for submitting the clob, over what I have done - as its less hacky. Just sayin. -
When running htmldb 2.0.00.29 with SSO , we receive
ORA-06550: line 2, column 1: PLS-00201: identifier 'WWSEC_SSO_ENABLER_PRIVATE.GENERATE_REDIRECT'
must be declared ORA-06550: line 1, column 45: PL/SQL: Statement ignored
Error Unable to run portal_sso_redirect procedure as schema: PL_USER with partner app name: people finder:mercator.hq.ccw.gov.uk:7779.
During debugging the issue we found out that the ssosdk could not be installed into FLOWS_020000 correctly
( error like:
@loadsdk.sql
create table wwsec_enabler_config_info$ OF sec_enabler_config_type
ORA-00955: name is already used by an existing object
CREATE sequence wwsec_log_pk_seq increment BY 1
ORA-00955: name is already used by an existing object
and as followup error in regapp.sql
ERROR: Error in registration. Please try again
ORA-06508: PL/SQL: could not find program unit being called
Now we created in a separate schema the ssosdk and run next steps of
Note:353023.1 CONFIGURING AN APEX (HTMLDB) APPLICATION TO USE SSO:
But bow same error like on starting up the issue.
Question:
Is it possible to install ssosdk in a separate schema and not into FLOWS_02xxx
If yes, what are the steps differennt to the Note:353023.1
thanksHi Scot,
Thank you for your response.
This is what I did for the migration by following the thread in
How can I recovery APEX application from a full database export?
- Create new empty database with APEX installed.
- Disable foreign key constraints in the FLOWS_030100 Schema
- Truncate all tables in the FLOWS_030100 Schema
- Perform user level imports of tables only with IGNORE = Y for FLOWS_030100 Schema
- Enable the constraints.
(everything seems intact including SSO SDK objects)
To register with SSO, this is what I did;
1. Load SSO SDK in FLOWS_030100 Schema anyway
2. Register APEX as Partner in SSO
ID: 1B914F48
Token: F76K433U1B914F48
Encryption Key: F76K433U1B914F48
Login URL: http://<hotsname>:7777/pls/orasso/orasso.wwsso_app_admin.ls_login
Single Sign-Off URL: http://<hotsname>:7777/pls/orasso/orasso.wwsso_app_admin.ls_logout
Login URL : http://<hotsname>:7778/pls/apex
Success URL : http://<hotsname>:778/pls/apex/wwv_flow_custom_auth_sso.process_success
Logout URL : http://<hotsname>:7778/pls/apex
3. Run regapp.sql as FLOWS_030100
SQL> @regapp.sql
Partner Application Configuration
4.
Enter value for listener_token: HTML_DB:<hostname>:7778
Enter value for site_id: 1B914F48
Enter value for site_token: F76K433U1B914F48
Enter value for login_url: http://<hostname>:7777/pls/orasso/orasso.wwsso_app_admin.ls_login
Enter value for encryption_key: C5EB92724C7C98B8
Enter value for IP check : N
4. Ensure wwv_flow_custom_auth_sso compile successfully and grant it to Public
When I tested it, I did get the page of SSO login. But after logging in, it will just go to Page not found. Initially, I thought there's someting wrong with
wwv_flow_custom_auth_sso.process_success but it did compile successfully and I have granted it to Public.
Yong -
Roll Your Own - APEX 4.0 and JQuery-UI Application
For those with a apex.oracle.com account and want to see jQeury tabs running via 4.0 in your own Workspace, use following this script to create your own version of Shijesh's (Apex_Noob) application.
Credit also goes out to Alistair Laing for his hard work in investigating why 4.0 is requiring the use of the googleapis jquery.js... libraries.
Application Builder - Create
Application Type - Database
Create Application - From Scratch
Name - jQuery Application
Add Page - keep default and Click Add Page
Click CreateMy application defaulted to Theme 2, you will need to switch the theme to one of the following: If you don't the tabs will not render properly.
8 Orange
10 Sand
13 Classic Blue
14 Simple Green
15 Light Blue
16 Dark Blue
18 Simple Gray
19 Red Gray
Message - Application created successfully.
Click Shared ComponentsUnder User Interface Click - ThemesIf you don't see one of the above Themes, you will need to Create and switch your Theme.
Click - CreateFrom the Repository selected Click - Next and select one of the above Themes
Click - Switch ThemeSelect one of the above Themes and Click - Next
Click -NextClick - Switch ThemeReturn to your newly created Application by Clicking on Application xxxxxxx Breadcrumb
Click - Create PageSelect - Blank PageClick - NextAssign the page a name
Click - NextAccept defaults and Click - NextClick - FinishClick - Edit PageI still work in Component View, to toggle to this View, click on the control adjacent to Page number and Go button. Hover over the ones on the far right and you will see both Component View and Tree View
From Component View
Click on the Page Edit Control
In the Text Area labeled Javascript/Execute when Page Loads - paste in the following code:
$x("tabs").appendChild( $x("tabs-1"));
$x("tabs").appendChild( $x("tabs-2"));
jQuery("#tabs").tabs();In the Text Area labeled HTML Header and Body Attribute/HTML Header - paste in the following code:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/redmond/jquery-ui.css" type="text/css" />
<script src= "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.js"> </script>Click - Apply ChangesRequired use of the Google jqueryui libraries is being questioned by recent threads created by Alistair Laing since it appears that 4.0 does not currently support jQeury tabs
{thread:id=1083507}
{thread:id=1083540}
Create a Region
Type HTML Text - accept defaults
Provide a Title like "Tabs" and accept defaults
Template - Reports Region
Sequence 10
Click - NextIn the Enter HTML Text Region Source: Text Area - paste in the following code:
<div id="tabs">
<ul>
<li><a href="#tabs-1">Employees</a></li>
<li><a href="#tabs-2">Departments</a></li>
</ul>
</div>Click - Create RegionCreate a second Region
Type Report/Sql Report
Provide a Title like "Employees" and accept defaults
Template Reports Region
Sequence 20
Click - NextIn the Enter SQL Query or PL/SQL function returning a SQL Query: Text Area - paste in the following code:
SELECT empno,
ename,
job,
mgr,
hiredate,
sal,
comm,
deptno
FROM empClick - Create RegionEdit the newly created Report Region
Under Attributes/Static ID - paste in the following code:
tabs-1Click - Apply ChangesCreate a third Region
Type Report/Sql Report
Provide a Title like "Departments" and accept defaults
Template Reports Region
Sequence 30
Click - NextIn the Enter SQL Query or PL/SQL function returning a SQL Query: Text Area - paste in the following code:
SELECT deptno,
dname,
loc
FROM deptClick - Create RegionEdit the newly created Report Region
Under Attributes/Static ID - paste in the following code:
tabs-2Click - Apply ChangesRun you page and you should see you tabs.
JeffGreat post Jeff,
With regard to Jquery UI and tabs I've contacted the Apex dev team and received a reply from them.
All the jQueryUI files are included in the APEX 4.0 distribution, but not all jQueryUI components
are loaded by default to avoid a huge initial download. It's not necessary to load your own version of jQueryUI, just load the missing component.
For the "Tabs" you have to add
<link href="IMAGE_PREFIX#libraries/jquery-ui/1.8/themes/base/jquery.ui.tabs.css" rel="stylesheet" type="text/css" />
<script src="#IMAGE_PREFIX#libraries/jquery-ui/1.8/ui/minified/jquery.ui.tabs.min.js" type="text/javascript"></script>
to your page template or the header attribute of your page where you want to use it.They did not mention which other Jquery UI widgets were not included so people need to check to see if they get any JS errors Like "$('#tabs').tabs() is not a function" this would suggest that tabs is not being loaded. To included it in you page header directly after #HEAD# you need to place the css and js as stated above.
If you need jquery help just post you queries here or the is some other jquery links that maybe of some use
jQuery
http://jquery.com/ - Official jQuery Website
http://api.jquery.com/ - jQuery API Library
http://plugins.jquery.com/ - jQuery Plugins (Not APEX related)|
http://yayquery.com/ - yayQuery - jQuery Podcast
http://jqueryui.com/ - Official jQuery UI Website
http://jqueryui.com/demos/ - jQuery UI Demos
Edited by: Alistair Laing on Jun 9, 2010 4:04 PM
Add more links
Edited by: Alistair Laing on Jun 9, 2010 4:09 PM -
How to open new window and generate oracle report from apex
Hi,
I had created an application that generates PDF files using Oracle Reports, following this Guide.
http://www.oracle.com/technology/products/database/application_express/howtos/howto_integrate_oracle_reports.html
And I followed 'Advanced Technique', so that users can't generate PDF file by changing URL and parameters. This is done for security reasons.
But in this tutorial, when 'Go' button is pressed, the PDF file is displayed on the same window of apex application. If so, user might close the window by mistake. In order to avoid this, another window have to be opened.
So, I put this code in the BRANCH - URL Target. (Note that this is not in Optional URL Redirect in the button property, but the branch which is called by the button.)
javascript:popupURL('&REPORTS_URL.quotation&P2100_REP_JOB_ID.')
But if the button is pressed, I get this error.
ERR-1777: Page 2100 provided no page to branch to. Please report this error to your application administrator.
Restart Application
If I put the code 'javascritpt ....' in the Optional URL Redirect, another window opens successfully, but the Process to generate report job is not executed.
Does anyone know how to open new window from the Branch in this case?G'day Shohei,
Try putting your javascript into your plsql process using the htp.p(); procedure.
For example, something along these lines should do it:
BEGIN
-- Your other process code goes here...
htp.p('<script type="javascript/text">');
htp.p('popupURL("&REPORTS_URL.quotation&P2100_REP_JOB_ID.")');
htp.p('</script>');
END;
What happens is the javascript is browser based whereas your plsql process is server based and so if you put the javascript into your button item Optional URL Redirect it is executed prior to getting to the page plsql process and therefore it will never execute the process. When you have it in your branch which normally follows the processes, control has been handed to the server and the javascript cannot be executed and so your page throws the error "Page 2100 provided no page to branch to"... By "seeding" the plsql process with the embedded javascript in the htp.p() procedure you can achieve the desired result. You could also have it as a separate process also as long as it is sequenced correctly to follow your other process.
HTH
Cheers,
Mike -
Performance issues ..with apex in reports version 3.1
Hello All,
I am using apex 3.1 oracle 10g.
I am facing with performance issues with apex . I am generating iteractive reports with apex and the number of records are huge - running in 30 to 40 thousands of records and the reports is taking almost 30 minutes.
How I can improve the performance of this kind of report. I am using apex collections.
How apex works in terms of retrieving the records -?
Please let me know .
Thanks/kumar
Edited by: kumar73 on Jun 18, 2010 10:21 AMHello Tony ,
The following are the sequence of steps to run the test case.
Note:- All the schemas , tables and variables are populated from database.
From Schema and Relations tab choose the following:
1) Select P3I2008Q4 as schema.
2) Choose Relation as query path.
3) Select ECLA, ECLB, MTAB as relations.
From Variables choose the following:
4) Choose the variables AGE_SEXA,CLODESCA,ALCNO from ECLA relation.
5) Choose the variables AGE_SEXB, ALCNO, CLODESCB from ECLB relation.
6) Choose the variables EXPNAME, ALCNO, COST_, COST from MTAB relation.
From Conditions: Click the Run Report button this generated standard report ( Total no of records in report – 30150 )
Click on Interactive report button –to generate an interactive report. ( Error occurred )
We are using return sql statement in generationg the standard report and collections for interactive report.
thanks/kumar -
Need help on interactive report parameter value based on a sequence
At a press of a button..
i have a form where i insert data in a table .a unique number is generated via sequence.
And then a report is called .. all at the press of the same button
Now i need to make a query such that
select * from table_name where no1 = (select d_table_name_seq.currval from dual);
Such statement is not possible in apex..
So what should i do ..Use page_items
How can i store the sequence value in a page item
Edited by: susf on Nov 29, 2012 6:32 AMok solved..using apex application item thanks
-
If then Else statement not working under Computation in APEX
Hi
Can anyone help me where I am going wrong? I am trying to use the following code in Computation Process on Submit. I am not able to get the value. It's showing nothing.
Page:
*Item Name (Value Required)
Type
Static Assignment
PL/SQL Function Body
SQL Query (return single value)
SQL Query (return colon separated value)
SQL Expression
PLSQL Expression
Item Value
Computation Point
*Sequence (Value Required)
Computation Point
On New Instance (new session)
Before Header
After Header
Before Region(s)
After Region(s)
Before Footer
After Footer
After Submit
Source
*Computation (Value Required)
BEGIN
IF :P3_AGING_DAYS <= '0' THEN
:P3_AGING_BUCKET := 'Within due date';
elsif :P3_AGING_DAYS > '0' AND :P3_AGING_DAYS <= '3' then
:P3_AGING_BUCKET := 'Within 3 days';
end if;
end;1efb2968-171d-43f9-9d5d-d38151735ed7 wrote:
Please update your forum profile with a real handle instead of "1efb2968-171d-43f9-9d5d-d38151735ed7".
Can anyone help me where I am going wrong? I am trying to use the following code in Computation Process on Submit. I am not able to get the value. It's showing nothing.
BEGIN
IF :P3_AGING_DAYS <= '0' THEN
:P3_AGING_BUCKET := 'Within due date';
elsif :P3_AGING_DAYS > '0' AND :P3_AGING_DAYS <= '3' then
:P3_AGING_BUCKET := 'Within 3 days';
end if;
end;
A PL/SQL Function Body computation has to return a value rather than assigning it to an item in the PL/SQL block (APEX turns the block into the body of a function). The item for which the value is to be computed is specified in the computation properties (P3_AGING_BUCKET).
begin
return case
when :p3_aging_days < 1
then
'Within due date'
when :p3_aging_days between 1 and 3
then
'Within 3 days'
end;
end; -
Generate pdf with apex listener 2.0
hi,
we would like to generate pdf out of apex.
as long as we have text (IRR) WITHOUT special characters (öäü), everything is working fine.
when we have this characters in a text-columng (IRR), then we get a .pdf with the following content:
javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: An invalid XML character (Unicode: 0x3) was found in the element content of the document.
could this be a problem of the characterset? but if, where to change what?
- we defined in ADMIN in 'report printing' / 'instance-settings': oracle-apex-listener
- we are working with apex-listener 2.0 (integrated in weblogic-server)
- we work with APEX 4.2.1.00.08
thanks for any ideas
roland
Edited by: user514151 on 01.04.2013 23:24I have this same problem with windows-1250 encoding.
Invalid byte 1 of 1-byte UTF-8 sequence.
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:557)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1753)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1426)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2754)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at oracle.dbtools.apex.fop.FOPUtils.fop2pdf(FOPUtils.java:72)
at oracle.dbtools.apex.hooks.postProcess.FOP2PDF.requestTOPDF(FOP2PDF.java:87)
at oracle.dbtools.apex.hooks.postProcess.FOP2PDF.postProcess(FOP2PDF.java:49)
at oracle.dbtools.apex.hooks.ProcessorRegistry.postProcess(ProcessorRegistry.java:56)
at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:241)
at oracle.dbtools.apex.ModApex.doGet(ModApex.java:98)
at oracle.dbtools.apex.ModApex.service(ModApex.java:316)
at oracle.dbtools.rt.web.HttpEndpointBase.modApex(HttpEndpointBase.java:260)
at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:110)
Any solution ?
Regards
md -
Creating process for multiple Date fields for update or insert in APEX
hello there,
could someone please help me?
i have a form on Apex based on view that is based on three tables and updating and inserting ok using trigger instead of.
i have a problem now as in my form i have around 75 fileds (items) incuding 30 or more date fields which could be populated or left blank or update later.
so for each date field i have two boxs; one for date, input as dd/mm/yyyy (text field) and second for time, input as 23:45. All dates will be insert or update manually by user. so as i mentioned not all date fields could be poulated at one stage.
so i have created some process and validations and all of them work fine but i came accross if date left blank then (:) giving me problem so i have done following further process for each date field. In real table all the date fields have data type date.
declare
v_my_var date; -- for first date field
str_dy VARCHAR2(10);
dt_indx date;
str_tm VARCHAR2(20);
tm_indx date;
begin
str_dy := :p4_first_date
str_tm := str_dy||' '||substr(:p8_first_date_hh,1,2)||':'||substr(:p8_first_date_HH,4,2);
dt_indx := to_date(str_tm,'DD/MM/YYYY HH24:MI');
IF str_dy is not null then
v_my_var :=dt_indx;
ELSE
v_my_var := NULL;
END IF;
update table 1 set my_date = v_my_var where d_id= :p4_d_id;
end;
above code work fine but one date field of course therefore i have to do same code for each date field with changes and initialise variable again and again for each field.
so i like to ask is there any easy way that is more professional. i was thinking about the procedure and using collection or similar but honestly not much experience on that so could some one please help me?
I will be very thankful.
KRgdsHi,
You can do the needful by re-using the code if you can give the item names as P8_DATE1, P8_DATE_hh1, P8_DATE2, P8_DATEhh2 etc..So your item name just differs by a sequence.
Now you write function which will return desired date value taking above items as input. Pass item names to this function, get session state using APEX_UTIL.GET_SESSION_STATE('item_name') API.
Now modify you code as
FOR i IN 1..30
LOOP
v_date_array[i] = f_get_date('P8_DATE'||i, 'P8_DATEhh'||i);
END LOOP;
....Now you have all date valus in array. Just write one update as follows
UPDATE TABLE1
SET date1 = my_date_array[1], date2 = my_date_array[2]..
WHERE ....Hope it helps :)
Cheers,
Hari
Maybe you are looking for
-
Looking for a reference manual that actually describes in detail all attributes for a command
I am using CS5. I am teaching myself Photoshop using their book, "Classroom in a book". Thought the lessons, they will suggest specific setting for command attributes without describing exacting what these values mean.. For example, on page 88 they g
-
I received this error when trying to make my form a PDF: "Some content on the PDF is too large to fit on a single page." however no guidance as to which parts of the form are too large, so I don't have any idea how to fix it! Please advise, thanks
-
VI Analyzer Front Panel Size and Postion Test fails
Hi We make a lot of use of the VI Analyser and I have been playing with the configuration settings to try and make it only fail the tests that matter to us and I have one test I do not understand correctly. From the LabVIEW help Panel Size and Positi
-
Mail has been crashing on me A LOT ever since upgrading to 10.4.7 at work. Typically whenever a new message comes in. The problem however is that after the last crash, all the text in my mailboxes has become very small. Not the text in the emails, bu
-
Hi, in previous discussion you helped me open a smart object. It works, but I have another problem. Script throws "general photoshop error", because smart object layer format can not be opened in photoshop. So I want to ask how to get a Smart object