Can be passed to the formula of the procedure/function the column value?
Cf_value is back after some calculation using the main request.Can be passed directly the value of column of formulas of procedure without assinged to placeorder?
as below...
f_convert(:cf_value,new_value);
---------------------------------------------------------------
My procedure is...
PROCEDURE f_convert (val1 val2 in number, number) IS
BEGIN
val2: = val1 * 100;
END;
If anyone knows pls answer me...
In fact, if there is that other calculations he (in Proceudre)
Can I used is like below?
---
PROCEDURE f_convert (val1 val2 in number, number) ISBEGIN
val2: = val1 * 100;
return (val2);
END;
----
A procedure cannot return a value, the return in my previous post clause was part of the function for formula column.
Let's say you have a column of forms of so-called CF_2, then the function because it will be like:
function cf_2formula return number
is
val1 number;
val2 number;
begin
val2 := :cf_1 * 100; -- or val2 := val1 * 100 --parameters not allowed in formula column function
-- All the other code that you need inclusive of calling function, procedure as in any PL/SQL block can be placed
return (val2);
end;
Any calculation can be used in the service of the formula column
Tags: Oracle Development
Similar Questions
-
How can I iterate over the columns of a REF CURSOR?
I have the following situation:
As you can see from the comments in the code, I couln would find examples on the internet with a REF CURSOR low and selecting from multiple tables.DECLARE text VARCHAR2 (100) := ''; TYPE gen_cursor is ref cursor; c_gen gen_cursor; CURSOR c_tmp IS SELECT * FROM CROSS_TBL ORDER BY sn; BEGIN FOR tmp IN c_tmp LOOP text := 'select * from ' || tmp.table_name || ' where seqnum = ' || tmp.sn; OPEN c_gen FOR text; -- here I want to iterate over the columns of c_gen -- c_gen will have different number of columns every time, -- because we select from a different table -- I have more than 500 tables, so I cannot define strong REF CURSOR types! -- I need something like l := c_gen.columns.length; for c in c_gen.columns[1]..c_gen.columns[l] LOOP -- do something with the column value END LOOP; END LOOP; END;
What I found was:
But they have only 3 tables here and I have like 500. What can I do here?CREATE PACKAGE admin_data AS TYPE gencurtyp IS REF CURSOR; PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT); END admin_data; / CREATE PACKAGE BODY admin_data AS PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT) IS BEGIN IF choice = 1 THEN OPEN generic_cv FOR SELECT * FROM employees; ELSIF choice = 2 THEN OPEN generic_cv FOR SELECT * FROM departments; ELSIF choice = 3 THEN OPEN generic_cv FOR SELECT * FROM jobs; END IF; END; END admin_data; /
Thanks in advance for any help!Hope it will help > [Ref Cursor dynamic dynamic Fetch | http://www.oracle.com/technology/oramag/code/tips2003/042003.html]
See you soon,.
AA -
Convert the column values into buckets
Hello
Please help me to convert the column values into buckets.
I have the values of the columns in the following way.
Age of Orderdate * 9 10 12 14 15 18 19 20 21 22 26 27 28 29 33 34 40 45 * and so on
But the requirement is the column values should be displayed in form
Age by order date * 15 1 2 3 4 5 6 7 8 9 10 11 - 16-20 21-25, 26-30 30 + *.
Please someone give me the solution.
Thanks in advance.
Hervé RamaHi Richard,
Just to double check, you have Setup buckets for 1, 2, 3, 4, 5, 6, 7 and 8 individually (each with a fair value). The problem is that you simply do not have all data fall into buckets above, correct?
If this is the case, it looks like has been answered your original question. If so, the label would assign 'Proper' points by clicking on the button label correct next to the appropriate response and open a new thread with your new question. The reason why I say this is it will help other people who have a similar bucket question to your solution, without complicating the issue with subsequent questions.
If you can post a separate thread, I'd be more than happy to help you with your secondary problem.
Best regards
-Joe
-
convert the column values to a single line...
I have to return the column values to a single line separated by commas.
If the nulls in the column just ignore without a comma.
Here is one for example. There are three values and two NULL values in the table
Help, pleaseSQL> select ID from temp_fa; ID ----- 1 2 3 5 6 rows selected. I am expecting an output as 1,2,3,5
There is always more than one title in the Oracle world ;)
You can use the TRIM, for example (same configuration as your example):hoek&XE> create table t as select level col from dual connect by level <= 6; Tabel is aangemaakt. hoek&XE> update t set col = null where col in (1,3,5); 3 rijen zijn bijgewerkt. hoek&XE> select * from t; COL ---------- 2 4 6 6 rijen zijn geselecteerd. hoek&XE> select ltrim(sys_connect_by_path(col, ','), ',') output 2 from ( select col 3 , row_number() over (order by col) rn 4 from t 5 ) 6 where connect_by_isleaf=1 7 start with rn=1 8 connect by rn = prior rn+1; OUTPUT ------------------------------------------------------------------------------------------------------------- 2,4,6,,, 1 rij is geselecteerd. hoek&XE> select trim ( both ',' from sys_connect_by_path(col, ',')) output 2 from ( select col 3 , row_number() over (order by col) rn 4 from t 5 ) 6 where connect_by_isleaf=1 7 start with rn=1 8 connect by rn = prior rn+1; OUTPUT ------------------------------------------------------------------------------------------------------------- 2,4,6 1 rij is geselecteerd.
-
A query can be passed to the user-defined function?
Hello
I created a function that takes one parameter and returns a value. Now tha value that is passed into the function comes also from a query, so can I pass that Charly directly in the parameter?
I tried this but it is giving error: ORA-00936: lack of expression.
Above code is in error. How do I get my requirement?select ID from table1 where areaid=f_getAreaID(SELECT sec FROM table2 WHERE artid='3232') and type='p002'
Note: Assume that query to the function will always return a value of skis.
Published by: bootstrap on August 28, 2011 12:13Subquery must be enclosed in parentheses. Function parameters must be placed in brackets. Therefore, you should use
select ID from table1 where areaid=f_getAreaID((SELECT sec FROM table2 WHERE artid='3232')) and type='p002'
Remember, it must be a scalar subquery (subquery returns one or no line).
SY.
-
Ask in the dashboard as link can filter based on the prompt values?
Hi all
In a dashboard, in a section using the prompt of commands and other section with the image object or the link and the given path was for a query created in the responses. The dashboard looks like a prompt command and below the link to the application.
If I enter the prompt value, click on the link-> the pop up window and view the report but does not filter the data according to the prompt value.
So, it is possible to do like that? If it is please share how to do this?
Thanks in advance!Do not use the link or Image. Use the Guid. NAV. oppose instead. Link or Image may open in a new window, but the guests are not passed. GUID. NAV. object passes guests, which is what you want, but can not open in a new window.
-
Can Financial Reporting get the text value of the Capex planning Module?
Hi all
I read in the documentation that financial information can display Annotation using the planning information as a data connection source. Now, EN 9.3.1 may display the text value of the Capex Module?
I tried to get the value of text, but it shows #error...
Thank youHello
try to use the adapter to details of Planning in Financial Reporting Studio.
Kind regards -
Mark from a table where the column value is a colon-delimited list
Version: Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
Hello
This is a new query of a query Frank helped me with:
Demand is all users to restrict the report based on a multiple selection on the front-end server (application APEX) filter.
The filter returns that a colon-delimited list and the data in the table can be saved in a delimited by a colon list too. There may be 1 to n values (up to 4000 characters).
I need a WHERE clause that will allow a match, if it exists, between the data in the column of the Table and the Mult-selection list filter.
The abbreviated for this post query would be something like:
SELECT slt_id, slt_item, slt_owner
OF slt_dashboard
WHERE slt_owner IN (colon delimited page list);
The Create Table and Insert statements:
CREATE TABLE slt_dashboard ( dashboard_id NUMBER, slt_id VARCHAR2(10), slt_item VARCHAR2(2500), slt_owner VARCHAR2(4000), slt_type VARCHAR2(25), slt_year NUMBER, parent_id NUMBER ); --Insert slt_dashboard INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id) VALUES (12,'1.1','Implement revenue enhancement initiatives','E15889:JPARISI:BDUR63','Business Commitment',2014,6); INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id) VALUES (13,'1.2','Strengthen our Energy position','KVROMAN','Business Commitment',2014,6);
I have a function to separate the list delimited by two points in a table for the IN clause, but because these values can be saved in a delimited list of Colon in the column of the Table, I have a problem, being able to analyze the data in the column, AND the filter data.
The function is:
CREATE OR REPLACE FUNCTION get_list( p_string IN VARCHAR2 ,p_delimiter IN VARCHAR2 DEFAULT ':' ) RETURN vc_array_1 PIPELINED IS l_string VARCHAR2( 32000 ); l_array wwv_flow_global.vc_arr2; BEGIN l_array := APEX_UTIL.string_to_table( p_string ,p_delimiter ); FOR i IN l_array.FIRST .. l_array.LAST LOOP PIPE ROW ( TRIM( l_array( i ) ) ); END LOOP; RETURN; END;
The function called in the query in the form (it's just for reference in case someone wanted to know):
SELECT ... FROM ... WHERE slt_owner IN (SELECT * FROM TABLE( get_list( :P115_SLT_OWNER ) ));
But I can't use this approach because the data in the Table can be saved in a delimited list of Colon too.
Desired output:
If the Mult-Select list filter contains: E15889:JPARISI then
1.1 implementation of the E15889 revenue improvement initiatives; JPARISI (it's a semicolon between the names)
If the multiple-selection list filter contains: KVROMAN then
1.2 strengthen our position of energy KVROMAN
If the multiple-selection list filter contains: BDUR63:KVROMAN then
1.1 implementation of the BDUR63 revenue improvement initiatives
1.2 strengthen our position of energy KVROMAN
Please let me know if something is not clear.
Thank you
Joe
I went to approach the Table and the Page works perfectly.
Thank you to everyone!
Thank you
Joe
-
Compare the column values for multiple lines
I am new to oracle and I have a requirement to compare the values of column across multiple lines. If all column values are the same, I want to display that value, if the columns are not the same, I need to display 'no match' as value. I need id to group values and display a status value based on the above logic. Can anyone offer assistance with dispalying the result expected below?
Sample
Table
State ID
1 S
2 L
1 S
2 S
expected results
State ID
1 S
2 no match
Hello
That's what you asked for:
SELECT id
CASE
WHEN COUNT (DISTINCT status) > 1
THEN "no match."
For ANOTHER MIN (status)
The END as status
T
GROUP BY id
;
Want that if each State ID is NULL? The CASE expression above returns NULL in this situation.
-
Select the column values in the collection
Greetings,
I want to select column values from the collection (plsql tables or table), as the following code, would it be possible
Here tt is any collection
Select emp_no, name, date of birth, sal tt (1), tt (2), tt (3), tt (4) emp; -single line query
Select name, Department of justice, strength and dep_no in tt (5), tt (6), tt (7), tt (8) EMP; -single line query
Version
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
Thanks in advanceNot sure about your business needs. But technically you can do.
declare type tbl is table of number; lemp tbl := tbl(); begin lemp.extend; lemp.extend; lemp.extend; select empno , mgr , sal into lemp(1) , lemp(2) , lemp(3) from emp where empno = 7369; for i in 1..lemp.count loop dbms_output.put_line(to_char(lemp(i))); end loop; end;
-
Update the column values with the new user who has changed the data in the current line
I have a table, the following structure.
CREATE TABLE FILTERCALENDAR1
(DATE OF THE "C_DATE',
NUMBER (1,0) 'DAY_OF_WEEK ',.
NUMBER (1.0) "WEEK_WINDOW."
NUMBER (1.0) "MONTH_WINDOW."
NUMBER (1.0) "YEAR_WINDOW."
NUMBER (1.0) "DATE_YEAR_WINDOW."
NUMBER (1.0) "ONCE_WINDOW."
VARCHAR2 (25 BYTE) "USERNAME."
"LASTUPDATED" DATE
);
Problem:
If a user changes the value of one of the columns I want to write his name to user and sysdate in the 'USERNAME' and LASTUPDATED' columns.
* Tried: *.
I tried an update trigger for this problem, but I get an error table mutation.
The one you suggest how can I achieve this.
ConcerningUse BEFORE the UPDATE trigger
CREATE OR REPLACE TRIGGER myTrigger before UPDATE ON FILTERCALENDAR1 FOR EACH ROW BEGIN :new.USERNAME := user; :new.LASTUPDATED := sysdate; END;
-
Javascript reference the column value
Hi all
I have a JavaScript function defined that I try to get a column value to, but get an error in Firebug.
Here is my selection where I try passing the value.
(There is no space in the onclick and style, but it would not show correctly here)select '<div o nclick="showdetail(this,'||'#ROWNUM#,'||'#PRIMARY#)" st yle="cursor:hand;cursor:pointer;text-decoration:underline;font-weight:bold;">Show</div>' Details, ... from ...
Error readings of Firebug, character not in line showdetail(this,10,#PRIMARY#)
Any help is appreciated.
Thank you
-ChrisHello
Is PRIMARY_NM number of value?
If it is not thenselect '
[+]' Details, ... from ...Kind regards
Jari -
A combine with other values of the column, the column values
Hi allI need your help on this. I have a req I need to combine values of a percentage to the values of column test column. Here are examples of data
Select decode('test',null,'ABC') abc, b.percent, b.amount
from tableA, tableB b
where id = b.id
Examples of data
Amount of the percentage TEST
ABC 0.3 10
ABC 0.5 20
ABC 0.2 30
After him combine the values of percentage to the ABC percentage column values must be zero
Desired output
Amount of the percentage TEST
ABC(30%) 10
ABC(50%) 20
ABC(20%) 30
Valuable suggestions are appreciated
Alter the query from Etbin with a trifle for the exact release.
with
t as
(select 'ABC' test, 0.3 percent, 10 amount of all the double union
Select 'ABC', 0.5, 20 double Union all
Select 'ABC', 0.2, 30 double
)
Select test | ' ('| to_char(100 * percent) |'%)' test, null as a percentage, the amount
t
-
Hello
I use JDev 11.1.1.3
I have a form and a table in the form of my jspx
in my table, I have a column that is not bound 2 DB
in my form, I have a class LOV where I apply value change listener...
When I apply value change listener I want 2 set the value of the column...
Please suggest me a solution
Thanks in advance
Edited by: Venkat Naidu L on March 15, 2011 22:06Try and tell. This should be in quotes. But while coding won't give you any error during compiling.
Reg,
Vini -
can you pass between the United States and Canada app store
Hi... my Bank has an application to the United States that is not available to the Canada. How can I use my Canadian apple ID to switch stores?
Yes and no but mostly not.
The iTunes Store in a country is intended for use only by residents of this country and only while they are in the country. To use the iTunes Store in a country, you must use a credit card (or other type of card so acceptable in a country) published in this country, charged to an address in this country and also be physically present in this country when you use the store. You are also limited to 90 days between countries pending changes.
For example, "the iTunes Service is available only in the United States, its territories and possessions. You agree not to use or attempt to use the Service from iTunes outside these locations. Apple may use technologies to verify your respect. "- http://www.apple.com/legal/itunes/us/terms.html#SERVICE
Maybe you are looking for
-
I use Firefox 9.0.1 on a Windows 7 laptop. Since the upgrade to 9.0 and 9.0.1 Mozilla and Speed Dial open new tabs as if they have been updated, although there has been no update. Colorful tabs 8.0 does as well, but I disabled it.
-
STOR. E CANVIO 2.5 1 TB sleep difficulty
HelloI have a STOR. E CANVIO 2.5 1 TB (HDTC610EK3B1)http://UK.computers.Toshiba-Europe.com/innovation/JSP/individualOptions.do?service=UK&selCategory=112276 2 & oldCategory = 1122762 & OPTION_ID = 1119584 & toshibaSho p = true the problem is the car
-
(1) HP COMPAQ PRESARIO CQ42 WINDOW 2) 7 (3) ENTER THE ADMIN PASSWORD OR POWER ON PASSWORD 4 KEY): 62730476 PLS HELP ME... Thank you
-
Canon Powershot sx60HS distorted, why?
Photo taken with my Canon Powershot SX60HS is always distorted looks very flat angle very right and left. See my example of group photo, taken in MODE P very left. No effect applied simple click to shoot. But all my pictures are now just a waste. I d
-
win mail using 50 to 80% of CPU
I have a question where Win Mail takes a lot of CPU. I have Vista 64 bit, I use Kaspersky AV... I noticed when I went to Kapsersky it takes much longer to download new e-mail messages... but Kaspersky has also found a couple of worms in attachments.