Return a value from a procedure at the apex
HelloI am running a procedure that has a flag of return if the procedure correctly a command I send to him, I do something like that to call the procedure in the process of the apex
Declare
x NUMBER;
BEGIN
APEX_SCHEMA. EXECUTE_CREATE_ITEM ("asd", x);
DBMS_OUTPUT. PUT_LINE ('OUTPUT :'|| x);
END;
can I return to the apex of the variable x to display it in the message of success or error of the process?
Tanks
You can use
apex_application.g_print_success_message: = x;
or
apex_application.g_notification: = x;
in your process of PL/SQL
Tags: Database
Similar Questions
-
Transfer a value from a procedure at the apex
Hello
I have a login procedure where I check the status of the user.
at the moment only through dbms_output.put_line status.
Now I want to transfer this status to apex - how can I do this?
If I have for example an element of application for the State, how can I assign the status at this point?
Thank you
Lena
Published by: Lena F March 7, 2011 06:15If you want to set the element from the procedure directly, you can use the APEX_UTIL. SET_SESSION_STATE function (a session valid apex)
You could call it after authentication or Application process that runs when a new session is created
-
How to return a value from stored procedure.
Hello
I have an insert in which insert a username through generated sequence number.
I need this generated sequence number stored procedure return.
Kindly help me to achieve this goal.
It might be useful if there is a code sample for the same thing.
Thank you
Ahmed ShareefuddinSomething like this:
create or replace procedure xproc (num out number) is begin insert into mytab values (myseq.nextval); select myseq.currval into num from dual; end; /
Max
http://oracleitalia.WordPress.com -
How to pass values from one form to the other setting
Hello
I have created two forms Form_A and Form_A. Form_B, having a button "submit" and called the new form of B.
I have done some calculations in form B. Now I want to spend this calculation value back to Form_A when I press
My Exit in Form_B button.In FormA, just before calling FormB declare and initialize a global variable
:GLOBAL.PASS_BACK := ''; -- declaration and initialization CALL_FORM(FORMB,....); --> At this point the :GLOBAL.PASS_BACK variable should have the calculated value from FormB
In the B form to trigger after CHANGE calculated item or KEY of VALIDATION or WHEN - click the BUTTON to exit FormB write - anywhere after the calculation were made
:GLOBAL.PASS_BACK :=
; For more details, search for the global variables in the form builder help.
Kind regards
-
Passing the value from one page to the other page
Hi gurus,
I need to pass the value from one page to the other page and two pages use different AMs.
In the first page I have sellers results region table where the $vendor_name column is a hyperlink that navigates to the page Vendor_Sites. Now after accessing the second page, I want to excute the VendorSitesVO in PR of CO based on the value passed to VendorsVO (vendor_id) of first page.
can someone help me on this?
Thank you
Vincent.
Published by: user4933347 on December 4, 2009 12:19 AMYou can set parameters of Pagecontext and transmit values through them. These values can be passed between pages, even if the AMs are different.
Try:
pageContext.putParameter ("Parameter1", value1);
pagecontext.setForwardURL (second page)Concerning
Sumit -
Return multiple values from a table
Hi there I'm working on a bit of sql that returns values when they exist in a table.
The code I have returns the correct value when there is an entry in the tbl_studentmodules table, as soon as there is more than one entry in this table it does display no line at all: (.)
Can someone tell how to return multiple values?
Thanks in advance!select modulename from tbl_modulefeedback where 1 = (select count(*) from tbl_studentmodules where upper(:APP_USER) = upper(student_id)) and 1 = (select count(*) from tbl_modulefeedback, tbl_studentmodules where tbl_modulefeedback.modulecode = tbl_studentmodules.modulecode)
AshleighTry this:
select modulename from tbl_modulefeedback where 1 <= (select count(*) from tbl_studentmodules where upper(:APP_USER) = upper(student_id)) and 1 <= (select count(*) from tbl_modulefeedback, tbl_studentmodules where tbl_modulefeedback.modulecode = tbl_studentmodules.modulecode)
When you ask questions, please enter CREATE TABLE and INSERT some commands to make it easier to help you.
-
Return multiple values from a function in a SELECT statement
I hope I've provided enough information here. If not, let me know what I'm missing.
I create a view that will combine the information from several tables. Most are pretty simple, but there are a couple of columns in the view that I need to get by running a function within a package. Even if this is quite simple (I have a function named action_date in a package called rp, for example, that I can use to return the date that I need through SOME rp.action_date (sequence_number).
Here is the question: I really need to return several bits of information of the same record (not only action_date, but also action_office, action_value, etc.)-a join of the tables will work not here, as I will explain below. I can, of course, perform a function separate for each statement, but this is obviously inefficient. Within the select statement of the view, however, I don't know how each of the values that I need to get back.
For example, right now, I have:
Table 1:
sequence_number NUMBER (10),
name varchar (30),
...
Table2:
Table1_seq NUMBER (10),
action_seq NUMBER (10),
action_date DATE,
action_office VARCHAR (3),
action_value VARCHAR (60),
...
I can't just simply join Table1 and Table2 because I have to perform processing in order to determine the rows returned matching, I really need to select. If the package opens a cursor and treats each line until it finds the one I need.
The following works but is ineffective since all calls to the package returns the columns of the same record. I don't know how to put all the values that I need in the SELECT statement.
CREATE VIEW all_this_stuff AS
SELECT sequence_number, name,
RP.action_date (sequence_number) action_date,
RP.action_office (sequence_number) action_office,
RP.action_value (sequence_number) action_value
FROM table1
Is there a way to return multiple values in my SELECT statement or I'm going about this all wrong?
Any suggestions?
Thank you very much!Hello
What you want is a Query of Top - N , what you can do using the ROW_NUMBER analytic function in a subquery, like this:
WITH got_rnum AS ( SELECT action_seq, action_dt, action_office, action_type, action_value , ROW_NUMBER () OVER ( ORDER BY action_date , action_seq , action_serial ) AS rnum FROM table2 WHERE action_code = 'AB' AND action_office LIKE 'E' -- Is this right? ) SELECT action_seq, action_dt, action_office, action_type, action_value FROM got_rnum WHERE rnum = 1 ;
As written, this returns a single line (at most).
I suspect you'll actually get a rank for each group , where a group is defined by a value in a table in which you join.
In this case, add a PARTITION BY clause to the ROW_NUMBER function.
If post you a small example of data (CREATE TABLE and INSERT statements), I could show you exactly how.
As I don't have your tables, I'll show you the use of the tables in the scott schema.
This is a view containing data in the scott.dept table and also to scott.emp, but only for the highest employee in each Department (in other words, the employee whose oldest hire date). If there be a tie for the first hire date, while the candidate with the lowest empno is selected.CREATE OR REPLACE VIEW senior_emp AS WITH got_rnum AS ( SELECT d.deptno , d.dname , e.empno , e.ename , e.hiredate , ROW_NUMBER () OVER ( PARTITION BY d.deptno ORDER BY e.hiredate , e.empno ) AS rnum FROM scott.dept d JOIN scott.emp e ON d.deptno = e.deptno ) SELECT deptno , dname , empno , ename , hiredate FROM got_rnum WHERE rnum = 1 ; SELECT * FROM senior_emp ;
Output:
. DEPTNO DNAME EMPNO ENAME HIREDATE ---------- -------------- ---------- ---------- --------- 10 ACCOUNTING 7782 CLARK 09-JUN-81 20 RESEARCH 7369 SMITH 17-DEC-80 30 SALES 7499 ALLEN 20-FEB-81
Moreover, one of the conditions to the query you posted has been
action_office LIKE 'E'
which equals
action_office = 'E'
(AS is always equivalent to = if the string that follows AS does not contain the winning cards.)
Did you mean say that or did you mean something like this:action_office LIKE 'E%'
Instead?
-
Copy the default value from another field in the same page
Hello
I need to pass a value from one page to another page and I want to use this key as DEFAULT VALUE for a field.
If I create a form tabular all it's ok, but if I create a normal page. I am not able to do that.
- 1. I call the page and I pass the value. I also have a FIELD of VIEW and I can see the correct value.
- 2. I create a field with attributes of this:
- a. source > Source = database column type
- b. sources > Source value or expression = FK_ID_DA (the column name)
- c. default > default = P27_PK_ID_DA (the field that contains the value)
- 3. on the screen, I see P27_PK_ID_DA and not the value
Where is the error?
Thank you very much
TexasApexDeveloper wrote:
You missed one: before the variable, without it, the default value is the string...
Not sure that you can READ the other pages... Such that if you are on Page 27 and have a field that you want to use on page 30, page 27 is presented and its items in session state, you can 'see' on page 30.
So, if you set the default value: P27_PK_ID_DA, then you should get by default, you are looking for...
Only if the default value Type is set on the PL/SQL Expression. If the literal value "P27_PK_ID_DA" is seen then the Type of default value should currently be set static text with Substitutions of State of Session, in which case the value of session state must be referenced using the syntax of substitution string:
&P27_PK_ID_DA
. -
APEX - passing values from one page to the other
Hello
I created a new page with a report. I put one of the columns as a link that opens another page. This page should contain other details of the particular line.
For example:
There is a page with a list of employee names and the number of employees in both columns. When I click on the name of employee, he must open another page with additional details of the employee in particular (such as date of birth, e-mail etc.).
What I'm trying at the moment is to create another page with a report inside. How do I pass the name of the employee as a parameter to this second page? And how do I do the query in the second page accept this setting?
Is there a better way to do this?
Kind regards
Santhosh JoseHello
on your detail page (2nd report) create a hidden page element called P2_EMPID
Now change the query on this page to use this page element in the where clause (such as a variable binding).
for example:Select * from EMP
where empid =: P2_EMPIDOn your first page, you need to set a link to the column for the chosen, employed at the point P2_EMP on the second page. This can easily be done via a column binding in the report on the first page (have it redirect to a page in the apex and set the page to the second page of the report, and also set the P2_EMPID value to the value of #EMPID #, correcting the names of these variables can be chosen in the selection lists when you set the link in the column).
concerning
Bottom -
How can I pass values from one node to the other
Give a standard and efficient way to pass values of the child to the parent
Hai Prathap
You can use the custom event to pass values from the children to the parent
-
Passing values from one scene to the other
Hello, how can I pass a value from a textbox in scene1 to another area of text that is in scene2?
In scene 1, you might have...
var str:String = t1.text;
and to scene 2, you might have...
T2. Text = str;
-
Oracle form functions and procedures in the APEX, how?
I'm working to recreate in the APEX, already existing read only forms in Oracle Forms. Report features interactive APEX among other things, in fact worth as well as to target a different audience than utilizies versions of Oracle Form. Versions of Oracle Forms use a lot of pre and post query triggers, PLSQL functions.
In Oracle Forms that places, these functions can be found in the "Units of program" section of the form. A feature typical of this kind, based on a particular Mission ID route, collecting names of regular passengers, is shaped with a comma and a space after each of them, in a single string that is returned and displayed the list of passengers of a line.
I have all of this written code so I can move most of the main request of the Oracle form in an interactive report. These functions and triggers called in the form of the "Units of program" section of the Oracle form rather than stored in the database schema in a package, where they would go inside the APEX? Can I create a 'shortcut' in the APEX and call it from the interactive report "Source Région"? I can create the PLSQL function at the level of the region of the interactive report or page level? Or, my best bet creates a package that is stored in the database, all these functions and/or proecedures I might need the original form of Oracle?
Some advice would be greatly appreciated.RLBickham wrote:
I don't think I've been pretty clear in the description of the specific thing I want to do, simply, it does not reach the level of forms of conversion of the APEX. It is basically a problem of PLSQL function.I have an interactive report which is currently 90 percent of what I want however, each line, which represents a Mission may have several feet. Each arm has two places or ICAO codes attached to it. Based on the number of Mission, I want to loop through the array of leg, collect all the codes of ICAO for this Mission, put them together in 1 variable separated by a coma and add this variable to display the columns in this interactive report as the last column.
In Oracle Forms, I have a function registered in the database, which is called in the main query. Maybe I ask a question that does not need to be asked, but anyway my question is can I put this function currently in the database somewhere within the interactive report and somehow reference it via Http, or should I just stick with set of functions and procedures in the packages stored in the database and called the conventional way?
You could switch the function to the database and call it from the report query, but it sounds as if it were superfluous. In the report query using any form of Re: 4. How can I convert rows to columns? is appropriate for your version of the (unspecified) database.
-----
When you have a problem, you will get an answer faster, more efficient including information as much information as possible from the outset. This should include:
- Full version of APEX
- Complete operating system DB, version, edition, host
- Architecture of Web server (EPG, SST or APEX listener/host operating system)
- Browser (s) and version (s) used
- Theme
- Model (s)
- Region/section type (s) (particularly as to distinguish if a 'report' is a standard report, an interactive report, or indeed a 'update report' (i.e. a tabular presentation))
With APEX, we also had the chance to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproduce things is the best way to solve most of the questions, particularly those relating to the layout and Visual formatting. If you expect a detailed response it is appropriate that you take on an important part of the effort by getting as much as possible with an example of the problem on apex.oracle.com before asking for help on specific issues, then we can see firsthand.
-
How to display a GIF beside a column value in a report of the APEX?
Hi all
I've created a report and I have a numeric column on it.
I would like to show some image (gif from a location as the Image prefix/app /), but I only need to show the image if the value of this column is "> x'»
For example, take a look at:
http://www.troostwijkauctions.com/UK/lots/11959/1868/1/Cranes_and_accessoires.aspx?c=agenda & sort = IDB
* LotNo 577 for example has a little picture of flames beside him, due to the fact that the number of bids was higher than 5.
Someone there already does this and can help me with a Board?
I guess I need to do this in JS placed on the formatting of column in the expression of HTML.
Thank you
Ana-MariaAna-Maria
Use a CASE statement in your SQL as follows:
SELECT THE CHECK BOX
WHEN number_bids > 5 THEN
To_char (number_bids) | » '
ON THE OTHER
To_char (number_bids)
END
OffersKind regards
Jon
-
Pulling data from another database in the APEX
Hi all
Within the Apex, is it possible to connect to a different database, possibly another server and select data, update a database of 'local '?
Is it possible to generate strings for connection etc who you allow to request a name of user and password and then run the SQL code?
The two databases are in the same enterprise network and are accessible with SQL Developer, etc.
Thank you!
~ PHello
This could also help
http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35125/advnc_db_link.htm#BABBFICHKind regards
Jari
-----
My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
How the procedure returns a value as a result of the query
Dear Sir
I have a requirement that I want to get a tabular output, we will for example
Create procedure my_test_ret_chr is
Table type is table of the varchar2 (30) index directory.
a table;
procedure p (table array_in)
is
Start
I'm looping 1.array_in.count
dbms_output.put_line (array_in (i));
end loop;
end;
Start
a.1: = 'Apple ';
(2): = "banana";
3 a: = "Pear";
p a;
end;
Select double my_test_ret_chr
When I run this query, it shows the result in a table records like select empno emp;
Then use function pipeline as already say:
SQL> CREATE OR REPLACE PACKAGE my_pkg IS
2 TYPE t_col IS RECORD(
3 i NUMBER,
4 n VARCHAR2(30));
5 TYPE t_nested_table IS TABLE OF t_col;
6 FUNCTION return_table RETURN t_nested_table PIPELINED;
7 END my_pkg;
8 /Package created
SQL> CREATE OR REPLACE PACKAGE BODY my_pkg IS
2 FUNCTION return_table RETURN t_nested_table PIPELINED IS
3 l_row t_col;
4 BEGIN
5 l_row.i := 1;
6 l_row.n := 'one';
7 PIPE ROW(l_row);
8 l_row.i := 2;
9 l_row.n := 'two';
10 PIPE ROW(l_row);
11 RETURN;
12 END;
13 END my_pkg;
14 /Package body created
SQL> select * from table(my_pkg.return_table);
I N
---------- ------------------------------
1 one
2 twoOracle - collection function packaged for use in select return - Stack Overflow
Maybe you are looking for
-
I used the migration assistant to transfer data from my laptop to windows xp for my macbook pro OS X Yosemite 10.10.5 version and she erased all the data on my mac iTunes i.e., photos, documents, games, etc. Is it possible to recover these data or ta
-
AccelerometerSt.exe error on the computer Windows 10 brand new
I have the same problem that many others have with the Application AccelerometerSt.exe error. BUT, I have a brand new - 1 week old computer and it came with 10 windows already on it. I have the HP Envy x 360. How do you intend that to solve the
-
cRIO 9067 to hired 7fh USB RS232
Hello I have a cRIO 9067 and would like to interface with an instrument that has a converter USB-RS232 from SiLabs. I can't comminicate with this instrument easily on a Windows PC. I am able to see the device in MAX when its the cRIO connection. I
-
HP ENVY 4 1070EL: Beats Audio crackles
Hello I have a problem with my HP Envy 4 (1070EL), which is equipped with BeatsAudio, whenever I have would be the option 'Beats Audio"of Control Beats Audio Settigs sound would develop more rich in quality, but it will make a crackling sound which m
-
I have a HP dv6-6102ax running windows 7 Home Premium 64-bit, a 2 x 4 GB modules of RAM installed (@ 1333 MHz) total of 8 GB of RAM. Here is the link of my spec: http://support.HP.com/us-en/document/c02910560 The link above shows in detail the charac