#FLOW_OWNER# in pl/sql process
I am trying to use #FLOW_OWNER# substitution string in pl/sql processes so I dont have to hard code the schema name. This substitution string works fine if I use it in a report for example 'select * from #FLOW_OWNER#.APEX_APPLICATION_PAGE_IR_COL'
However if I use it an insert in pl/sql process, I get the following error.
ORA-06550: line 5, column 2: PL/SQL: ORA-00911: invalid character ORA-06550:
Here is the code
insert into ssm_help(application_id,application_item_id,help_item,help_desc,help_type_id)
(select :P11_APPLICATION_ID, :P11_APPLICATION_ITEM_ID, report_label,'Enter Help',(select help_type_id from ssm_help_type where help_type_code='REPORT_COLUMN')
FROM
#FLOW_OWNER# .APEX_APPLICATION_PAGE_IR_COL;
Any ideas what the problem is ? Thanks.
Hi,
I once used the global substitution variable APEX_APPLICATION.G_FLOW_SCHEMA_OWNER, but I had to encapsulate the query in an EXECUTE IMMEDIATE block.
Here's my example:
DECLARE
l_flows_owner VARCHAR2(32);
l_query VARCHAR2(2000);
l_count NUMBER(10,0);
BEGIN
l_flows_owner:=APEX_APPLICATION.G_FLOW_SCHEMA_OWNER;
l_query:='SELECT COUNT(DISTINCT APPLICATION_ID)
FROM '||l_flows_owner||'.APEX_APPLICATIONS';
EXECUTE IMMEDIATE l_query INTO l_count;
RETURN l_count;
END;This will work in your case too.
-Udo
Similar Messages
-
Problem setting a hidden item value when button clicked with dynamic action or pl/sql process
Apex 4.1
Oracle 11g
I have a page that consists of a main region and several sub regions. I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
Three subregions have a contional display where P400_DISPLAY = STORE. This works in hiding the sub regions.
Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
I tried creating a dynamic action for on click of the add button but get the following error:
The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
I went to the templates and found:
Substitution Strings
Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
Substitution String
Referenced
From
Description
#LINK#
Yes
Template
To be used in an "href" attribute
#JAVASCRIPT#
No
To be used in an "onclick" attribute
#LABEL#
Yes
Template
Button Label
#BUTTON_ATTRIBUTES#
No
Button Attributes
#BUTTON_ID#
No
Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed. The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
Suggestions please on how to fix the template or change the P400_DISPLAY value?The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
See the problem?
Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
I bet it is the first issue but, take a look at these.
Cheers,
-Joe -
Export to excel the output of a pl/sql process
Hi,
I have a pl/sql process on load of a page.
The code uses html tags like HTP.P('<TABLE BORDER="0" CELLSPACING="0">');
HTP.P('<TR>'); HTP.P('<TD COLSPAN="6">');
HTP.P('Title'); HTP.P('</TD>');
HTP.P('</TR>'); HTP.P('</TABLE>');
and several loops to display the names of employees in seven rows and three colums.Is it possible to export this data to excel/.csv format?
Thanks in advance...
AnuYou could also take the example from my blob that Denes mentioned and instrument it to output in either CSV or HTML. This way, you could have a single procedure that worked for both formats.
All you would need to do is handle each field differently - pad a TD and /TD (with proper brackets, of course) if its HTML or just append a comma if it's CSV.
Thanks,
– Scott –
http://spendolini.blogspot.com/
http://sumnertech.com/ -
Apex: output message from pl/sql process
Apex 4.2
THis is kind of an Apex and Pl/Sql question, but more so Apex because I'm using that environment. I have a pl/sql process with an IF - Else statement. It's a real simple process where you check:
IF P101_Count > 1 Then
Do stuff;
Else
Output an error message.
The process runs when I click a button.
I am just not sure how to get an error message to display to the screen. I am not sure of the syntax.
Any help on this topic would be greatly appreciated. Thanks in advance.Well, there a lots of ways to do this but, if you just want to see it on the screen, the easiest way is to add a Page Item (a Text Field for example). Then, in the Else portion just set it equal to the message that you are trying to display.
If ( :P101_Count > 1 ) Then
-- Do Stuff
Else
:P1_MY_MESSAGE := 'Hello World!';
End If;
-Joe -
Alert/Warning messages from PL/SQL process
Hi all,
I have a PL/SQL process that I execute from javascript : doSubmit(MY_PROCESS). I want to output an alert box if some errors occurs in the process, for instance : alert('message'). Does anyone know how to do that ?
Best regards,
Othman.Thanks Andy for the reply.
My process executes "after submit", so I cannot call directly the javascript as one mentioned. The call to "html_Get" seems to be quite complicated for a simple alert message which is not really a Application process shared component.
So I'll go for a solution where users won't see error messages ...
Best regards,
Othman. -
Calling JS function in pl/sql process
Hello!
I have a js function defined in 'HTML Header' :
<script language="JavaScript" type="text/javascript">
function disp_alert()
alert("Data is invalid! Correct the data and click CONFIRM again.")
</script>
I also have a pl/sql process on this page. I want to call disp_alert function in a following way:
if ... then call function
else dbms_output.put_line('...');
end if;
How can I call this js function in 'if'??
TomThere ARE ways to accomplish something like this, but they're much more complex.
You must create a JavaScript that uses APEX's built in AJAX components; a form button will call the JavaScript, which will in turn call a PL/SQL procedure saved as an "On Demance Shared Application Process." This procedure can run any checks you like against the DB, and return data to the Javascript to display in an alert.
You can see an example of this in use at an APEX page I created: http://htmldb.oracle.com/pls/otn/f?p=19864:5
This isn't the same thing, but is accomplishing what it does through an APEX form, a javascript call on the text field to a PL/SQL Process that returns rows from the database dynamically...thus allowing the client side JavaScript to call server side PL/SQL. -
PL/SQL process and popup URL
Hi,
I have a PL/SQL process which is called on submit but a button. This Pl/SQL creates a file on the web-server and I then want to open this file in a new browser window using the URL path to it. Can this be done from pl/sql or do I need to embed some javascript somewhere in the page. My eg block is :-
begin
pack.proc(15);
owa_util.mime_header('application/vnd.ms-word');
htp.init ;
owa_util.redirect_url('http://server:port/my_dir/myfile.doc');
end;
The redirect doesnt do anything.
Thanks for any assistance,
BrandonHi Teku,
You just have a look at this thread, where u can find a solution for your problem.
INSERTING Records into Second table based on First table Primary Key
hope this helps.
Bye,
Srikavi -
Before header pl/sql process creates blank space at top of page
Hi,
I'm finding that w/v 1.6.1 I get a blank space at the top of my page that appears to be somewhat proportional to the amount of code and/or # processes on that page that are before header. moving to after header and before regions also shows this behavior.
There are no blank line outputs happening in the pl/sql processes, so I've got no idea why htmldb is putting blank space there.
Anyone seen anything like this? Oracle 9.2.0.7, winxp pro
Thanks
mattHi,
I've had the same problem. I'm assuming that you have a region in the "After Header" position?
If so, you could add the following in the region's Region Header:
<div style="display:none">
and put this in the Region Footer:
</div>
The region is defined in a table, which by definition is a block object. Block objects always begin on a new line and end with a new line - the above will put the region into a div and then hide the div.
Regards
Andy -
Hello,
We wanted to develop a parametrable SQL filter that can make comparison, sorting and updating operations with our RDBMS (Sybase SQL Server 11.9.2.3 connected to Websphere Application Server 3.5.4).
Since a generic item (it's a product) of our RDMS contains 400 attributes and that we have approximatively 70000 items in our database, performance is quite important for us !
A typical operation of our software is to compare one product (and his 400 attributes one by one in a discriminate order) for filtering purpose.
So we got several architecture alternatives :
- Stay in the Java world and load all needed objects in memory (using for exemple a relationnal/object mapping framework like Castor) and then compare them... but it's too bad in term of performance !
- Delocalize compare methods in the SQL world by using JDBC Query or JDBC call to stored procedure...
Does anybody known the best way to deal with this sort of heavy SQL process in the Java World ?
All samples, documentations, filtering or compare algorithms are welcome !
Thanks a lot
Ghislain SillaumeIf you mean that the Java/CASTOR option would be to pull in a large number of the products into memory, map them into object to do a comparison, then that would be unwise at best. If you only need to pull in a few of the products, that may be sufficiently fast (as fast or faster than doing it in the DB.
It seems to me that a technique based on writing stored procedures to do your comparisons would be your best bet, assuming that a few sufficiently paramaterized stored procs would suffice. This, coupled with adequate indexes and well design queries should perform quite well. If you need to then pull the product definitions into a Java program, you can use an OR mapper or hand coding to do it quite easily once you figured out what the results should be...
Chuck -
Dynamic SQL in PL/SQL process
Hi all,
I just found out Dynamic SQL doesn't work in PL/SQL process.
working example using SQL:
declare
retval number;
begin
select count(*) into retval from emp;
:P1_EMP_COUNT := retval;
end;
NOT working example using dynamic SQL:
declare
retval number;
l_sql varchar2(4000);
begin
l_sql := 'select count(*) into retval from emp';
execute immediate l_sql;
:P1_EMP_COUNT := retval;
end;
What have I done wrong? Could anyone please help?? :)
ChrisHi Jarola,
Actually, your version works just as well. I had a typo in my code so I got a typo... Thank you very much. Now I got 2 version of codes that works... Sorry about the fact the Since I mark the other suggestion as "Correct", I can only mark your post as "Helpful" but yours is actually "Correct" just as well... How can I somehow get you the credit you deserved? Please let me know, Okay? Thanks again...
Chris :) -
Javascript in pl/sql process block
Hi,
Can someone please tell me why this code is not working.....
I have put this in my pl/sql process....
htp.p('<script language=javascript>');
htp.p('var r=confirm("This is a duplicate record , do you want to proceed?");');
htp.p('if (r==true)');
htp.p('{document.wwv_flow.submit();}');
htp.p('else{ }');
htp.p('</script>');
Please help
thanks and regards,
deepaWhat you need, in your case, is the reverse approach
– calling PL/SQL from JavaScript code – which is
possible, using AJAX...
It seems like what you are trying to do is a
validation process. Pressing the button should fire a
JavaScript code, which in turn will fire an on-demand
PL/SQL procedure, and according to the returned
results will display a confirm dialog boxHi Arie,
This is exactly what I am struggling to do, but I don't think is working...is there a good example somewhere, with good documentation saying what goes where? I've tried looking at Carl's On-Demand page example and I just can't tell if I'm following it correctly.
Based on what is entered in P4_PROJECT_NUM, I need to verify that the value isn't already in the database when the user tabs out of the field.
My javascript for page 4 (in HTML Header):
function checkCO()
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=validate_value',4);
get.add('ID', $x('P4_PROJECT_NUM').value)
gReturn = get.get();
if(gReturn) // if function return true
alert($x('P4_PROJECT_NUM').value + ' already exists in database.');
get = null;
//-->
</script>
My onDemand process, from the Application Processes:
declare
v_count number;
cursor cr_check_co is
select count(*)
from usd_changeorders
where chg_ref_num = v('ID');
begin
open cr_check_co;
fetch cr_check_co into v_count;
close cr_check_co;
if (nvl(v_count, 0) = 0) then
return true;
else
return false;
end if;
end;
I am calling the javascript from the onBlur event of the field I want verified.
I am getting an alert, but it is displaying every time, whether the value is valid or not.
Can you tell me what I am doing wrong?
Thanks!!
Janel -
PL/SQL process returning message with more than 4000 chars
In our apex application we are using a pl/sql process returning a message.
This message should be shown to the user.
Our problem is now, that the application items in APEX seem to be limited to 4000 chars and the message can be longer.
We are also not able to use a collection, because we can't print the content of a collection in the "Process Success Message".
Here is the content of a page process which is running on page load after header:
Name - Type: PL/SQL anonymous block
Source - Process: :AI_TEST := p0001_pkg.get_text;
Messages - Process Success Message: &AI_TEST.
Image from process [https://twitter.com/OliverLemm/status/324058809138032640/photo/1/large]
If the page is called the result is this error message:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Technical Info (only visible for developers)
is_internal_error: false
ora_sqlcode: -6502
ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
component.type: APEX_APPLICATION_PAGE_PROCESS
component.id: 16433072916569237418
component.name: get_text
error_backtrace:
ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 100
ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 141
Edited by: Oliver L on 16.04.2013 09:17no an item like P0_TEST on page 0 / global page also does not help.
But the error is not the application item / page item it's the problem that the "Process Success Message" can't handle more than 4000 chars.
I tried to paste a string into the process success message, but the error "Error processing row. ORA-01461: can bind a LONG value only for insert into a LONG column" occured even when i filled the textarea and saved the process.
So there's no problem with the application item or page item.
Edited by: Oliver L on 16.04.2013 10:00 -
How to display confirm message in APEX pl/sql process
I have a pl/sql process that selects success messages from a database table. These messages need to be displayed to the user and confirmed (only one button, to acknowledge/dismiss the mssage) along the way.
Is there a way to do this within the process? I see lots of examples in the Forum of doing this in javascript (which I know very little about) but suspect there must be a simple way to do this in my pl/sql process.
Help?
Thanks,
CarolHi Carol,
You can put you success messages inside page items or application items (when pages are rendered or processed...).
Then using :
1) javascript can display these values
2) rendering the page can display these values
Hope this help
Louis-Guillaume
Homepage : http://www.insum.ca
InSum Solutions' blog : http://insum-apex.blogspot.com -
SQL Processing Error: Error Processing MDX command : Cube AN_EFASHION
Hi Experts,
I am able to see data in HANA studio when i am doing data preview of analytic view. But when i am trying to view same data from Excel as per below link
https://www.experiencesaphana.com/docs/DOC-1138
I am getting Error as
sql Processing error: Error Processing MDX command : Cube AN_EFASHION could not found.
Please guide me.
ThanksHi Tomas,
How should i check if my user have SELECT privilege to SYSBIC schema?
Can i execute SQL statement to assign this privilege?
I checked for my user.
In General Roles: Modeling, Monitoring , Public and SLT_EC1_DATA_PROV has been assigned
in SQL Privileges. COPA_TEMPLATE, SYSTEM and ZWEATHER has been assigned
In Analytic Privileges : None
In System Privileges: Import and Export
In Package Privileges: Root package.
I am able to execute below SQL statement successfully , check from clause , then it means, i have a necessary Privileges to select from SYSBIC schema.
Generated Data Preview Query: SELECT TOP 200 sum("MARGIN") AS MARGIN, sum("AMOUNT_SOLD") AS AMOUNT_SOLD, sum("QUANTITY_SOLD") AS QUANTITY_SOLD, "CATEGORY", "FAMILY_NAME", "ARTICLE_LOOKUP_ARTICLE_ID", "ARTICLE_COLOR_LOOKUP_COLOR_CODE", "COLOR_LABEL", "ARTICLE_ID", "YR", "QTR", "MTH", "CALENDAR_YEAR_WEEK_ID", "MANAGER", "CITY", "STATE", "OUTLET_LOOKUP_SHOP_ID" FROM "_SYS_BIC"."i065360/AN_EFASHION" GROUP BY "CATEGORY", "FAMILY_NAME", "ARTICLE_LOOKUP_ARTICLE_ID", "ARTICLE_COLOR_LOOKUP_COLOR_CODE", "COLOR_LABEL", "ARTICLE_ID", "YR", "QTR", "MTH", "CALENDAR_YEAR_WEEK_ID", "MANAGER", "CITY", "STATE", "OUTLET_LOOKUP_SHOP_ID"
Thanks a lot
Edited by: New_K_sap on Nov 22, 2011 5:06 PM -
Hello All,
Can you please briefly explain with examples for Overview of SQL Processing.
We have following stages in SQL Processing.Please brief with examples on below topics.
SQL Parsing
SQL Optimization
SQL Row Source Generation
SQL Execution
ThanksAt high level your steps are right. You can find more details about each steps at - SQL - 11g Release 2 (11.2)
HTH,
Pradeep
Maybe you are looking for
-
Hi, I'm trying to create directory using sql command in apex. But it is throwing an error as 'Insufficient privileges' So whom I have to ask for privilege to create a directory? Thanks, Anoo..
-
Apple releases Java update for Mac OS X Tiger
Apple released J2SE 5.0 Release 4 on Tuesday, an update for Mac OS X 10.4.5 Tiger users. According to notes provided with the update the release delivers improved reliability and compatibility for the Java 2 Platform Standard Edition 5.0. With today'
-
Can I create a master TOC for PDF files merged into a single PDF file using Acrobat Pro?
-
None of my windows panels are showing up (the ones that are located on the right by default, i.e: layers, stroke, swatches etc). I tried changing my workspace to different things but no panels are showing up. I also tried resetting my workspace and q
-
Hello everyone, Can someone tell me where I can find extra info about the contents expected in the HealthMonitor.log file ? The installGuide and UserGuide describe only the HealthMonitor process but my customer would like to to send alarms when somet