How to do interpolation in oracle
Hello All,
I have minutely level data in the table and I wanted to add these minutely level data for every half an hour and store it seperatly
time value
eg: 06-apr-2004 10:01:00 10
06-apr-2004 10:02:00 12
06-apr-2004 10:03:00 14
06-apr-2004 10:04:00 NULL
06-apr-2004 10:05:00 16
06-apr-2004 10:29:00 14
06-apr-2004 10:30:00 20
The Provblem I am having is In between in an half an hour data their might be null values and I have to "INTERPOLATE" these values and populate the missing value. Can any one please suggest me how to do this in oracle
I wonât be addressing your first question (the one with DATEs) because is not really clear what you want (30 minutes windows ??) ⦠the particularities of your data set are also a bit murky.
For the second test case ⦠first some observations:
1. To make the interpolation results deterministic your table T needs to have some sort of method of getting those rows exactly in the order you listed everysingle_time_ !!
2. What should happen if either the first or the last rows in your list have NULL values?
In any case, exactly for the dataset listed, here is a non-pl/sql solution ⦠there may be better sql-only solutions, but thatâs left for you/others to contribute ;o)
create table bb
( ord number(9) not null
,val number(9) null
Â
insert into bb values ( 1,2);
insert into bb values ( 2,6);
insert into bb values ( 3,null);
insert into bb values ( 4,8);
insert into bb values ( 5,null);
insert into bb values ( 6,null);
insert into bb values ( 7,6);
Â
flip@FLOP> select ord,val
2 ,round(decode(val,null,fv+(rn-1)*((lv-fv)/cnt),val),2) interp_val
3 from (
4 select ord, val, grpa
5 ,count(*) over (partition by grpa) cnt
6 ,row_number() over (partition by grpa order by ord) rn
7 ,avg(val) over (partition by grpa) fv
8 ,grpd
9 ,avg(val) over (partition by grpd) lv
10 from (
11 select ord, val
12 ,sum(decode(val,null,0,1)) over (order by ord ) grpa
13 ,sum(decode(val,null,0,1)) over (order by ord desc) grpd
14 from bb
15 )
16 ) t
17 order by ord
18 ;
Â
ORD VAL INTERP_VAL
1 2 2
2 6 6
3 7
4 8 8
5 7.33
6 6.67
7 6 6
Â
7 rows selected.
Similar Messages
-
How can i invoke an Oracle Report w/in a Java application?
I have a custom java application that I would like to integrate with a report tool. I am reviewing Oracle Reports but I was not sure how I would integrate an Oracle Report.
I have read that I can use Active-X but. Has anyone ever done this? Also - is there any support for a java bean?
I am also wondering how I could pass in report parameters.
It is my understanding that Oracle will generate either pdf or html output which could be viewed through the browser or adobe acrobat reader.
Is this correct?
Please advise.
Thanks in advance.Bonnie,
I create a URL that calls Oracle Reports Server running under IAS, using PDF or html as the output. The Java code calls up the commandline and starts the default browser with the specified URL, which then talks to Oracle Reports Server... and voila... the report shows up in your browser!
have fun...
void execURL ( String pURL )
System.out.println(pURL);
if (System.getProperty("os.name").equals("Windows NT") )
try
Runtime.getRuntime().exec("cmd /c start "+pURL);
catch (Exception e1) {System.out.println(e1.getMessage()); }
else
try
Runtime.getRuntime().exec("start "+pURL);
catch (Exception e2) {System.out.println(e2.getMessage());}
null -
How to create a new Oracle OSB project automaticaly with script without IDE
Hello,
I want to create automatically an "Oracle service bus project" and an "Oracle service bus configuration project" with scripts (ANT or Maven or ...) without using IDE, without using workshop or Eclipse. I want to create automatically (ANT or Maven) just a skeleton of an OSB project witch i can use after in workshop.
I want to create 1 "Oracle service bus configuration project" with many "Oracle service bus project" automatically (ANT or Maven or scripts) witch i can use after in workshop. How to create a new Oracle OSB project automaticaly with script without IDE ? How can i do this ?
I'm using Oracle service bus 10.3.1
Thank you for your help.Thank you for your response,
I do not want to just create the services (proxy services and business services) but I want to create a template for 40 OSB project with the same scripts ANT/Maven.
Template="Oracle service bus configuration project" + "Oracle service bus project" + services of 40 OSB projects
The goal is that I have more than 40 projects to create and just the name of the projects that changes (when I say the name of the project ie the name of the OSB project, the name of proxy services and the name of business services ).
So I want to give my script (ANT/Maven) the name of 40 OSB project and the script must generate the skeleton of the 40 projects at once time and after generation of skeleton of the 40 project, I will import them in the workshop to add manually mapping and routing and other things that differs from one project to another.
So i want to generate automatically a skeletons of 40 OSB projects using a script (ANT / Maven) and I give to the script juste the names of the 40 projects.
I want to create a "Oracle service bus configuration project" and "Oracle service bus project" automatically of 40 OSB projects (ANT or Maven or scripts) witch i can use after in workshop.
I want to create one 'template' of all 40 projects in the same time, with the same directory structure (Transforlation, Business services, proxy services, WSDL .....) and all 40 project have the same transport, just the names of projects and services witch changes and i can give to the script all names of projects and services and i can give also all WSDL.
Regards,
Tarik -
How to see dbms_output on oracle sql developer
ned immediate help
how to see dbms_output on oracle sql developerHi,
In sql developer u have a tab named DBMS Output in your result sheet. In that the first Icon is Enable DBMS Output. turn it on (After on it will give the message set serveroutput on in the sheet) and then run your code.
In the code u have to use the dbms_output.put_line package.after running the code u have to see the result in DBMS Output tab.
Regards,
NTR -
How to extract data from oracle database directly in to bi7.0 (net weaver)
how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
Thanks
YorkYou can use UDConnect to get from Oracle database in to BW
<b>Data Transfer with UD Connect -</b>
http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
<b>Prerequisites</b>
You have installed the SAP WAS J2EE Engine with BI Java components. You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
Hope it Helps
Chetan
@CP.. -
How to enforce index in oracle query
Hi all
how to enforce index in oracle query
RegardsUse INDEX hint to force Optimizer to use the specfied index.
You really need to investigate why Optimizer doesn't choose the index. Remember, INDEX SCAN are not always GOOD.
Jaffar -
How to run command SQLLoader Oracle in c#
Hello,
How to run command SQLLoader Oracle in c#. I try my sourcode for run this SQLLoader, but nothing happen and error "No process is associated with this object.". Please tell me how i fix it. Thanks.
This is my code:
System.Diagnostics.Process process1;
process1 = new System.Diagnostics.Process();
process1.EnableRaisingEvents = false;
string strCmdLine;
strCmdLine = @"/C SQLLDR XL/secreat@O11G CONTROL=E:\APT\LoadXL.ctl";
System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
process1.WaitForExit();
process1.Close();jesperdj ,thanks:)
actually,i am using eclipse to run my ant tasks programmatically,but I got trouble with the AntRunner class.it seems that i should config a proper classloader for it,but i just don't know how.please lend a hand:)thanks
robin -
How to see history in Oracle SQL
how to see history in Oracle SQL
i.e
create table.....
select * from tablename....
delete tablename;
Now i want to see how many command run after login.......please tell me the command...user12261139 wrote:
how to see history in Oracle SQL
i.e
create table.....
select * from tablename....
delete tablename;
Now i want to see how many command run after login.......please tell me the command...I'm not aware of an easy way to see how many commands were run after logging on. Different tools have different capabilities, though.
The ms-dos version of SQL*PLUS offers a Doskey option to use the up and down arrows to recover recently executed commands.
The SQL Workshop in Apex has a command history. Some of the GUI tools might offer similar functionality. -
How to find out what Oracle version?
Hi,
Could anyone tell me how to find out what Oracle version is on your AIX/Unix machine? It looks like Oracle Installer doesn't use the native OS installation(installp,pkgadd) process, so I can't use lslpp/pkginfo to find out what filesets are installed.
Thanks
HQ.Hi!
As far ar Oracle version is concerned, you can find it at the database level after connecting to the database
select * from v$version;
i am not sure if there is someway to find at the o/s level.
Good luck
null -
How to Configure Active-Passive oracle cluster in Windows 2008 R2 64bit Server.
How to Configure Active-Passive oracle cluster in Windows 2008 R2 64bit Server With Oracle 11g R2.
How many database will play in this role.
Best,hello
I was going through your post and i am also doing the same thing here at our organisation for Oracle 10g R2
Can you pls send me any docs u r having for configuration of Oracle in windows clusters .
And, can you pls elaborate on this point
e)Create Oracle Service with the same name in the 2nd node and copy all the files like spfile,tnsnames.ora,listener.ora,password file to Node2.
Pls send me the details at [email protected] or you can contact me at 08054641476.
Thanks in advance. -
How to get resultset from oracle procedure use ejb3
how to get resultset from oracle procedure use ejb3
i know oracle procedure should like this
Create or replace PROCEDURE resultset_test(
aaa IN NUMBER,
bbb OUT sys_refcursor) ....
but what s the ejb3 scripts looks like? please give me an example or link~
ths- there are no EJB3 scripts, only compiled application code
- the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
Now you should know what to Google to get your "example script": "java jdbc oracle procedure" -
How to call Reports in oracle forms 10g
Dear All,
How to call Reports in oracle forms 10g.
I am using Oracle Forms 10g Reports 10g and Database 10 and and Operating system Windows XP.
Please give me the Solution.
Thanks and Regards,
FaziludeenHi Omkar,
Please check the following code.
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List( plid );
END IF;
plid := Create_parameter_List('tmp');
add_parameter(plid,'p_parameter',text_parameter,to_char(:POLICY.POLICY_NO));
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('POL_REP');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
v_rep := RUN_REPORT_OBJECT(repid,plid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
WEB.SHOW_DOCUMENT('http://'||'LENOVO-428E9E41'||'8889'||'/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?
'||'server=prod_report_server&P_parameter='||:POLICY.POLICY_NO||
'¶mform=no');
END;
I am used to Start the Report sever 'Rwserver Server=prod_Report_Server Start'
OracleAS Report Services
Version :- 10.1.2.0.2
Name :- prod_report_server
Status :- Server is Shutting down
Jobs in Queue 0
Active Engines 0
I got the Following Error when I trying to run the Report
FRM-41211: Integration error:SSL failure running another product
Thanks and Regards,
Faziludeen -
How to implement this in Oracle Apps 11i
Hello Friends
I am working as a consultant for a manufacturing company.
They have a format for charging Excise and Sales tax on their products (example below). I dont know how to implement this using oracle apps. Please help me ASAP.
eg.
Product A:
MRP = Rs. 100
Assessable Value (i.e. the value at which I have contract with the Government to pay Excise Duty) = 60% of MRP = Rs. 60 in this case.
Excise Duty = 16% of AV =0.16*60 = Rs. 9.6
Now, lets suppose I am selling my product to a dealer at 30% discount.
Therefore, Sale Price = 70% of MRP = Rs. 70
Sales Tax = 4% of Sale Price = 0.04*70 = 2.8
Therefore, total revenue from the deal = 70-9.6-2.8 = Rs. 57.6you can use Advance Pricing or creating discount or attiribute while calculating.
this is not much complex, possible even with Advance Pricing too. Thanks
Shiv -
How to get guid in oracle 8?
Hi,
how to get guid in oracle 8
regards
Dupont
nullHi Anjum,
You can try to read the current business transaction GUID in email view by reading global data context reference. Something like this:
*- Data dictionary
DATA lr_gdc TYPE REF TO if_crm_ui_data_context.
DATA lr_bt TYPE REF TO cl_crm_bol_entity.
DATA lv_guid TYPE crmt_object_guid.
*- Get current business transaction from global data context
lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( ).
CHECK lr_gdc IS BOUND.
lr_bt ?= lr_gdc->get_entity( name = if_iccmp_global_data_cont_con=>gdc_currentbt ).
CHECK lr_bt IS BOUND.
lv_guid = lr_bt->get_property_as_string( 'CRM_GUID' ).
Kind regards,
Garcia -
How i can deal with oracle file by using php api
how I can deal with oracle file by using php api ?
What has this to do with Reflections and Reference Objects?
Maybe you are looking for
-
Does not open http or https pages but youtube opens?
My any browser is not able to open http or https pages but opens youtube or any other vedio site. Only Internet Explorer on my pc opens google and none other browsers ( Opera and Mozilla Aurora ) do so. I'm having this problem from a very long time,
-
Error while trying to Insert a pdf file in database
Hi All, I have sent this problem to Informix. By any chance if you had faced the same problem and found the solution, pls send mail to [email protected] Thanks Babu Hi there, I tried to insert a pdf file in to Informix database. I follow
-
With clause in a stored procedure with update
create table TEMP_STAGE as (select '111111' student_id, 'N' TMP_TEST FROM DUAL UNION select '111111' student_id, 'N' TMP_TEST FROM DUAL UNION select '222222' student_id, 'N' TMP_TEST FROM DUAL CREATE OR REPLACE PROCEDURE TEMP_SEC_TEST AS BEGIN UPDATE
-
Why is Fault Policy working only when the BPEL's transaction is requiresNew
Hi All I've defined Fault policy & fault bindings files for faults in my BPEL process. I'm using Oracle SOA Suite 11g. But the fault management framework is properly working only when the transaction property(bpel.config.transaction) of the BPEL is s
-
I recently started using numbers with Pages to produce reports. After a period of weeks with all operating well I am now getting unexpected quits with both pages and numbers with the message: "The application Numbers (Pages) quit unexpectedly. The Pr