Forms :: Pick Single Value From Range?
Mar 19, 2012
i have to pick single value from the given range based on value entered by user, for example if user enter the length 2499 it should be considered as 2000 if he enters 2000 its 2000 or he enters 2501 it will return 2500 , i have written a huge if condition for this purpose in my program which looks very cumbersome,is there a simple to do this other than this method.
the code is as below.
[CODE]
IF
( :CSDO_STORE_RECD_LENGTH - SUBSTR(:CSDO_STORE_RECD_LENGTH,(LENGTH(:CSDO_STORE_RECD_LENGTH)-1),LENGTH(:CSDO_STORE_RECD_LENGTH))) =2000
THEN M_RCVD_LENGTH := 2000;
ELSIF
[code].....
View 9 Replies
ADVERTISEMENT
Mar 10, 2012
I need to pick a value based on range like if the range is as below
[code]
if value =2000 then its 2000
elsif value >=2001 and value <=2499 it should be 2000
elsif value =2500 then 2500
elsif value >=2501 and value <=2999 it should be 2500
elsif value = 3000 then it should be 3000
[code]
Like this i need to pick a value by hardcoding this range and this look cumbersome in my program , is there a simple way to substitute this entire thing by passing one single value and getting one single value using a command or builtin.
View 2 Replies
View Related
Jul 11, 2013
I got a situation to develop a complex query. Here is the scenario. I have to pick all the continues range of values into one bundle. like in following example, rows having values between 20 to 25 should have one bunch and 27 to 28 should have another as there is no from or to value from 25 to 28. with q1 ( select 20 as Frm, 25 as tto from dualunion allselect 20 as Frm, 21 as tto from dualunion allselect 20 as Frm, 22 as tto from dualunion allselect 20 as Frm, 20 as tto from dualunion allselect 21 as Frm, 22 as tto from dualunion allselect 28 as Frm, 28 as tto from dualunion allselect 27 as Frm, 28 as tto from dual)select * from q1;
View 10 Replies
View Related
Jun 18, 2013
How to pick excel data in oracle form 6i. and data show in forms column ?
View 1 Replies
View Related
Oct 12, 2010
create table test1(x number, y date)
insert into test1 VALUES (1, '01-OCT-2010');
insert into test1 VALUES (1, '01-OCT-2010');
insert into test1 VALUES (1, '01-OCT-2010');
insert into test1 VALUES (1, '01-OCT-2010');
insert into test1 VALUES (1, '01-OCT-2010');
insert into test1 VALUES (1, '01-OCT-2010');
insert into test1 VALUES (1, '01-OCT-2010');
[code]....
I need an sql which would pick 3% of the records per day
select count(*), y from test1
group by y
21 10/1/2010
14 10/2/2010
6 10/3/2010
So I need 3% of 21 (.63) randomely picked up for 10/1.
similarly 3% of total number of rows from 10/2, 10/3 to be picked up.
View 2 Replies
View Related
Jul 19, 2010
I have need, where I need to pick-up the one of the records out of 2, which have all the fields same but one key column? how should I do it?
sample data:
IDnamecreation dateupdate date
121233ATR7/19/2010 15:307/19/2010 15:30
1213344MTR7/19/2010 15:307/19/2010 15:30
For most of the cases, i am picking latest data using update date, but here where dates are same, I am stuck.
View 2 Replies
View Related
Jul 9, 2010
I have a reqmt that is little complex.
Example: (Real Data)
Table1 (Column Name)
Height
Width
Color
Table2
ID,Height, Width, Color, Remarks
1,2,3,NULL,NULL
2,NULL,NULL,2,NULL
3,1,2,3,4
What I require is pick up the data from table1 and for each row in table1, check the corresponding column to see if null. If null create a counter and add 1 to it.
I would only check for 1 record at a time in table2 (ID is input parameter in pl/sql) In other words, if my ID is 1, my count should be 1 (since COLOr is null in table2 for id=1 and color is a row in table1) if my id is 2, count is 2 (ht and width are NULL and are both separate rows in table1) if id is 3, count=0 since all fields have data even though some of these columsn exists as rows in table1.
View 25 Replies
View Related
Dec 11, 2010
I have a field called percentage , where user doesnt want to enter any data , instead he wants a poplist like 0-100 when he clik the range will come as 0-10,10-20 and so on like 90-100 how i can do it he will increase and decrease it.
View 1 Replies
View Related
Jun 13, 2010
I want to make a trigger , to store values that are affected during any DML(insert,update,delete).
CREATE OR REPLACE TRIGGER generate_log
BEFORE INSERT OR UPDATE
ON EMPLOYEE
FOR EACH ROW
DECLARE
[code]....
View 8 Replies
View Related
Sep 1, 2010
Am working on a workbook to count the number of enrolments and withdrawals in the program. My data looks like this
name semester status year
A 1 enrol 2010
A 2 withdraw 2010
A 3 enrol 2010
B 1 enrol 2010
B 2 withdraw 2010
I want to count their latest status only. It should come up with
Total Enrol - 2
Total Withdrawn - 1
For total Withdrawn, I tried 'rank' and filter to equals 1 but it does not allow me. Is there any way to have this work?
Here's my calculation:(decode((FIRST_VALUE(status) OVER(PARTITION BY year, name ORDER BY semester DESC)),'withdraw', name)) It tells me that 'Aggregation of Analytic function not allowed'
View 3 Replies
View Related
May 7, 2012
I want to read a range of excel by webutil in oracle form. I use command:
ole2_client.get_obj_property(worksheet, 'Range', args);
I want to know a list property of an OLE2 Automation Object?
View 3 Replies
View Related
Sep 13, 2010
i create form on which 3 window, 3 Canvas, 3 blocks are there.
1)first block contain 3 items from_date and to_date(nondatabase)and find button
2)second block contains 3 items segment1, quantity and payment_terms
when i enter 2 dates and click on find button 2nd window open. segment1 and quantity between this 2 dates comes from base table like
select segment1,quantity
from po_lines_all pll, mtl_system_items mts
where pll.ITEM_ID=mts.INVENTORY_ITEM_ID
and creation_date between :FROM_DATE and :TO_DATE
and payment_terms should enter manually
3)2nd block contains summary button when i click on it, it save segment1, quantity, payment_terms and open new window which contain segment1 ,qty, payment_terms and when i click on summary button data comes from custom table which group clause means
suppose
item qty terms
a 2 2days
a 3 2days
b 3 3days
then on third form i shows like this
a 5 2days
b 3 3days
i done all this things but problem is that
suppose once data between 21-aug-2010 and 24-aug-2010 comes on second form , i enter payment_terms and save it. sumaary form also run properly but if another user enter date between 22-aug-2010 and 30-aug-2010 then it will shows data between 21-aug-2010 to 24-aug-2010 from custom table i.e with payment terms as earlier it save and from 25-aug-2010 to 30-aug-2010 it shows data from base table
like
item qty terms date
a 2 2days 21aug
a 3 2days 22aug
b 3 3days 24aug
b 4 NULL(ENTER MANUALLY) 26aug
c 5 NULL 27aug
View 1 Replies
View Related
Jan 6, 2011
I am facing the problem of hanging in my forms 10g application.But,the place of hanging is different.There is no other user,using the same application.
View 2 Replies
View Related
Mar 5, 2012
I would like to insert a value if that value is not existing in the table (example for a column which contains date only new dates should be inserted and if the date already exists in the column then it needs to get updated )
example of scenario...
date s1 s2 s3
in the above if the date is new..it should get inserted with the appropriate slot no.(s1,s2,s3) if the date already exists it needs to update the no.in slot no.
View 8 Replies
View Related
Sep 26, 2010
I have created tab canvases in the tab canvas there is three tab pages.and i have been used one datablock(use the datablock wizard) all the table column(items) is displayed only in the single tab pages--frames.for example
datablock--items_1.
tabcanvases--tabpages_1--frames_1--display all datablock item.
--tabpages_2--frames_2--none to display.
--tabpages_3--frames_3--none to display.
so i want to display datablock in all the three frames.
View 3 Replies
View Related
Apr 23, 2011
can I query sql server and oracle in a single form
View 1 Replies
View Related
Apr 22, 2010
My form consist two datablock cust_mstr,cust_dtls, each customer code consists two or three contact details records, when i delete the single detail record instead of deleting single record it deletes all the details records from cust_detail table.
Here by i attaching my form for your reference pls find the code in delete button
View 12 Replies
View Related
Jul 14, 2008
From my form with a single button i need to display a report with a paramter. Report is displaying fine but the parameter is not getting passed. I did the following behined my button i add this
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
vParamValue number := 20;
[code]...
If i remove the where condition the whole table data start appearing in the report but adding where condition is not accepting 20 as i send from the FORM Button. And the report with blank data appeared with column headings.
View 5 Replies
View Related
Sep 1, 2010
I am using forms 10g...
I have 2 blocks,in one i insert student_id and when i click on the button i should get all his courses in the other block...
BUT.. when the student has more than 1 course I get this:
when button pressed trigger raised unhandled exception ORA-01422
Here is the button
begin
select TEST_STUDENT_INFO.stud_name,TEST_STUD_CRSE_DETAIL.crse_no,
TEST_COURSES.crse_name,TEST_STUD_CRSE_DETAIL.crse_type,TEST_STUD_CRSE_DETAIL.crse_type_desc,
TEST_COURSES.crse_time
INTO :stud_name,:crse_no1,:crse_name,:crse_type1,:crse_type_desc1,:crse_time
from TEST_STUDENT_INFO,TEST_COURSES,TEST_STUD_CRSE_DETAIL
where (TEST_STUD_CRSE_DETAIL.STUD_ID =:TEST_STUD_CRSE_REG.STUD_ID)
and (TEST_STUDENT_INFO.STUD_ID =:TEST_STUD_CRSE_REG.STUD_ID)
and (TEST_COURSES.CRSE_NO = TEST_STUD_CRSE_DETAIL.CRSE_NO)
and (TEST_STUD_CRSE_DETAIL.CRSE_TYPE = TEST_COURSES.CRSE_TYPE);
end;
but if the student has ONLY ONE course it WORKS FINE!
View 4 Replies
View Related
Nov 21, 2012
I have an script.sql that receives as a parameter an string.
example:
@C:/myscript.sql "o'connor"
user_account_value varchar2(120) := '&1';
EXECUTE IMMEDIATE "Select * from Table where column = :1 " USING user_account_value I am not sure how to deal with string that contains single quotes.
If the parameter were passed as : "o''connor" this will work
If the parameter is pass as: "o'connor" this will not work.
so my question is what options do I have to deal with dynamic queries and single quotes.
I tried replacing replace(myParameter,'''',''''''); but not working well.
View 11 Replies
View Related
Nov 3, 2010
Consider below is a multi record block rows, i want to hide "23". Is it possible using Set_Item_Instance_Property or any other built-in is there in oracle forms to hide a single row field in a multi record block.
11 12 13
21 22 23
31 32 33
. . .
View 3 Replies
View Related
May 30, 2010
I have a Master block and a Detail Block. They are related using two columns, Document_ID and Page_no. I want to display all the records in master table with corresponding detail records beside them in single line. i.e., as shown below:
MasterItem1 DetailItem1 DetailItem2 DetailItem3
I created the relation between them and executed query. When I execute query in the form, I can find that all the Master Items are displayed in vertical records, but i can only see one record of detail fields. They are displayed as shown below:
mitem1-value1 ditem1value1 ditem1value2 ditem1value3
mitem1-value2
mitem1-value3
mitem1-value4
When the navigate down in master items, then the corresponding detail values are being shown on the same first record.
View 1 Replies
View Related
Mar 28, 2011
The main qn is in the subject line.
I have used the following code
GO_BLOCK('CHILD_BLK');
FIRST_RECORD;
LOOP
IF NVL(:CHILD_BLK.SELECT_FLAG,'N')='Y' THEN
V_REC_NO := GET_BLOCK_PROPERTY('CHILD_BLK',CURRENT_RECORD);
SET_ITEM_INSTANCE_PROPERTY('CHILD_BLK.ASSET_DESC',
V_REC_NO,
[code]....
View 5 Replies
View Related
Aug 10, 2005
I have multirecord block and I want to disable Inserting/Updating/Deleting more then one record at a time.
View 32 Replies
View Related
Jan 27, 2012
I have made a travel booking system which comprises of 3 forms
1)Travel Booking form
2)Reservation Form
3)Cancellation Form
Under one booking number i can add multiple users in which they can have there multiple travels.
Users can cancel there individual travels under a prescribe booking number which on doing the Cancel flag turns to 'Y'.
What i want is, If a user is cancelling his/her travel under any booking number then while retriving the records in Travel Booking form, the travels which are cancelled should not be in enable mode.
For one user there can be 4 travels out of which 2 are cancelled, how can i track only those records whoes cancel flag is set to Y. some logic to find it out. Else can i use :system.cursor_record. If yes, How to use it for this system.
View 9 Replies
View Related
Mar 26, 2012
I have a table with the following fields :
RGS_CAN_PERIOD NUMBER(4)
RGS_ID_ELECTOR NUMBER(
FBD_NID VARCHAR2(14)
RGS_SURNAME VARCHAR2(40)
RGS_O_NAME VARCHAR2(40)
RGS_ALIAS VARCHAR2(30)
RGS_ADDR VARCHAR2(75)
RGS_ID_REG_AREA VARCHAR2(3)
[Code]..
I need a report as hereunder :
Reg. Area Age <=19 20 <= Age <= 24 25 <=Age <= 29 Total No. of Voters
xxxx 10 15 7 32
yyyy 5 7 3 15
I have work out a script but the age is not in a range
select *
FROM (select rgs_id_reg_area,
count(decode(fbd_age,19,fbd_age)) Age19,
count(decode(fbd_age,20,fbd_age)) Age20
FROM rubyvoterstat where vote ='Y'
GROUP by rgs_id_reg_area)
order by rgs_id_reg_area
View 1 Replies
View Related
Dec 5, 2011
In my prod table few partition need to be added.
I tried below both syntax, but I am getting error
1)
Alter table STS.DNA_ACCESSION add PARTITION DNA_ACC_P143 VALUES LESS THAN (286000000);
ORA-14074: partition bound must collate higher than that of the last partition
2)
ALTER TABLE STS_RO.DNA_ACCESSION
SPLIT PARTITION DNA_ACC_P999 AT VALUES LESS THAN (286000000)
INTO (PARTITION DNA_ACC_P143,
[Code]....
View 4 Replies
View Related
Sep 20, 2010
I have table :TABLE_X and want to select some data locate into specific range of Day/Month. But so far i couldn't find out the way to.
For example, i want to select people born within specific range of date(range : sysdate to (sysdate+7months ahead) Year here should not be consider, only the day and month.
e.g. a range could be from today:Sept,20 to Apr,18.
so what i was trying is to select doing the following.
select TABLE_X_ID, TABLE_X_BIRTH_DATE
from TABLE_X
where to_date(TABLE_X_BIRTH_DATE, 'DD/MM')
between to_date (to_char(SYSDATE, 'DD/MM'), 'DD/MM')
and to_date (to_char(SYSDATE+210, 'DD/MM'), 'DD/MM')
first am not sure if BETWEEN & AND will work for this case, bt it was the most logical way i could think about to get such range.
View 13 Replies
View Related
Jun 12, 2012
I have a table like this:
x y AMNT
---------------------------------------
1 120 12
1 120 93
1 125 31
1 260 15
2 56 16
2 115 49
3 45 71
4 19 11
4 16 48
5 94 52
5 98 47
I want to group records on x , y columns and aggregate on amnt column, in which difference between values of y column be less than 10.
The result is like this:
x y sum(AMNT)
------------------------------------------------
1 ? 136
1 260 15
2 56 16
2 115 49
3 45 71
4 ? 59
5 ? 99
What query can I use?
View 6 Replies
View Related
Jul 22, 2011
this is my table
create table sequence ( id int not null primary key);
insert into sequence(id) values
(1), (2), (3), (4), (6), (7), (8), (9),
(10), (15), (16), (17), (18), (19), (20),(22);
i need the answer to group the sequence like this
start_number | end_number | count
1 | 4 | 4
6 | 10 | 5
15 | 20 | 6
22 | 22 | 1
what should i do?
View 1 Replies
View Related