Why is the output of rounding functions a double?
I thought the whole idea of rounding was ending up with an integer?
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
rolfk wrote:
It returns whatever datatype you input in it. Makes a whole lot of sense as anything else would require allocation of a new data value in memory.
Returning the same datatype sounds fine and dandy - until you think about it carefully (from the user experience side of it). Why would you put anything but a fractional number into it? So it's always going to return an approximation of an integer unless you actually plug an integer into it? It just seems silly - strictly from a user standpoint - that you have to take one more step to get an actual integer. To me, it's unexpected behavior, no matter how much sense it makes technically. Again, though - all you have to do is coerce it to whatever you need it to be and only generate a new data value only when you have to.
I feel a little like I'm X. right now.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Similar Messages
-
Storing the output of a function module into a custom table
Hi Gurus,
Is it possible to store the output of a function module into a custom table.How can this be done?Is it complex?hi,
After u execute the FM and get values in the internal table ITAB_RESULT. Create a custom table having structure same as ITAB_RESULT call it ZRESULT.
data :wa type ITAB_RESULT.
call FM and get result it ITAB_RESULT
loop at itab_result.
move-corresponding itab_result to wa.
insert wa to ZRESULT.
endloop.
Regards,
Mansi. -
How to break the output in a function
Hi All,
I am using oracle Db 10g
I have write a function to get the output of Expire date and pass this function to Alert in oracle.
My Function is Like this
create or replace
function Expiry_alert (P_EXPIRY_DATE date)
return VARCHAR2
IS
lv_return_value varchar2(10000);
cursor c_exp_alt
is
SELECT Distinct c_po_number,c_bg_type,c_guarantee_number,c_expiry_date,c_supplier_name
from xxbgs_bank_guarantee_master
WHERE TRUNC (TO_DATE (C_expiry_date) -15) = TRIM (SYSDATE)
and c_expiry_date= p_expiry_date;
BEGIN
for c_exp_alt_rec in c_exp_alt
loop
lv_return_value:= lv_return_Value||CHR(10)||'Bank Guarantee('||c_exp_alt_rec.C_guarantee_number||','||c_exp_alt_rec.C_BG_TYPE ||','||c_exp_alt_rec.C_po_number||','||c_exp_alt_rec.c_supplier_name ||')'||'is getting expired on'||'('||C_EXP_ALT_REC.C_EXPIRY_DATE||')'||;
end loop;
return(lv_return_value);
exception
when others then
null;
--dbms_output.put_line ('Error:'sqlerrm);
--return(lv_return_value);
END;
When i execute the function using select statement like this
SELECT distinct Expiry_alert(C_EXPIRY_DATE)
FROM xxbgs_bank_guarantee_master
WHERE TRUNC (TO_DATE (C_expiry_date)-15) =
TRIM (SYSDATE)
My output is like this
Bank Guarantee(100012,Parent Company Guarantee,1000,Advantage Corp)is getting expired on(02-MAR-12) Bank Guarantee(123890,Advance Bank Guarantee,1011,Office Supplies, Inc.)is getting expired on(02-MAR-12)
In a single line, But here i have two different Guarantee number so i need two records like this
Bank Guarantee(100012,Parent Company Guarantee,1000,Advantage Corp)is getting expired on(02-MAR-12)
Bank Guarantee(123890,Advance Bank Guarantee,1011,Office Supplies, Inc.)is getting expired on(02-MAR-12)
Can any one pls tell me how to change the function to achieve this.
Regards
Srikanth
Edited by: Srikkanth.M on Feb 16, 2012 4:41 PMSrikkanth.M wrote:
Hi All,
I am using oracle Db 10g
I have write a function to get the output of Expire date and pass this function to Alert in oracle.
My Function is Like this
.. snip ..
exception
when others then
null;
Seriously? Your function contains an exception handler to mask any and all errors that may occur? WHY?
When i execute the function using select statement like this
SELECT distinct Expiry_alert(C_EXPIRY_DATE)
FROM xxbgs_bank_guarantee_master
WHERE TRUNC (TO_DATE (C_expiry_date)-15) =
TRIM (SYSDATE)
My output is like this
Bank Guarantee(100012,Parent Company Guarantee,1000,Advantage Corp)is getting expired on(02-MAR-12) Bank Guarantee(123890,Advance Bank Guarantee,1011,Office Supplies, Inc.)is getting expired on(02-MAR-12)
In a single line, But here i have two different Guarantee number so i need two records like this
Bank Guarantee(100012,Parent Company Guarantee,1000,Advantage Corp)is getting expired on(02-MAR-12)
Bank Guarantee(123890,Advance Bank Guarantee,1011,Office Supplies, Inc.)is getting expired on(02-MAR-12)
Can any one pls tell me how to change the function to achieve this.Sounds like you need a pipelined function to return multiple rows...
Basic example of pipelined function with multiple columns...
CREATE OR REPLACE TYPE myrec AS OBJECT
( col1 VARCHAR2(10),
col2 VARCHAR2(10)
CREATE OR REPLACE TYPE myrectable AS TABLE OF myrec
CREATE OR REPLACE FUNCTION pipedata(p_str IN VARCHAR2) RETURN myrectable PIPELINED IS
v_str VARCHAR2(4000) := REPLACE(REPLACE(p_str, '('),')');
v_obj myrec := myrec(NULL,NULL);
BEGIN
LOOP
EXIT WHEN v_str IS NULL;
v_obj.col1 := SUBSTR(v_str,1,INSTR(v_str,',')-1);
v_str := SUBSTR(v_str,INSTR(v_str,',')+1);
IF INSTR(v_str,',')>0 THEN
v_obj.col2 := SUBSTR(v_str,1,INSTR(v_str,',')-1);
v_str := SUBSTR(v_str,INSTR(v_str,',')+1);
ELSE
v_obj.col2 := v_str;
v_str := NULL;
END IF;
PIPE ROW (v_obj);
END LOOP;
RETURN;
END;
SQL> select *
2 from table(pipedata('(1,2),(3,4),(5,6)'));
COL1 COL2
1 2
3 4
5 6of course why you need to do this in a function in the first place? Can't you just query the data concatenated as you want it? -
Populating the output parameter in function module.
Hi Experts,
I have written a function module,with material number,BEZEI as input and mvgr2 as output from table tvm2t.I am facing a problem in populating the material number as well in outputtable.The material number in input is nothing to do with output.
please help me at the earliest.
Regards,
Sridevi.Hmmm, you wrote that the output is 'table parameter' but you mention 2 single fields. If you expect a good reply here, it helps to mention how you defined the table and how you select the data for the output. For example: input is matnr and you select the material group of this matnr. Output is all other matnr of this material group. Then we would know what you want to do here.
So please describe what you need and give us the table description.
Regards
Nicola -
How to assign the output of a function to a text area: a PLSQL challenge
I have a function that returns a PLSQL table of varchar4(4000)
Here is its signature in a package:
create or replace package researcher_request_pk
is
TYPE query_table_type is table of varchar2(4000) index by binary_integer;
FUNCTION RequestSQL(P_RRQ_ID in number) return query_table_type;
end;
I use this to get around the 32k limit on clobs and varchar2 variables
I want to assign the output of the function to a text area. I've tried the following PLSQL in a dynamic action and also as the source attribute of the Text Area but it doesn't populate the text area.
Here is the code i'm using
declare
v_table researcher_request_pk.query_table_type;
begin
v_table:=researcher_request_pk.RequestSQL(:P64_RRQ_ID);
for i in 1..v_table.count loop
htp.prn(v_table(i));
end loop;
end;
Any ideas on the correct syntax to do this?
thanks in advance
PaulPThanks for your reply
The function does populate the PLSQL table with data. e.g. If I place that exact code in a PLSQL region it generates the output on the screen with no problems. The problem is just generating the output into the text area.
I want the text area to display the output of the PLSQL table (-a dynamic select SQL statement) which I then plan to execute to return records.( i.e. I've build my own runtime query builder)
My plan is to allow the user to edit the SQL output first before sending the statement for execution.
Funnily enough I do get the very first word of the first cell appearing, namely 'SELECT' but nothing else. Maybe the "||" that follows has something to do with the rest of it not appearing?? hmmm... will experiment more.
thanks
PaulP -
Why is the output file jerky ?
Hi there,
I have AE CS5 on my Mac. My system is 27" iMac core i5 with 12 GB RAM DDR3 1333 MHz with quad core.
I rendered a 40 seconds clip with an earth spinning.
I output it to mov format in 1920 x 1080.
When I did a RAM preview, it was fine & the earth was spinning smoothly.
But the output file (in mov) - (I did thru Composition > Make movie) when I play using QuickTime player is jerky at 20th Sec to 29th sec.
I then import this mov file into Final Cut, it look stuck in the Viewer but was perfect on the Canvas.
When I render in Final Cut, the output file as mov and use the same Quick Time player to play it & it is perfect.
Can I know what is the reason that it is not working in Quick Time the first time when it was fresh out from AE ?
Thank you.
CheersThe default render settings use Quicktime Animation codec at best quality. These files will not playback smoothly because the data rate is too high for the hard drives to keep up with. The animation codec is a lossless codec designed not designed for playback.
Final Cut uses compressed codecs designed for playback as the default. I'd suggest that you open up the help files (F1) and read the entire section on Rendering and Exporting (link). -
Why is the Output Panel in Bridge blank?
When I select the Output Workspace in Bridge, the panel at the right is blank - no buttons, fields, or anything other than a monotonous dark gray surface. When I select the Output button and the Output to Web or PDF option, nothing happens.
In edit/preferences/start up scripts do you have check marks for eveything?
-
Hi. How come the output of the code below is "FALSE"?
Im actually suppose to use a bean here but to simplify, I made it as inner class.
public class TestString {
MyAccount account = new MyAccount();
public TestString(){
account.setPremiumType("Motorcyle");
String type = account.getPremiumType();
if (type == "Motorcycle")
System.out.println("TRUE 1");
else if (type.equals("Motorcycle"))
System.out.println("TRUE 2");
else System.out.println("FALSE");
class MyAccount{
String type;
public MyAccount(){
void setPremiumType(String type){
this.type = type;
String getPremiumType(){
return type;
public static void main(String[] args){
new TestString();
}LOL. That was a good one.I was staring at it for a good long while, thinking it must be some weird quirk having to do with order of instantiation/initialization for nested classes. When I actually saw it, I blurted out "oh, fuck." My not-quite-four-year-old looked up from where he was almost falling asleep and asked "What?"
-
Need to capture the output of parseEscapedXML() function in a variable
Hi All,
In my BPEL process, I am fetching the XML data from the database which is stored in a CLOB column, using the database adapter. As it is in a string type I am using parseEscapedXML() function to get the XML data out.
I have done the following:
Imported the XSD to the project. Created a variable of element type and in the type explorer , navigated to 'Project Schema Files' -> My .XSD file -> complex XML element. But when I use this variable in any of my process activities, I get the following compilation error:
Error(58):
[Error ORABPEL-10010]: unresolved element
[Description]: in line 58 of "<bpel procedure path>", XML element "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}OutboundPaymentInstruction" of variable "Variable_2" is not defined.
[Potential fix]: Make sure the XML element "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}OutboundPaymentInstruction" is defined in one of WSDLs that are referenced by the deployment descriptor.
Which WSDL file is the error referring to (I use empty BPEL process as the template)
Could anyone please let me know how do I create a variable which is of my XSD type and use the variable for further transformation.
Thanks a lot.
Regards,
PradPrad,
Did you get this resolved? I am having the same issue and can not get it to work.
Thanks
Troy
Message was edited by:
user641994 -
Why is the output of this 11?
public class Test4
public static void main(String[] args)
int x = 2;
x = ++x + x++ + ++x;
System.out.print(x); // Prints 11
}Uuuupss.
I said "maybe".
The logic behind this is that;
++x return the incread value
x++ return the nonincreased value.Can the increment operators said to be returning
anything at all? Not sure - I wouldn't say it.Yeah, "return" is not the correct term.
They are expressions, and the expressions have values. The value of the x++ expression is x's original value, and the value of the ++x expressions is x's incremented value. -
Why is the output of the program "String S is null"
public class StaticOverLoad
public static void get(String S)
System.out.println("String S is null");
public static void get(Object O)
System.out.println("Object O is null");
public static void main(String args[])
StaticOverLoad.get(null);
}When the compiler tries to resolve an overloaded, it tries to get the most specific match. String is a subclass of object, so it is not specific. You can the call the other method by being explicit about your argument type.
StaticOverLoad.get((Object) null); -
Hi,
I'm running LR 3.4 64bit on a PC. My external drive starting generating error messages so I went out a purchased a 2nd external drive (3TB Seagate) to migrate my image Catalog over. Within LR's Import dialog screen I selected the Source drive (old; error-generating drive) and the Destination as my new drive. I ensured that Move was selected (vs. Copy or New).
I had on the order of 50k images. This morning I checked my catalog and the files appear to have moved over just fine. However, now the image count is >100k!
Any ideas on 1) what I did wrong, 2) what steps I can take to 'de-duplicate' the images in my catalog without manually going through?
Thanks in advance!
MachabaI notice it that users often use the Import feature in LR incorrectly. That creates a lot of problems.
The Import feature is for images that are NOT yet in LR. Only when - for some reasons - you want the same images twice in LR you use the Import and un-check the "Do not import suspected duplicates".
In your case you must have un-checked the "Do not import suspected duplicates" -box in the Import dialog.
As the previous poster already noted the best way to move whole folders or even drives of images is to move them in your OS.
In LR you then get a question mark besides the folder where the photos previously were.
Just right-click the folder with the question mark and point LR to the new location - that's all.
But you imported and now all images show twice.
If your images are all on the new HD (check if they are all there!), right-click the top-most image folder on your "old" HD and select "Remove". This will remove the folder from LR but will not delete your images. LR should then show only 1 set of images on your new HD.
WW -
I am using the "Format and String" function in a vi with the "string" input wired to a string of type "0.9998,0.9899,1.0003,0.9995, (etc)". I have wired the "format string" input to a string constant "%1.4f". Irrespective of the format string, I always get a number out that is rounded to 2 decimal places. I have tried different number formats in the format string, and I have wired a 4d.p. floating point number to "default". I have also set the precision of the format string to 4 d.p. with no effect. Any suggestions (or is the output always rounded to 2 d.p.)?
Hi,
If you are looking at the result in a numeric indicator, then the default setting is 2 places of decimal, that is displayed.
You need to right click on the indicator and select Format & Precision then change the Digits of Precision value.
Ray.
Regards
Ray Farmer -
Native compilation and the ROUND function
Native Compilation Advisor lists the built-in ROUND function as not supported for natively compiled stored procedures. Is there a suggested workaround?
oracle by oracle wrote:
I am trying to test performance of one package and there is only one procedure wich uses just instr and substr internal functions ( I am working with varchar2).
I am having the folowing results: native compilation is twice worst than inetrpreted. What may be the reason?
P.S. I did ALTER SYSTEM FLUSH SHARED_POOL;Yuo should take this into account that the Native compilation is not supposed to make the code always go faster. If I remember correctly, the maximum benefit that Oracle benchmarked for it was about 30% only and taht too, if the code has lots of computational code rather than queries. If your package contains lots of this kind of code. than may be the Native compilation may be faster than the other but it doesn't come with any guarantee like this.
Have a read about it from here,
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2278
HTH
Aman.... -
Querying the output of a batch/scheduled report
We haven't move to Discoverer Viewer as of now. One of the questions I have to those who have already implemented it is, can you schedule a batch report in the viewer and then users are able to query the RESULT of it without querying back the database? We have concerns on performance during the day so scheduling reports to run at night would be convenient for us.
thanks for any comments........In the concurrent program screen, select options . Under Notify the following person, eneter the email address where output needs to be sent.
Other option could be to create a send mail package and call that from after report trigger of report. The email address can be inputed as a parameter. For more information for this visit
http://sureshvaishya.blogspot.com/2008/02/email-through-plsql.html
The third option could be to call the report from a shell script program and after report is completed email the output using mailx functionality.
Maybe you are looking for
-
I have a 2009 MacBook in which the hard drive is currenty in a USB disc enclosure since the MacBook is no longer operational. I want to sell it, but want to reset it to factory settings. How can I do that while it's in the enclosure and connected to
-
BEx 7.X + MS Excel 2007 - Max number of Rows
Hi, I've been looking for some way to show more than 65k rows in Excel 2007 using BEx Analyzer 7.X. I have a customer that has this issue. I know that use more than 65k rows is not a property of a BI report and reports with more than 65k rows would h
-
Wanted Honolulu HI FCP 5 Studio User with discs
Hi Honolulu FCP Studio User, I moved from New York City back to my hometown of Honolulu HI. In the process of moving, I lost my discs for FCP Studio 5, the bundle that includes Compressor, Motion, DVD Studio Pro 4 and of course FCP 5. I had to get my
-
Installing Leopard on an iBook with a CD-ROM only
How can I install Leopard on my iBook that only has a CD-ROM? Can I request Leopard on CDs, or can I use an external USB DVD-ROM drive?
-
I have been trying for 2 hours to install Flash Player 10. I keep getting a registration failed error. I use IE7 and/or Firefox, have tried both, same error. I have run my anti-virus program, spyware program, etc. What is going on? I installed Ado