Truncating numbers

I have a program I have written to work on math operators. It is a simple input for hours worked and payrate and it spits out multiple answers of math functions.
Everything works fine with the math, but I have extremely long numbers after the decimal points. (i defined them as doubles ... should they be floats?)
Is there a way in Java to truncate a number after the 2nd decimal and round up? I looked into curency conversion, but i wasn't sure if that was correct
import java.io.*;
import java.text.*;
public class Paycheck {
    public static void main (String args[]) {
        String input1;
        String input2;
        String input3;
        float PayRate, Hours;
        double Gross, gross1, Net, Taxed, Insured, Deposited, Ficad, OT, OT1, Tax, Fica, DD, Ins;
        boolean badInput1;
        boolean badInput2;
        boolean GoOn;
        // simple math variable to be deducted at runtime
        final double TAX1 = 1.06;
        final double INS1 = 1.03;
        final double FICA1 = 1.04;
        final double DEP1 = 1.07;      
        OT = 0;
        do {
            do {
                System.out.println("Enter your hours worked: ");
                try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                    input1 = in.readLine();
                } catch(IOException ex) { return; }       
                try {
                    Hours = Float.parseFloat(input1);
                    badInput1 = false;
                } catch(NumberFormatException ex) {                
                 System.out.println(ex.getMessage() + " is an invalid number." );
                    badInput1 = true;
                } while (badInput1);
             do {
                System.out.println("Enter your Pay Rate: ");
               try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                    input2 = in.readLine();
                } catch(IOException ex) { return; }
                try {
                    PayRate = Float.parseFloat(input2);
                    badInput2 = false;
                } catch(NumberFormatException ex) {
                    System.out.println(ex.getMessage() + " is an invalid number." );
                    badInput2 = true;
            } while (badInput2);
                //Assign the variables the values
                Hours = Float.parseFloat(input1);
                PayRate = Float.parseFloat(input2);
                // Check for overtime and calculate as needed
                if (Hours > 40){
                   OT1 = (Hours - 40);
                   OT = OT1 * (PayRate * 1.5);
                   Gross = Gross + OT - (OT1 * PayRate);
               else {
                   Gross = (Hours * PayRate);           
                 //deductions to be made from the paycheck                  
                Tax = Gross - (Gross / TAX1);
                Insured = Gross - (Gross / INS1);
                Deposited = Gross - (Gross / DEP1);
                Fica = Gross - (Gross / FICA1);
                Net = Gross - (Tax + Insured + Fica + Deposited);
                 /*Returns the values and prints statements
                $ is hard coded into the string.
                No currency value has been assigned.
                System.out.println(" ");
                System.out.println( Hours + " Hours at $" + PayRate + " is $" + Gross);
                System.out.println(" ");
                System.out.println("Taxes paid was $" + Tax);
                System.out.println("Insurance paid was $" + Insured);
                System.out.println("Fica got $" + Fica);
                System.out.println("$" + Deposited + " was direct deposited");
                System.out.println(" ");
                System.out.println("Your total Net pay was $" + Net);
                 //check for continue using program or not
                System.out.println("Do more math?  (Y/N)");
                try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                    input3 = in.readLine();
                    // keepGoing will be false for any input except Y or y
                    GoOn = input3 !=  null && input3.equalsIgnoreCase("Y");
            } catch(IOException ex) { return; }
        } while (GoOn);
}

Now, I have actually implemented both the currency format I found, as well as the decimal format that was mentioned and utilized an additional if statement to check the overtime values again and output if there was overtime earned, and to show how much was earned. Thanks again for the decimal value idea as it has now been used to "truncate" the value of the overtime hours worked.
THANK YOU !! :-)
import java.io.*;
import java.text.*;
public class Paycheck {
    public static void main (String args[]) {
        String input1;
        String input2;
        String input3;
        float PayRate, Hours;
        double Gross, gross1, Net, Taxed, Insured, Deposited, Ficad, OT, OT1, OTRate, Tax, Fica, DD, Ins;
        boolean badInput1;
        boolean badInput2;
        boolean GoOn;       
        final double TAX1 = 1.06;
        final double INS1 = 1.03;
        final double FICA1 = 1.04;
        final double DEP1 = 1.07;      
        OT = 0;
        OT1 = 0;
        OTRate = 0;
        NumberFormat fmt1 = NumberFormat.getCurrencyInstance();
        DecimalFormat df= new DecimalFormat("0.00"); // two decimal digits
        do {
            do {
                System.out.println("Enter your hours worked: ");
                try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                    input1 = in.readLine();
                } catch(IOException ex) { return; }       
                try {
                    Hours = Float.parseFloat(input1);
                    badInput1 = false;
                } catch(NumberFormatException ex) {                
                 System.out.println(ex.getMessage()+ " is an invalid number." );
                    badInput1 = true;
                } while (badInput1);
             do {
                System.out.println("Enter your Pay Rate: ");
               try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                    input2 = in.readLine();
                } catch(IOException ex) { return; }
                try {
                    PayRate = Float.parseFloat(input2);
                    badInput2 = false;
                } catch(NumberFormatException ex) {
                    System.out.println(ex.getMessage() + " is an invalid number." );
                    badInput2 = true;
            } while (badInput2);
                Hours = Float.parseFloat(input1);
                PayRate = Float.parseFloat(input2);
                Gross = (Hours * PayRate);
                if (Hours > 40){
                   OT1 = (Hours - 40);
                   OT = OT1 * (PayRate * 1.5);
                   Gross = Gross + OT - (OT1 * PayRate);
                   OTRate = (PayRate * 1.5);
               else {
                   Gross = (Hours * PayRate);           
                Tax = Gross - (Gross / TAX1);
                Insured = Gross - (Gross / INS1);
                Deposited = Gross - (Gross / DEP1);
                Fica = Gross - (Gross / FICA1);
                Net = Gross - (Tax + Insured + Fica + Deposited);
                System.out.println(" ");
                System.out.println( Hours + " Hours at " + fmt1.format(PayRate) + " per hour is " + fmt1.format(Gross));
                System.out.println("Your total Net pay was 80% of your gross, or " + fmt1.format(Net));
                if (Hours > 40){
                   System.out.println("From working " + df.format(OT1) + " hours of overtime, You earned " + fmt1.format(OTRate) + " per hour, or " + fmt1.format(OT));
                System.out.println(" ");
                System.out.println("Taxes paid at 6% was " + fmt1.format(Tax));
                System.out.println("3% went to Insurance, or " + fmt1.format(Insured));
                System.out.println("Fica got 4%, or " + fmt1.format(Fica));
                System.out.println(fmt1.format(Deposited) + " (7%) was direct deposited");
                System.out.println(" ");     
                System.out.println("Do more math?  (Y/N)");
                try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                    input3 = in.readLine();
                    // keepGoing will be false for any input except Y or y
                    GoOn = input3 !=  null && input3.equalsIgnoreCase("Y");
            } catch(IOException ex) { return; }
        } while (GoOn);
}

Similar Messages

  • Truncate numbers from string field

    Afternoon all,
    This time I'd like to extract only 2 strings out of a string field. The field is of sales area which contains numbers and letters. For example, Scotland is given a number 01, West midlands is 02, Ireland however is given IR.
    however, the field which holds the information is like, 012, where 01 is the area number and 2 is type of area number.
    The information which we are interested in is first two strings.
    I have tried this in the formula given below but it doesn't work, it states a field is required
    If hasvalue({?Sales Area}) then
    totext(Minimum({slslsp.slr_slsperson}[1 to 2])) + " - " +
    totext(Maximum({slslsp.slr_slsperson}[1 to 2]))
    else
    "n/a"
    Should I be using a truncate and if yes then how?
    P.S. This is to show only the sales area number or text if selected under a parameter. The values of the parameter will stay the same. In other words it is just to show in the report.
    Many thanks once again
    Regards
    Jehanzeb

    Is it a range parameter? If so try this
    If hasvalue({?Sales Area}) then
    totext(Minimum({slslsp.slr_slsperson})[1 to 2]) + " - " +
    totext(Maximum({slslsp.slr_slsperson})[1 to 2])
    else
    "n/a"
    regards,
    Raghavendra.G
    Edited by: Raghavendra Gadhamsetty on Jan 16, 2009 4:16 PM

  • I don't have original docs-- how can I find the serial number in the software itself?

    Hello all,
    I recently purchased a macbook pro from eBay which had Flash CS4 already installed on it, but which didn't come with the original documentation or CDs that would have had the serial number.  The seller said he would send along the appropriate numbers when he tracked them down, but he never got back to me again.  I'd like to upgrade to Flash CS5 now, so is there any way I can find the serial number through the software itself?  I've seen similar threads to this one elsewhere in the forums and the most promising answers have involved people locating truncated numbers in the software and asking Adobe to decrypt them.  Unfortunately, I can't even find these truncated numbers...  anyone have advice?
    Thanks

    Chances are you do not own the rights to use or have that software installed on that machine.  If the seller was only going to supply you with numbers and not transfer his/her license thru Adobe channels (http://kb2.adobe.com/cps/152/tn_15281.html), the seller would probably be in violation of the End User License Agreement (illegally providing a copy to another individual). If the seller still retains the license, the copy on your machine would have to have been erased before the sale... and still needs to be.
    This is likely to apply to other software that was installed on the machine by the seller.

  • Problems with the system decimal point with german regional settings

    I have a Labview 6 app that needs deploying to Germany.
    My app sends strings over VISA RS232 and GPIB instruments with floating point numbers.
    When changing from English to German regional settings, in Windows XP, periods are now interpreted as commas and the app starts truncating my decimal numbers. So in the English Regional Setting when I send 1.234 I get 1.234 but in the German Regional Settings when I send 1.234 I get 1.000.
    I have turned off the "Use localized decimal point" in Tools - Options - Front Panel as well as set any function (Frac/Exp String to Number) that has a "Use System Decimal Point" connector to FALSE.
    Now here's my problem....
    This fixed the issue I was having as long as I am in the development environment, however, once I build the application I still get the truncated numbers. Example: I send 1.234 to an instrument and it sees 1.000.
    Again this works fine in the development enviroment, sending 1.234 reads 1.234 with German regional settings.
    Any help is appreciated.
    Adam

    You can use a simple function of the "Scan from string" function.
    Place "%.;" (Without the quotes) in the scanning string, and this will tell LV to use a decimal point for interpretation. If you place "%,;", this will tell it to use a comma.
    You can place this at the beginning of your format string, and it simply tells the parser how to work, it doesn't otherwise produce an output.
    Using simply "%;" sets the seperator to the system default (maybe the best idea after the code has been run as the changed decimal point character apparently remains changed otherwise). From the LV help
    The following codes control the decimal separator used for numeric output. These codes do not cause any input or output to occur. They change the decimal separator for all further inputs/outputs until the next %; is found.
    %,; comma decimal separator
    %.; period decimal separator
    %; system default separator
    Hope this helps
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • BO XI R2 - decimal numbers are truncated

    Hi all,
    When we create query in webitelligence the measure "item price" the decimal numbers are truncated/not shown. The right number is 23.123,55 but we get 23.123,00 ?
    Configuration:
    WIN 2003 server,
    BOE XI r2 => IIS,
    SAP int. kit XI r2
    Thank you for reply!
    Gregor

    Hi Roman,
    you can download the supported platforms list here [http://service.sap.com/bosap-support]. Just navigate to Documentation->Supported Platforms.
    The work-around with the special system user may be used if you have truncation problems on your BOBJ server after installing the integration Kit for SAP. Please keep in mind that this is a work-around when using the integration Kit for SAP and not a recommendation for every installation. As far as I know this problem will be fixed in one of the future fix packs (at least for XI 3.x).
    Regards,
    Stratos

  • ETEXT output truncating/rounding large numbers

    I have an eTEXT template that includes the definition:
    <FORMAT>     <DATA>
    NUMBER BankAccount/BankAccountNumber
    When a large number is encountered the output appears truncated/rounded. For example; the account number 444470301880513641 is output as 444470301880513660.
    Data:
    <BankAccountNumber>444470301880513641</BankAccountNumber>
    Output:
    ...#444470301880513660#....
    Other than convert the FORMAT to an Alpha are there any known tips or tricks to correct this scenario?
    Regards
    Edited by: bdansie on 10-Jan-2012 17:44

    Hi Tom, Thanks for the reply. I am reading a hex value in from a serial port. the number is large and when i format it as hex on one chan it is off by a small amount. there is some rounding in the LSD. i then take another reading later and calculate the delta. since i dont have the right values to begin with my difference calculation is wrong. when i read as bytes through 8 channels, i can see the ascii for each digit and that they are correctly displayed. using a formula module i can convert from ascii to decimal so that i get the decimal equivalent of the hex character then in the next formula i do the math to find the value of each hex digit in place it holds. then using a sum arithmetic module i get the final value of the large number coming in. it is correct all the way upto the aritmetic sum. i tried cutting the large hex number into two parts and then adding up the weighted parts and still have the wrong ans in the display module. i also tried dividing the halves by 1000 prior to adding them so that i was working with smaller numbers in the summation but that didnt help.
    so i did the math directly in the extended portion of the variables. the numbers add up properly there but when i try to bring the correct sum back into the work sheet to display it, it is wrong again. it seems that a value around 04000000 hex is the limit. below that i get the right value displayed that was calculated in the variable field, above it there is some degree of variation. I can set the limit of cycles to a value below where the addition becomes problematic or i can export the hex to a spreadsheet, do the math there and then bring it back in but i will still have the same issue displaying the answer.
    the limitation doesnt seem to be in DASYLab in general but in the Read, Formula, Constant Generator modules that read the variable back into the worksheet. it is displayed properly in the contents window

  • Truncating the leading zeros which has both numbers and characters

    Hello Everyone,
    Can anybody pls help me to truncate the leading zeros in the incoming file structure which has both the numbers and characters.
    Thanks,
    Chinna

    HI,
    Write a UDF like this ..
    public class test {
    public static void main(String[] args) {
    System.out.println(args[0].replaceAll("^0*",""));
    Also you can use XSLT for this.
    Try the XPath function number($string) in your XSLT and see if it does what you want. Since it turns any XPath object into a number, the leading zeros won't appear.
    Use it ike this
    <xsl:variable name="a">
    <xsl:call-template name="removeLeadingZeros">
    <xsl:with-param name="phone">
    <xsl:value-of select="EVENT/ContactPhone"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:variable>
    <xsl:template name="removeLeadingZeros">
    <xsl:param name="phone"/>
    <xsl:message>
    <xsl:value-of select="$phone"/>
    </xsl:message>
    <xsl:choose>
    <xsl:when test="starts-with($phone,'0')">
    <xsl:call-template name="removeLeadingZeros">
    <xsl:with-param name="phone">
    <xsl:value-of
    select="substring-after($phone,'0' )"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$phone"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Regards
    Aashish Sinha
    PS : Reward Point if Helpful

  • Polar plot scale numbers "truncated"

    I have a strange problem when using the polar plot VI.
    Labview 2012 latest SP, running on a cRIO9074. I'm running a servo motor for one revolution while measuring the runout on an armature using a linear position sensor.
    The data looks good, but for some reason, the scale labels truncate after two decimals, no matter what I set the precision to. I'm sending it a cluster of two double precision arrays.
    When I run the Labview example, it works fine I can change the number of decimals viewed to 10 if I need to. I've tried keeping everything the same as the example.
    Any ideas?
    See picture.
    The sample VI works fine, (I can set the precision to 6 and I will see 6 decimal positions. )

    Thanks for the response, Kurt. With the help of a colleague, we were able to determine that this behavior is only when the VI is running on the cRIO.
    (I think it was called "Polar Plot Demo.vi", but yes the VI is "Polar Plot with Points Option.vi"
    We verified this by running the example vi first from windows (works fine), then ran it on the cRIO. On the cRIO it truncates decimals depending upon what font size you use. If you use a REAL TINY font, it will include more decimals. When running in Windows, the graph appears to move left to accomodate for more decimal place. When running on the cRIO, it appears to cut the picture off on the right side.
    Following is our setup, but as stated above, we sent the demo program to the cRIO (didn't use any I/O) and the problem occured.
    We're using Labview 2012, latest updates applied.
    Modules are:
    NI-9411 to read an Ono Sokki position sensor (quadature output from two channels, resolution is .0001 mm.
    Ethercat set up using the "getting started" manual for the NI supplied AKD servo drive and motor.
    All hardware works fine and data collected looks good. Test is to turn motor and collect servo position and linear encoder position.
    Data has 4 decimal places coming in.

  • Large Numbers being truncated in IR

    I have a query in IR that is pulling Id numbers that are 22 characters long. In the results section the last 5 digits are replaced with zeros. If I use the to_char function it will return the whole number but then I am unable to filter on the field. Any help is greatly appreciated.
    Thanks.

    The longest number I can verify (from the docs) that will work in IR is 10 digits long. Maybe 10 digits before the decimal point and 5 after.
    What are you counting that you have 3 x 10^20 of them. I have a database with 70 million records in one table. I know that's about mid-sized, but 70 million cubed?
    It looks like you are using some sort of an intelligent key that just happens to contain only numerical characters. It's unfortunate that this is stored as a number rather than some string data type. Unless you really need to perform math on these numbers, I'd recommend treating them as strings.

  • Issue regarding 0 truncation for numbers in .csv file

    Hi
    I m loading data from .csv file say: Item Master Data.
    Our requirement is if customer sends item number as 0022 or 22 or 0001 or 1, we have to save & show same way.
    Let us suppose customer send us data with item number u2018001u2019 but as he makes .csv file, I get as u20181u2019 and not u2018001u2019, So I could load as u20181u2019.
    But if we rename customeru2019s csv file as .txt. And then open it in Excel with Item Number column as Text, we get '001'.
    But every day we can't do it manually for every file, Pls let me know if you find any solution on this.....
    Thanks...

    Did you try what i said? try this in dev.create a dummy item infoobject of type char and build a flatfile datasource only with this infoobject. Use your CSV file. In the file delete all columns except item and try to preview and see whether leading zeros are visible? If you are able see 00 in .txt format then this should work. Try and let me know.
    Edited by: Raghavendra Padmanaban on Feb 16, 2011 4:08 PM
    Edited by: Raghavendra Padmanaban on Feb 16, 2011 4:09 PM

  • Pages 5.1 truncates text in tables

    Just discovered that Pages 5.1 truncates text in tables when exported to Pdf's even when created in Numbers and pasted. Superscripts were missing. Sometimes regular text after superscrips were missing. Too bad.

    It's a bug. Until fixed, you'll have to avoid baseline shift or use an earlier version of Pages. Submit Feedback from the Pages menu to let Apple know you are finding this bug.
    Jerry

  • Sporadically getting error "string or binary data would be truncated" in SQL server 2008 while inserting in a Table Type object

    I am facing a strange SQL exception:-
    The code flow is like this:
    .Net 4.0 --> Entity Framework --> SQL 2008 ( StoredProc --> Function {Exception})
    In the SQL Table-Valued Function, I am selecting a column (nvarchar(50)) from an existing table and (after some filtration using inner joins and where clauses) inserting the values in a Table Type Object having a column (nvarchar(50))
    This flow was working fine in SQL 2008 but now all of sudden the Insert into @TableType is throwing  "string or binary data would be truncated"  exception. 
    Insert Into @ObjTableType
    Select * From dbo.Table
    The max length of data in the source column is 24 but even then the insert statement into nvarchar temp column is failing.
    Moreover, the same issue started coming up few weeks back and I was unable to find the root cause, but back then it started working properly after few hours
    (issue reported at 10 AM EST and was automatically resolved post 8 PM EST). No refresh activity was performed on the database.
    This time however the issue is still coming up (even after 2 days) but is not coming up in every scenario. The data set, for which the error is thrown, is valid and every value in the function is fetched from existing tables. 
    Due to its sporadic nature, I am unable to recreate it now :( , but still unable to determine why it started coming up or how can i prevent such things to happen again.
    It is difficult to even explain the weirdness of this bug but any help or guidance in finding the root cause will be very helpful.
    I also Tried by using nvarchar(max) in the table type object but it didn't work.
    Here is a code similar to the function which I am using:
    BEGIN
    TRAN
    DECLARE @PID
    int = 483
    DECLARE @retExcludables
    TABLE
        PID
    int NOT
    NULL,
        ENumber
    nvarchar(50)
    NOT NULL,
        CNumber
    nvarchar(50)
    NOT NULL,
        AId
    uniqueidentifier NOT
    NULL
    declare @PSCount int;
    select @PSCount =
    count('x')
    from tblProjSur ps
    where ps.PID
    = @PID;
    if (@PSCount = 0)
    begin
    return;
    end;
    declare @ExcludableTempValue table (
            PID
    int,
            ENumber
    nvarchar(max),
            CNumber
    nvarchar(max),
            AId
    uniqueidentifier,
            SIds
    int,
            SCSymb
    nvarchar(10),
            SurCSymb
    nvarchar(10)
    with SurCSymbs as (
    select ps.PID,
                   ps.SIds,              
                   csl.CSymb
    from tblProjSur ps
                right
    outer join tblProjSurCSymb pscs
    on pscs.tblProjSurId
    = ps.tblProjSurId
    inner join CSymbLookup csl
    on csl.CSymbId
    = pscs.CSymbId 
    where ps.PID
    = @PID
        AssignedValues
    as (
    select psr.PID,
                   psr.ENumber,
                   psr.CNumber,
                   psmd.MetaDataValue
    as ClaimSymbol,
                   psau.UserId
    as AId,
                   psus.SIds
    from PSRow psr
    inner join PSMetadata psmd
    on psmd.PSRowId
    = psr.SampleRowId
    inner join MetaDataLookup mdl
    on mdl.MetaDataId
    = psmd.MetaDataId
    inner join PSAUser psau
    on psau.PSRowId
    = psr.SampleRowId
                inner
    join PSUserSur psus
    on psus.SampleAssignedUserId
    = psau.ProjectSampleUserId
    where psr.PID
    = @PID
    and mdl.MetaDataCommonName
    = 'CorrectValue'
    and psus.SIds
    in (select
    distinct SIds from SurCSymbs)         
        FullDetails
    as (
    select asurv.PID,
    Convert(NVarchar(50),asurv.ENumber)
    as ENumber,
    Convert(NVarchar(50),asurv.CNumber)
    as CNumber,
                   asurv.AId,
                   asurv.SIds,
                   asurv.CSymb
    as SCSymb,
                   scs.CSymb
    as SurCSymb
    from AssignedValues asurv
    left outer
    join SurCSymbs scs
    on    scs.PID
    = asurv.PID
    and scs.SIds
    = asurv.SIds
    and scs.CSymb
    = asurv.CSymb
    --Error is thrown at this statement
    insert into @ExcludableTempValue
    select *
    from FullDetails;
    with SurHavingSym as (   
    select distinct est.PID,
                            est.ENumber,
                            est.CNumber,
                            est.AId
    from @ExcludableTempValue est
    where est.SurCSymb
    is not
    null
    delete @ExcludableTempValue
    from @ExcludableTempValue est
    inner join SurHavingSym shs
    on    shs.PID
    = est.PID
    and shs.ENumber
    = est.ENumber
    and shs.CNumber
    = est.CNumber
    and shs.AId
    = est.AId;
    insert @retExcludables(PID, ENumber, CNumber, AId)
    select distinct est.PID,
    Convert(nvarchar(50),est.ENumber)
    ENumber,
    Convert(nvarchar(50),est.CNumber)
    CNumber,
                            est.AId      
    from @ExcludableTempValue est 
    RETURN
    ROLLBACK
    TRAN
    I have tried by converting the columns and also validated the input data set for any white spaces or special characters.
    For the same input data, it was working fine till yesterday but suddenly it started throwing the exception.

    Remember, the CTE isn't executing the SQL exactly in the order you read it as a human (don't get too picky about that statement, it's at least partly true enough to say it's partly true), nor are the line numbers or error messages easy to read: a mismatch
    in any of the joins along the way leading up to your insert could be the cause too.  I would suggest posting the table definition/DDL for:
    - PSMetadata, in particular PSRowID, but just post it all
    - tblProjectSur, in particularcolumns CSymbID and TblProjSurSurID
    - cSymbLookup, in particular column CSymbID
    - PSRow, in particular columns SampleRowID, PID,
    - PSAuser and PSUserSur, in particualr all the USERID and RowID columns
    - SurCSymbs, in particular colum SIDs
    Also, a diagnostic query along these lines, repeat for each of your tables, each of the columns used in joins leading up to your insert:
    Select count(asurv.sid) as count all
    , count(case when asurv.sid between 0 and 9999999999 then 1 else null end) as ctIsaNumber
    from SurvCsymb
    The sporadic nature would imply that the optimizer usually chooses one path to the data, but sometimes others, and the fact that it occurs during the insert could be irrelevant, any of the preceding joins could be the cause, not the data targeted to be inserted.

  • Calendar week numbers in Yosemite do not show entirely in Year View

    Sorry to say this but I'm actually a bit shocked at Apple's quality control to be posting this bug. Bugs are one thing but this is, in my view, absolutely unacceptable.
    Calendar Week Numbers are truncated in the Year View. Only the first digit is shown, which means it shows week number 1 - 9 correctly, but 10, 11, 12... etc. all show just 1. Week 21, 22, 23... etc. show only 2.
    Tried it in a fresh Guest Account, so not an issue with my .plist files or similar.

    Doesn't for me unfortunately with the Calendar List hidden, as to be seen below. I think it could have something to do with resolution and screen space of the display, since resizing the window tends to fix it for specific widths and heights. I'm using a Thunderbolt Display with my rMBP.

  • Truncate all Instances in SOA SUITE 11g BPEL SOAINFRA SCHEMA

    Hi Guys!
    We are running Oracle SOA SUITE 11g + BPEL, Version 11.1.1.3.0 (PS2)
    We running out of disk space issues in a database due to large number of test instances in dehydration storage.
    Is there any way to TRUNCATE all tables in order to clean up instances from BPEL engine (SOAINFRA schema)
    Oracle provides this functionality (purge scripts and implemented procedures in a database) but this is a deleting approach and it doesn't work with millions of instances in a storage. Deleting instances from GUI doesn't work at all.
    1. We are looking the way to truncate all instances in a database rather then delete them which takes ages and doesn't work properly in case of huge amount of instances.
    2. We would like wipe out all instances without any time restrictions.
    Any feedback, script from you guys would be much appreciated.
    Cheers!!

    Hi,
    There still no solution for truncating tables. Looks like we have to look into Oracle's procedures in delivered with SOA SUITE installation.
    I posted an article about deleting large number of instances in SOA Suite 11g. It does the job in a pretty fast way.
    [Delete large numbers of instances in Oracle SOA Suite 11g|http://emarcel.com/soa-suit/152-deleteinstancessoasuite11gwls]
    Cheers!!
    emarcel.com

  • Tcsh shell "alias" command seems to be truncating file names

    Terminal Utility: As a Unix geek, on trying to port a large # of tcsh shell scripts to MacOSX (10.5.6), I have found a strange compatibility issue with the tcsh script "alias" command. After entering tcsh sub-shell from bash (by typing tcsh at the bash prompt, or by setting tcsh as the default shell), and defining the alias "surf_run" by sourcing a script containing the the line:
    alias surf_run 'source /Users/username/SgiNew/molsurf/csh/radix.csh'
    subsequent use of the "surf_run" alias (typing surf_run at the tcsh command prompt) seems to cause the system to truncate the name of the file to about 20 characters. The radix.csh file is actually present at the defined path, but the system seems to be truncating the file name to the last 16 letters or so in this case, and thus returns the following error message:
    : No such file or directory.rf/csh/radix.csh
    as if it is looking for a file rf/csh/radix.csh (which is not there, because the filename has been truncated)
    The number of characters retained actually varies from case to case. Another similarly obtained error message had 30 characters retained in the file name:
    : No such file or directory.rtoz/rtoz/rxtst/unix/login.csh
    Q: Is there any system parameter or environment variable that I can modify that will allow the tcsh shell alias command to recognize properly file paths with large numbers of characters?

    I cannot reproduce this error. A long alias string works fine for me. But the error messages -- as you reproduce them here -- do not look like the string is truncated. It looks like the "No such file or directory" message is being written on top of the string. Like maybe a new line is being swallowed somewhere.
    I suggest taking further inquiries to the Unix forum, under "Mac OS X Technologies".
    [http://discussions.apple.com/forum.jspa?forumID=735]

Maybe you are looking for