Replaace values in the columns reverse direction

Oracle 11.2.0.1
Windows
create table test
code varchar2(2),
col1 varchar2(2),
col2 varchar2(2),
col3 varchar2(2),
col4 varchar2(2),
col5 varchar2(2),
col6 varchar2(2)
insert into test values ('01','K','P','O','R',null,null);
insert into test values ('02','I','S','L',null,null,null);
insert into test values ('03','P',null,null,null,null,null);
insert into test values ('04','K','N',null,null,null,null);
insert into test values ('05','K','N','Z','G','H','T');
SQL> select * from test;
CO CO CO CO CO CO CO
01 K  P  O  R
02 I  S  L
03 P
04 K  N
05 K  N  Z  G  H  T
Required Output :  (Reverse Values in the columns)
CO CO CO CO CO CO CO
01 R  O  P  K
02 L  S  I
03 P
04 N  K
05 T  H  G  Z  N  K
Thanks.

with
test as
(select '01' code,'K' col1,'P' col2,'O' col3,'R' col4,null col5,null col6 from dual union all
select '02','I','S','L',null,null,null from dual union all
select '03','P',null,null,null,null,null from dual union all
select '04','K','N',null,null,null,null from dual union all
select '05','K','N','Z','G','H','T' from dual
select code,
       substr(cols,instr(cols,'|',-1,2) + 1,instr(cols,'|',-1,1) - instr(cols,'|',-1,2) - 1) col1,
       substr(cols,instr(cols,'|',-1,3) + 1,instr(cols,'|',-1,2) - instr(cols,'|',-1,3) - 1) col2,
       substr(cols,instr(cols,'|',-1,4) + 1,instr(cols,'|',-1,3) - instr(cols,'|',-1,4) - 1) col3,
       substr(cols,instr(cols,'|',-1,5) + 1,instr(cols,'|',-1,4) - instr(cols,'|',-1,5) - 1) col4,
       substr(cols,instr(cols,'|',-1,6) + 1,instr(cols,'|',-1,5) - instr(cols,'|',-1,6) - 1) col5,
       substr(cols,instr(cols,'|',-1,7) + 1,instr(cols,'|',-1,6) - instr(cols,'|',-1,7) - 1) col6
  from (select code,rtrim('|'||col1||'|'||col2||'|'||col3||'|'||col4||'|'||col5||'|'||col6,'|')||'|' cols
          from test
CODE
COL1
COL2
COL3
COL4
COL5
COL6
01
R
O
P
K
02
L
S
I
03
P
04
N
K
05
T
H
G
Z
N
K
Regards
Etbin

Similar Messages

  • Format the total value in the column of the graph table

    Hello all,
    I have a graph table and I need to format the total value in the column of the table.
    I am trying to find my table bean with the code below but it's not working in the processRequest. Is there anything else that should be done?
    // Get the graph
    OAGraphTableBean graphBean = (OAGraphTableBean)webBean.findChildRecursive("MyGraph");
    // Get the table
    OATableBean tblBean = (OATableBean)graphBean.findChildRecursive("MyTable");
    The tblBean is null in the processRequest. In the processFormRequest the tblBean is not null.
    Thanks and Regards,
    Andrea

    Hi,
    The code OAGraphTableBean graphBean = (OAGraphTableBean)webBean.findChildRecursive("MyTable"); does not work because in this case I am getting the table but casting to a graph.
    The MyTable bean is a child of MyGraph.
    When creating a graph bean we have the option to create a table as a child (select your graphTable region in the Structure pane, and choose New > tabularFormat - to create the table).
    The table bean child I can get just in the processFormRequest, but the graph I can get in both processRequest and processFormRequest.
    I need to get the table bean in the processRequest to format the total value column.
    Do you know if is there anything else that should be done to format the total column?
    Thanks and Regards,
    Andrea

  • Adding more Values to the Column Link in Apex

    Hi,
    Is there any possibility of adding extra or more values to the column link in Apex. I already have 3 Column Name and Values linked to a different report.
    Eg:-
    Column Link:
    Link Text : #COUNT#
    Name       Value
    DATE #DATE#
    PRICE #PRICE#
    COST #COST#
    I want to add one more Name like 'ID' and corresponding and Value #ID#.
    Please Help...
    Thanks in Advance..
    Edited by: user13561710 on Jan 10, 2011 9:20 AM
    Edited by: user13561710 on Jan 10, 2011 12:34 PM

    Thanks Varad,
    But it didn't worked, The page has option to link only 3 values.
    My Target is 'Page in this Application" not a URL.
    I used your format and if you apply changes and come back the whole thing is dissappeared and even the link to page in application is inactive.
    Is there any other way???
    Thanks
    Edited by: user13561710 on Jan 10, 2011 10:49 AM
    Edited by: user13561710 on Jan 10, 2011 12:35 PM

  • How can can i subtract the value of the column in each row ?

    I want to subtract  the value  of the column in each row if the row is not enough then continue to next row.
    For example 
    ID             QTY
    A               20
    B               40       
    C               60
    I want to update this table by subtract  the value  of the column (QTY) out 70 so the result i want will be 
    ID              QTY
    A                20 - 70 = -50 -->  0 this row will be updated to 0 and 50 will continue to next row   
    B                40 - 50  = -10 -->  0   this row will be updated to 0 and 10 will continue to next row
    C                60 - 10  = 50  -->  Stop loop
    How can i write the sql query for this operation , Thanks

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. You have no idea,
    do you? Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. What did you try on your own before posting? I will bet that you did nothing! You expect other people to do your job or homework for you. 
    >> I want to subtract the value of the column in each row if the row is not enough then continue to next row. <<
    This makes no sense. Rows have no ordering; that is a spreadsheet. There is no such thing as a generic “id” in RDBMS. And an identifier is not a sequence which would have an ordering. 
    CREATE TABLE Foobar
    (something_seq INTEGER NOT NULL PRIMARY KEY,
     onhand_qty INTEGER NOT NULL);
    Learn how to use the SUM()OVER() and LAG() aggregate functions, post what you tried for yourself and then we will help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to get warning by using the previous value of the column and new value

    Hi all,
    Suppose the column A has the true and when I click on button which also sets the value of the column as true I should dispaly warning that column a is already true.How can I achieve this.How to store the original value of the column and then check wirth the new value.
    Thanks in advance.

    You dont have to store the value anywhere
    You can do this from setMethod of EOImpl.java
    eg:
    void setAttributeXXX(String Value)
    // value contains new value
    // getAttributeXXX() contains oldValue
    if (value.equals(getAttributeXXX()))
    // Verify value is > 0 if (value.compareTo(0) <= 0)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT, // indicates EO source
    getEntityDef().getFullName(), // entity name
    getPrimaryKey(), // entity primary key
    "AttributeXXX", // attribute Name
    value, // bad attribute value
    "AK", // nessage application short name
    "FWK_TBX_T_EMP_SALARY_REQUIRED"); // message name
    setAttributeInternal(AttributeXXX, value);
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to show the VALUE as the Column Header using SQL query?

    Hi
    I have a requirement to show the picked value as the column header using SQL query.
    Example:
    ======
    SELECT EMPNO FROM EMP
    WHERE EMPNO=7934;
    Result Should be:
    7934
    7934

    I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
    SQL> set verify on
    SQL> def e =  7934
    old: SELECT empno "&&e"  FROM emp  WHERE empno = &&e
    new: SELECT empno "7934"  FROM emp  WHERE empno = 7934
    SQL> SELECT empno "7934"  FROM emp  WHERE empno = 7934
          7934
          7934
    1 row selected.

  • HELP: WHERE Clause based on value of the column

    I am selecting from a table as follows and want to have a where condition that is dependent of the value of the column, type of the current row.
    CREATE TABLE tbl (INT id, VARCHAR type, VARCHAR comment)
    I have 3 different values for the type column, EMPLOYEE, CUSTOMER, SUPPLIER. What I want is to have a where clause in my select that is based on the value of type.
    I tried the following but was not successful..
    SELECT * from tbl
    CASE
    WHEN type = 'EMPLOYEE' THEN
    WHERE comment LIKE '%employee%'
    WHEN type = 'CUSTOMER' THEN
    WHERE comment LIKE '%customer%'
    WHEN type = 'SUPPLIER' THEN
    WHERE comment LIKE '%supplier%'
    END
    I am not proficient with stored procedures so if you could please tell me how to do it with straight query, I would greatly appreciated it..
    Thank you,

    Or maybe this:
    SELECT *
      FROM tbl
    WHERE "COMMENT" LIKE
              CASE TYPE
                 WHEN 'EMPLOYEE'
                    THEN '%employee%'
                 WHEN 'CUSTOMER'
                    THEN '%customer%'
                 WHEN 'SUPPLIER'
                    THEN '%supplier%'
              END

  • Sorting is not working in infragistics when empty value in the column

    Hi ,
    i am using <ig:gridView> in my application. i have many columns in the grid view(ig means third party infragistics component). But in my case sorting(sortBy attribute in ig:column) is not properly working when the empty values in the column(DATA_ROW.source). This is a severity bug in my application. I have two days to deploy our project. I already hosted my bug report to the infragistics website. Please reply ASAP.
    <ig:column style="border:1px" sortBy="source">
    <f:facet name="header">
    <h:outputText style="color:#245B89;text-decoration:underline" value="Source System " title="Click to sort" />
    </f:facet>
    <h:outputText value="#{DATA_ROW.source}" />
    </ig:column>

    Hi,
    You can refer this post-
    https://social.technet.microsoft.com/Forums/office/en-US/b748bb03-4881-4aa5-9c87-bd4558b9201c/unable-to-sort-task-lists-by-assigned-to-column?forum=sharepointadminprevious
    Thanks,
    Danny
    Please remember to Mark as Answer if it works or vote of it is helpful

  • ColumnChart color depending on the value of the column

    Hi,
    I'va been trying for 2 days to change the colors of columnseries in a columnchart and it is actually awful. I've tried to do it inline without custom itemRenderer but I quickly understood that it is impossible. I then looked on the internet, and found that it was maybe possible by creating a custom itemRenderer class, extending ProgrammticSkin and implementing IdataRenderer.
    I have tried but am not at all able to retrieve the value of the column inside the itemRenderer. Even more, the so called _chartItem is always null and never never carries anything from anyparent.
    I'm a bit exhausted of trying and getting this value, so if you have some idea, i'll be very grateful.
    Here is the code for my itemRenderer class:
    import flash.display.Graphics;
        import flash.geom.Rectangle;
        import mx.charts.ChartItem;
        import mx.charts.chartClasses.GraphicsUtilities;
        import mx.charts.series.items.ColumnSeriesItem;
        import mx.controls.Alert;
        import mx.core.IDataRenderer;
        import mx.graphics.IFill;
        import mx.graphics.IStroke;
        import mx.skins.ProgrammaticSkin;
        public class ColorRenderer extends ProgrammaticSkin implements IDataRenderer
            public function ColorRenderer():void
                super();
            private var _chartItem:ChartItem;
            public function get data():Object
                return _chartItem;
            public function set data(value:Object):void {
                _chartItem = value as ColumnSeriesItem;
                invalidateDisplayList();
            private static const fills:Array = [0xFF0000,0x00FF00,0x0000FF,
                0x00FFFF,0xFF00FF,0xFFFF00,
                0xAAFFAA,0xFFAAAA,0xAAAAFF];
            override protected function
                updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                var g:Graphics = graphics;
                g.clear(); 
                g.beginFill(fills[(_chartItem == null)? 0:_chartItem.element.y]);
                Alert.show(_chartItem.index.toString());
                g.drawRect(0, 0, unscaledWidth, unscaledHeight);
                g.endFill();
        } // Close class.
    } // Close package.
    Thank you

    It worked, thanks
    Date: Wed, 21 Apr 2010 09:03:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: Flex ColumnChart color depending on the value of the column
    Have you looked at doing per-item fills?
    http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf69084-7c3f.ht ml
    This feature lets you define a function that customizes chart item fills based on their values.
    >

  • How to set 0 for "Nan" Value in the Column

    Hi All,
      I have 3 imp columns with name Build %,Deploy%,Validation % and I would like to set the value as "0" or "1" using formula and below is the formula . But I am getting the values as "Nan" due to that it's reflecting the
    Pivot Table & Report  which show in below 2nd image.
    And I had written formula  as "=SWITCH(EDSCIMonthlyReport[Build %] , "Nan", 0)"  to copy all the values of the Build % Field to another calculated Column and set the value "0" if found "Nan" ,But I am getting
    error as"Function 'SWITCH' attempted to compare values of incompatible types. Ensure that both values are Numeric, String, or Boolean(True/False). Consider using the VALUE or FORMAT function to convert one of the values".Can any one help me how can
    I solve this issue
    Thanks,
    Sid

    Hello Sid,
    Again TFS? The data type of the column is "text" and now you want to convert it to a numeric to use it as a measure, right?
    - First you have to change "NaN" to "0" (<= 0 as type "Text"!, see your error msg); you can do it with an IF expression
    - Then you have to remove the % sign; it's a text as well. For this you can use the SUBSTITUE function
    - Then you can convert it to a numeric using the VALUE function
    As one complete expression it will look like this:
    = VALUE(SUBSTITUTE(If(Tabelle3[Build] = "NaN"; "0"; Tabelle3[Build]); "%"; ""))
    As you can see in below screenshot PowerPivot automatically detects the data type as "Decimal"; now you can use it as a measure value.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • To convert the values in the column from upper case to Camel Case.

    Hi All,
    I have requirement to convert the column values(Data in the Columns) from upper case to camel case in pivot table view.
    For Eg:
    I have
    Table Name:Billing_Transaction
    under Billing_Transaction table i Have column Comment_Text
    Data in Comment_Text Column is
    INSERT,
    EXPORT,
    AMEND
    How i will change these values in to Insert,Export,Amend.(Camel Case condition)
    I want only the first letter of a word to be in caps and others to be in smaller case.
    Thanks,
    Chitra Subramani.

    Hi Aravind,
    Thanks for immediate response.your query is helpful.But i need to satisfy another condition in my requirement by using same formula.
    "REPLACE(UPPER(SUBSTRING(BILLING_TRANSACTION.BILLING_TRANSACTION_DESC FROM 1 FOR 1)) || lower(substring(BILLING_TRANSACTION.BILLING_TRANSACTION_DESC FROM 2)), '_', ' ')"
    above query satisfying Camil case and replacing '_' with ' '(space)......but inthis query i want add another condition to satisfy camil case for word which comes after '_'
    for example:
    DECLINE_IMPORT
    above query satisfying 2 conditions to convert above data into
    "Decline import"
    But in my requirement for word 'import' also it should come in camil case condition like
    "Decline Import"
    Thanks & Regards,
    Chitra
    Edited by: user6371773 on Apr 25, 2011 6:29 AM

  • Problem in Inserting the Value in the column through Stored Procedure

    stored procedure is created and i need
    to insert data into the SALES_TRADEIN, from the parent table (Flatfile_sales),through COMMAND PROMPT.
    I have 2 details TradeIn_1 and TradeIn_2.
    I need to insert details of TradeIn_1 in SALES_TRADEIN
    TABLE if the column of TradeIn_1 is null then i need to insert TradeIn_2 details.
    If the TradeIn_1 is not null then i have insert
    TradeIn_1 details and go to next column.
    This is the Scenario but i wrote the Script
    so anyone please view it and give the solution how to change that insert statement.
    -- =============================================
    -- Stored Procedure for Flatfile_Sales
    -- =============================================
    ---==========Sales_Cursor
    --USE [IconicMarketing]
    --GO
    DECLARE
    @FileType varchar(50),
    @ACDealerID varchar(50),
    @ClientDealerID varchar(50),
    @DMSType varchar(50),
    @DealNumber varchar(50),
    @CustomerNumber varchar(50),
    @CustomerName varchar(50),
    @CustomerFirstName varchar(50),
    @CustomerLastName varchar(50),
    @CustomerAddress varchar(50),
    @CustomerCity varchar(50),
    @CustomerState varchar(50),
    @CustomerZip varchar(50),
    @CustomerCounty varchar(50),
    @CustomerHomePhone varchar(50),
    @CustomerWorkPhone varchar(50),
    @CustomerCellPhone varchar(50),
    @CustomerPagerPhone varchar(50),
    @CustomerEmail varchar(50),
    @CustomerBirthDate varchar(50),
    @MailBlock varchar(50),
    @CoBuyerName varchar(50),
    @CoBuyerFirstName varchar(50),
    @CoBuyerLastName varchar(50),
    @CoBuyerAddress varchar(50),
    @CoBuyerCity varchar(50),
    @CoBuyerState varchar(50),
    @CoBuyerZip varchar(50),
    @CoBuyerCounty varchar(50),
    @CoBuyerHomePhone varchar(50),
    @CoBuyerWorkPhone varchar(50),
    @CoBuyerBirthDate varchar(50),
    @Salesman_1_Number varchar(50),
    @Salesman_1_Name varchar(50),
    @Salesman_2_Number varchar(50),
    @Salesman_2_Name varchar(50),
    @ClosingManagerName varchar(50),
    @ClosingManagerNumber varchar(50),
    @F_AND_I_ManagerNumber varchar(50),
    @F_AND_I_ManagerName varchar(50),
    @SalesManagerNumber varchar(50),
    @SalesManagerName varchar(50),
    @EntryDate varchar(50),
    @DealBookDate varchar(50),
    @VehicleYear varchar(50),
    @VehicleMake varchar(50),
    @VehicleModel varchar(50),
    @VehicleStockNumber varchar(50),
    @VehicleVIN varchar(50),
    @VehicleExteriorColor varchar(50),
    @VehicleInteriorColor varchar(50),
    @VehicleMileage varchar(50),
    @VehicleType varchar(50),
    @InServiceDate varchar(50),
    @HoldBackAmount varchar(50),
    @DealType varchar(50),
    @SaleType varchar(50),
    @BankCode varchar(50),
    @BankName varchar(50),
    @SalesmanCommission varchar(50),
    @GrossProfitSale varchar(50),
    @FinanceReserve varchar(50),
    @CreditLifePremium varchar(50),
    @CreditLifeCommision varchar(50),
    @TotalInsuranceReserve varchar(50),
    @BalloonAmount varchar(50),
    @CashPrice varchar(50),
    @AmountFinanced varchar(50),
    @TotalOfPayments varchar(50),
    @MSRP varchar(50),
    @DownPayment varchar(50),
    @SecurityDesposit varchar(50),
    @Rebate varchar(50),
    @Term varchar(50),
    @RetailPayment varchar(50),
    @PaymentType varchar(50),
    @RetailFirstPayDate varchar(50),
    @LeaseFirstPayDate varchar(50),
    @DayToFirstPayment varchar(50),
    @LeaseAnnualMiles varchar(50),
    @MileageRate varchar(50),
    @APRRate varchar(50),
    @ResidualAmount varchar(50),
    @LicenseFee varchar(50),
    @RegistrationFee varchar(50),
    @TotalTax varchar(50),
    @ExtendedWarrantyName varchar(50),
    @ExtendedWarrantyTerm varchar(50),
    @ExtendedWarrantyLimitMiles varchar(50),
    @ExtendedWarrantyDollar varchar(50),
    @ExtendedWarrantyProfit varchar(50),
    @FrontGross varchar(50),
    @BackGross varchar(50),
    @TradeIn_1_VIN varchar(50),
    @TradeIn_2_VIN varchar(50),
    @TradeIn_1_Make varchar(50),
    @TradeIn_2_Make varchar(50),
    @TradeIn_1_Model varchar(50),
    @TradeIn_2_Model varchar(50),
    @TradeIn_1_ExteriorColor varchar(50),
    @TradeIn_2_ExteriorColor varchar(50),
    @TradeIn_1_Year varchar(50),
    @TradeIn_2_Year varchar(50),
    @TradeIn_1_Mileage varchar(50),
    @TradeIn_2_Mileage varchar(50),
    @TradeIn_1_Gross varchar(50),
    @TradeIn_2_Gross varchar(50),
    @TradeIn_1_Payoff varchar(50),
    @TradeIn_2_Payoff varchar(50),
    @TradeIn_1_ACV varchar(50),
    @TradeIn_2_ACV varchar(50),
    @Fee_1_Name varchar(50),
    @Fee_1_Fee varchar(50),
    @Fee_1_Commission varchar(50),
    @Fee_2_Name varchar(50),
    @Fee_2_Fee varchar(50),
    @Fee_2_Commission varchar(50),
    @Fee_3_Name varchar(50),
    @Fee_3_Fee varchar(50),
    @Fee_3_Commission varchar(50),
    @Fee_4_Name varchar(50),
    @Fee_4_Fee varchar(50),
    @Fee_4_Commission varchar(50),
    @Fee_5_Name varchar(50),
    @Fee_5_Fee varchar(50),
    @Fee_5_Commission varchar(50),
    @Fee_6_Name varchar(50),
    @Fee_6_Fee varchar(50),
    @Fee_6_Commission varchar(50),
    @Fee_7_Name varchar(50),
    @Fee_7_Fee varchar(50),
    @Fee_7_Commission varchar(50),
    @Fee_8_Name varchar(50),
    @Fee_8_Fee varchar(50),
    @Fee_8_Commission varchar(50),
    @Fee_9_Name varchar(50),
    @Fee_9_Fee varchar(50),
    @Fee_9_Commission varchar(50),
    @Fee_10_Name varchar(50),
    @Fee_10_Fee varchar(50),
    @Fee_10_Commission varchar(50),
    @ContractDate varchar(50),
    @InsuranceName varchar(50),
    @InsuranceAgentName varchar(50),
    @InsuranceAddress varchar(50),
    @InsuranceCity varchar(50),
    @InsuranceState varchar(50),
    @InsuranceZip varchar(50),
    @InsurancePhone varchar(50),
    @InsurancePolicyNumber varchar(50),
    @InsuranceEffectiveDate varchar(50),
    @InsuranceExpirationDate varchar(50),
    @InsuranceCompensationDeduction varchar(50),
    @TradeIn_1_InteriorColor varchar(50),
    @TradeIn_2_InteriorColor varchar(50),
    @PhoneBlock varchar(50),
    @LicensePlateNumber varchar(50),
    @Cost varchar(50),
    @InvoiceAmount varchar(50),
    @FinanceCharge varchar(50),
    @TotalPickupPayment varchar(50),
    @TotalAccessories varchar(50),
    @TotalDriveOffAmount varchar(50),
    @EmailBlock varchar(50),
    @ModelDescriptionOfCarSold varchar(50),
    @VehicleClassification varchar(50),
    @ModelNumberOfCarSold varchar(50),
    @GAPPremium varchar(50),
    @LastInstallmentDate varchar(50),
    @CashDeposit varchar(50),
    @AHPremium varchar(50),
    @LeaseRate varchar(50),
    @DealerSelect varchar(50),
    @LeasePayment varchar(50),
    @LeaseNetCapCost varchar(50),
    @LeaseTotalCapReduction varchar(50),
    @DealStatus varchar(50),
    @CustomerSuffix varchar(50),
    @CustomerSalutation varchar(50),
    @CustomerAddress2 varchar(50),
    @CustomerMiddleName varchar(50),
    @GlobalOptOut varchar(50),
    @LeaseTerm varchar(50),
    @ExtendedWarrantyFlag varchar(50),
    @Salesman_3_Number varchar(50),
    @Salesman_3_Name varchar(50),
    @Salesman_4_Number varchar(50),
    @Salesman_4_Name varchar(50),
    @Salesman_5_Number varchar(50),
    @Salesman_5_Name varchar(50),
    @Salesman_6_Number varchar(50),
    @Salesman_6_Name varchar(50),
    @APRRate2 varchar(50),
    @APRRate3 varchar(50),
    @APRRate4 varchar(50),
    @Term2 varchar(50),
    @SecurityDeposit2 varchar(50),
    @DownPayment2 varchar(50),
    @TotalOfPayments2 varchar(50),
    @BasePayment varchar(50),
    @JournalSaleAmount varchar(50),
    @IndividualBusinessFlag varchar(50),
    @InventoryDate varchar(50),
    @StatusDate varchar(50),
    @ListPrice varchar(50),
    @NetTradeAmount varchar(50),
    @TrimLevel varchar(50),
    @SubTrimLevel varchar(50),
    @BodyDescription varchar(50),
    @BodyDoorCount varchar(50),
    @TransmissionDesc varchar(50),
    @EngineDesc varchar(50),
    @TypeCode varchar(50),
    @SLCT2 varchar(50),
    @DealDateOffset varchar(50),
    @AccountingDate varchar(50),
    @CoBuyerCustNum varchar(50),
    @CoBuyerCell varchar(50),
    @CoBuyerEmail varchar(50),
    @CoBuyerSalutation varchar(50),
    @CoBuyerPhoneBlock varchar(50),
    @CoBuyerMailBlock varchar(50),
    @CoBuyerEmailBlock varchar(50),
    @RealBookDate varchar(50),
    @CoBuyerMiddleName varchar(50),
    @CoBuyerCountry varchar(50),
    @CoBuyerAddress2 varchar(50),
    @CoBuyerOptOut varchar(50),
    @CoBuyerOccupation varchar(50),
    @CoBuyerEmployer varchar(50),
    @Country varchar(50),
    @Occupation varchar(50),
    @Employer varchar(50),
    @Salesman2Commission varchar(50),
    @BankAddress varchar(50),
    @BankCity varchar(50),
    @BankState varchar(50),
    @BankZip varchar(50),
    @LeaseEstimatedMiles varchar(50),
    @AFTReserve varchar(50),
    @CreditLifePrem varchar(50),
    @CreditLifeRes varchar(50),
    @AHRes varchar(50),
    @Language varchar(50),
    @BuyRate varchar(50),
    @DMVAmount varchar(50),
    @Weight varchar(50),
    @StateDMVTotFee varchar(50),
    @ROSNumber varchar(50),
    @Incentives varchar(50),
    @CASS_STD_LINE1 varchar(50),
    @CASS_STD_LINE2 varchar(50),
    @CASS_STD_CITY varchar(50),
    @CASS_STD_STATE varchar(50),
    @CASS_STD_ZIP varchar(50),
    @CASS_STD_ZIP4 varchar(50),
    @CASS_STD_DPBC varchar(50),
    @CASS_STD_CHKDGT varchar(50),
    @CASS_STD_CART varchar(50),
    @CASS_STD_LOT varchar(50),
    @CASS_STD_LOTORD varchar(50),
    @CASS_STD_URB varchar(50),
    @CASS_STD_FIPS varchar(50),
    @CASS_STD_EWS varchar(50),
    @CASS_STD_LACS varchar(50),
    @CASS_STD_ZIPMOV varchar(50),
    @CASS_STD_Z4LOM varchar(50),
    @CASS_STD_NDIAPT varchar(50),
    @CASS_STD_NDIRR varchar(50),
    @CASS_STD_LACSRT varchar(50),
    @CASS_STD_ERROR_CD varchar(50),
    @NCOA_AC_ID varchar(50),
    @NCOA_COA_ADDSRC varchar(50),
    @NCOA_COA_MATCH varchar(50),
    @NCOA_COA_MOVTYP varchar(50),
    @NCOA_COA_DATE varchar(50),
    @NCOA_COA_DELCD varchar(50),
    @NCOA_COA_RTYPE varchar(50),
    @NCOA_COA_RTNCD varchar(50),
    @NCOA_COA_LINE1 varchar(50),
    @NCOA_COA_LINE2 varchar(50),
    @NCOA_COA_CITY varchar(50),
    @NCOA_COA_STATE varchar(50),
    @NCOA_COA_ZIP varchar(50),
    @NCOA_COA_ZIP4 varchar(50),
    @NCOA_COA_DPBC varchar(50),
    @NCOA_COA_CHKDGT varchar(50),
    @NCOA_COA_CART varchar(50),
    @NCOA_COA_LOT varchar(50),
    @NCOA_COA_LOTORD varchar(50),
    @NCOA_COA_URB varchar(50),
    @NCOA_COA_Z4LOM varchar(50),
    @NCOA_COA_ACTION varchar(50),
    @NCOA_COA_QNAME varchar(50),
    @NCOA_DPV_AA varchar(50),
    @NCOA_DPV_A1 varchar(50),
    @NCOA_DPV_BB varchar(50),
    @NCOA_DPV_CC varchar(50),
    @NCOA_DPV_M1 varchar(50),
    @NCOA_DPV_M3 varchar(50),
    @NCOA_DPV_N1 varchar(50),
    @NCOA_DPV_P1 varchar(50),
    @NCOA_DPV_P3 varchar(50),
    @NCOA_DPV_RR varchar(50),
    @NCOA_DPV_R1 varchar(50),
    @NCOA_DPV_STATUS varchar(50),
    @NCOA_DPV_F1 varchar(50),
    @NCOA_DPV_G1 varchar(50),
    @NCOA_DPV_U1 varchar(50),
    @SalesID int;
    DECLARE Sales_Cursor CURSOR FOR
    SELECT * from FLATFILE_SALES;
    OPEN Sales_Cursor
    FETCH NEXT FROM Sales_Cursor
    INTO @FileType ,
    @ACDealerID ,
    @ClientDealerID ,
    @DMSType ,
    @DealNumber ,
    @CustomerNumber ,
    @CustomerName ,
    @CustomerFirstName ,
    @CustomerLastName ,
    @CustomerAddress ,
    @CustomerCity ,
    @CustomerState ,
    @CustomerZip ,
    @CustomerCounty ,
    @CustomerHomePhone ,
    @CustomerWorkPhone ,
    @CustomerCellPhone ,
    @CustomerPagerPhone ,
    @CustomerEmail ,
    @CustomerBirthDate ,
    @MailBlock ,
    @CoBuyerName ,
    @CoBuyerFirstName ,
    @CoBuyerLastName ,
    @CoBuyerAddress ,
    @CoBuyerCity ,
    @CoBuyerState ,
    @CoBuyerZip ,
    @CoBuyerCounty ,
    @CoBuyerHomePhone ,
    @CoBuyerWorkPhone ,
    @CoBuyerBirthDate ,
    @Salesman_1_Number ,
    @Salesman_1_Name ,
    @Salesman_2_Number ,
    @Salesman_2_Name ,
    @ClosingManagerName ,
    @ClosingManagerNumber ,
    @F_AND_I_ManagerNumber ,
    @F_AND_I_ManagerName ,
    @SalesManagerNumber ,
    @SalesManagerName ,
    @EntryDate ,
    @DealBookDate ,
    @VehicleYear ,
    @VehicleMake ,
    @VehicleModel ,
    @VehicleStockNumber ,
    @VehicleVIN ,
    @VehicleExteriorColor ,
    @VehicleInteriorColor ,
    @VehicleMileage ,
    @VehicleType ,
    @InServiceDate ,
    @HoldBackAmount ,
    @DealType ,
    @SaleType ,
    @BankCode ,
    @BankName ,
    @SalesmanCommission ,
    @GrossProfitSale ,
    @FinanceReserve ,
    @CreditLifePremium ,
    @CreditLifeCommision ,
    @TotalInsuranceReserve ,
    @BalloonAmount ,
    @CashPrice ,
    @AmountFinanced ,
    @TotalOfPayments ,
    @MSRP ,
    @DownPayment ,
    @SecurityDesposit ,
    @Rebate ,
    @Term ,
    @RetailPayment ,
    @PaymentType ,
    @RetailFirstPayDate ,
    @LeaseFirstPayDate ,
    @DayToFirstPayment ,
    @LeaseAnnualMiles ,
    @MileageRate ,
    @APRRate ,
    @ResidualAmount ,
    @LicenseFee ,
    @RegistrationFee ,
    @TotalTax ,
    @ExtendedWarrantyName ,
    @ExtendedWarrantyTerm ,
    @ExtendedWarrantyLimitMiles ,
    @ExtendedWarrantyDollar ,
    @ExtendedWarrantyProfit ,
    @FrontGross ,
    @BackGross ,
    @TradeIn_1_VIN ,
    @TradeIn_2_VIN ,
    @TradeIn_1_Make ,
    @TradeIn_2_Make ,
    @TradeIn_1_Model ,
    @TradeIn_2_Model ,
    @TradeIn_1_ExteriorColor ,
    @TradeIn_2_ExteriorColor ,
    @TradeIn_1_Year ,
    @TradeIn_2_Year ,
    @TradeIn_1_Mileage ,
    @TradeIn_2_Mileage ,
    @TradeIn_1_Gross ,
    @TradeIn_2_Gross ,
    @TradeIn_1_Payoff ,
    @TradeIn_2_Payoff ,
    @TradeIn_1_ACV ,
    @TradeIn_2_ACV ,
    @Fee_1_Name ,
    @Fee_1_Fee ,
    @Fee_1_Commission ,
    @Fee_2_Name ,
    @Fee_2_Fee ,
    @Fee_2_Commission ,
    @Fee_3_Name ,
    @Fee_3_Fee ,
    @Fee_3_Commission ,
    @Fee_4_Name ,
    @Fee_4_Fee ,
    @Fee_4_Commission ,
    @Fee_5_Name ,
    @Fee_5_Fee ,
    @Fee_5_Commission ,
    @Fee_6_Name ,
    @Fee_6_Fee ,
    @Fee_6_Commission ,
    @Fee_7_Name ,
    @Fee_7_Fee ,
    @Fee_7_Commission ,
    @Fee_8_Name ,
    @Fee_8_Fee ,
    @Fee_8_Commission ,
    @Fee_9_Name ,
    @Fee_9_Fee ,
    @Fee_9_Commission ,
    @Fee_10_Name ,
    @Fee_10_Fee ,
    @Fee_10_Commission ,
    @ContractDate ,
    @InsuranceName ,
    @InsuranceAgentName ,
    @InsuranceAddress ,
    @InsuranceCity ,
    @InsuranceState ,
    @InsuranceZip ,
    @InsurancePhone ,
    @InsurancePolicyNumber ,
    @InsuranceEffectiveDate ,
    @InsuranceExpirationDate ,
    @InsuranceCompensationDeduction ,
    @TradeIn_1_InteriorColor ,
    @TradeIn_2_InteriorColor ,
    @PhoneBlock ,
    @LicensePlateNumber ,
    @Cost ,
    @InvoiceAmount ,
    @FinanceCharge ,
    @TotalPickupPayment ,
    @TotalAccessories ,
    @TotalDriveOffAmount ,
    @EmailBlock ,
    @ModelDescriptionOfCarSold ,
    @VehicleClassification ,
    @ModelNumberOfCarSold ,
    @GAPPremium ,
    @LastInstallmentDate ,
    @CashDeposit ,
    @AHPremium ,
    @LeaseRate ,
    @DealerSelect ,
    @LeasePayment ,
    @LeaseNetCapCost ,
    @LeaseTotalCapReduction ,
    @DealStatus ,
    @CustomerSuffix ,
    @CustomerSalutation ,
    @CustomerAddress2 ,
    @CustomerMiddleName ,
    @GlobalOptOut ,
    @LeaseTerm ,
    @ExtendedWarrantyFlag ,
    @Salesman_3_Number ,
    @Salesman_3_Name ,
    @Salesman_4_Number ,
    @Salesman_4_Name ,
    @Salesman_5_Number ,
    @Salesman_5_Name ,
    @Salesman_6_Number ,
    @Salesman_6_Name ,
    @APRRate2 ,
    @APRRate3 ,
    @APRRate4 ,
    @Term2 ,
    @SecurityDeposit2 ,
    @DownPayment2 ,
    @TotalOfPayments2 ,
    @BasePayment ,
    @JournalSaleAmount ,
    @IndividualBusinessFlag ,
    @InventoryDate ,
    @StatusDate ,
    @ListPrice ,
    @NetTradeAmount ,
    @TrimLevel ,
    @SubTrimLevel ,
    @BodyDescription ,
    @BodyDoorCount ,
    @TransmissionDesc ,
    @EngineDesc ,
    @TypeCode ,
    @SLCT2 ,
    @DealDateOffset ,
    @AccountingDate ,
    @CoBuyerCustNum ,
    @CoBuyerCell ,
    @CoBuyerEmail ,
    @CoBuyerSalutation ,
    @CoBuyerPhoneBlock ,
    @CoBuyerMailBlock ,
    @CoBuyerEmailBlock ,
    @RealBookDate ,
    @CoBuyerMiddleName ,
    @CoBuyerCountry ,
    @CoBuyerAddress2 ,
    @CoBuyerOptOut ,
    @CoBuyerOccupation ,
    @CoBuyerEmployer ,
    @Country ,
    @Occupation ,
    @Employer ,
    @Salesman2Commission ,
    @BankAddress ,
    @BankCity ,
    @BankState ,
    @BankZip ,
    @LeaseEstimatedMiles ,
    @AFTReserve ,
    @CreditLifePrem ,
    @CreditLifeRes ,
    @AHRes ,
    @Language ,
    @BuyRate ,
    @DMVAmount ,
    @Weight ,
    @StateDMVTotFee ,
    @ROSNumber ,
    @Incentives ,
    @CASS_STD_LINE1 ,
    @CASS_STD_LINE2 ,
    @CASS_STD_CITY ,
    @CASS_STD_STATE ,
    @CASS_STD_ZIP ,
    @CASS_STD_ZIP4 ,
    @CASS_STD_DPBC ,
    @CASS_STD_CHKDGT ,
    @CASS_STD_CART ,
    @CASS_STD_LOT ,
    @CASS_STD_LOTORD ,
    @CASS_STD_URB ,
    @CASS_STD_FIPS ,
    @CASS_STD_EWS ,
    @CASS_STD_LACS ,
    @CASS_STD_ZIPMOV ,
    @CASS_STD_Z4LOM ,
    @CASS_STD_NDIAPT ,
    @CASS_STD_NDIRR ,
    @CASS_STD_LACSRT ,
    @CASS_STD_ERROR_CD ,
    @NCOA_AC_ID ,
    @NCOA_COA_ADDSRC ,
    @NCOA_COA_MATCH ,
    @NCOA_COA_MOVTYP ,
    @NCOA_COA_DATE ,
    @NCOA_COA_DELCD ,
    @NCOA_COA_RTYPE ,
    @NCOA_COA_RTNCD ,
    @NCOA_COA_LINE1 ,
    @NCOA_COA_LINE2 ,
    @NCOA_COA_CITY ,
    @NCOA_COA_STATE ,
    @NCOA_COA_ZIP ,
    @NCOA_COA_ZIP4 ,
    @NCOA_COA_DPBC ,
    @NCOA_COA_CHKDGT ,
    @NCOA_COA_CART ,
    @NCOA_COA_LOT ,
    @NCOA_COA_LOTORD ,
    @NCOA_COA_URB ,
    @NCOA_COA_Z4LOM ,
    @NCOA_COA_ACTION ,
    @NCOA_COA_QNAME ,
    @NCOA_DPV_AA ,
    @NCOA_DPV_A1 ,
    @NCOA_DPV_BB ,
    @NCOA_DPV_CC ,
    @NCOA_DPV_M1 ,
    @NCOA_DPV_M3 ,
    @NCOA_DPV_N1 ,
    @NCOA_DPV_P1 ,
    @NCOA_DPV_P3 ,
    @NCOA_DPV_RR ,
    @NCOA_DPV_R1 ,
    @NCOA_DPV_STATUS ,
    @NCOA_DPV_F1 ,
    @NCOA_DPV_G1 ,
    @NCOA_DPV_U1 ;
    WHILE @@FETCH_STATUS = 0
    BEGIN
    PRINT @VehicleVIN ;
    --===============================================================================
    -- ****************** insert into Sales Table ***********
    INSERT INTO Sales
    IconicDealerID,
    DealNumber,
    CustomerNumber,
    DMSType,
    ContractDate
    VALUES (@ClientDealerID,@DealNumber,@CustomerNumber,@DMSType,@ContractDate);
    set @SalesID = scope_identity();
    PRINT @SalesID;
    --================================================================================
    --Insert into SALES_TRADEIN Table
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES (
    @SalesID,
    case when @TradeIn_1_VIN null then @TradeIn_1_VIN else @TradeIn_2_VIN end,
    case when @TradeIn_1_Make is null then @TradeIn_1_Make else @TradeIn_2_Make end,
    case when @TradeIn_1_Model is null then @TradeIn_1_Model else @TradeIn_2_Model end,
    case when @TradeIn_1_ExteriorColor is null then @TradeIn_1_ExteriorColor else @TradeIn_2_ExteriorColor end,
    case when @TradeIn_1_Year is null then @TradeIn_1_Year else @TradeIn_2_Year end,
    case when @TradeIn_1_Mileage is null then @TradeIn_1_Mileage else @TradeIn_2_Mileage end,
    case when @TradeIn_1_Gross is null then @TradeIn_1_Gross else @TradeIn_2_Gross end,
    case when @TradeIn_1_Payoff is not null then @TradeIn_1_Payoff else @TradeIn_2_Payoff end,
    case when @TradeIn_1_ACV is null then @TradeIn_1_ACV else @TradeIn_2_ACV end,
    case when @TradeIn_1_InteriorColor is null then @TradeIn_1_InteriorColor else @TradeIn_1_InteriorColor end
    --===============================================================================
    --Insert into SALES_VEHICLE Table
    INSERT INTO SALES_VEHICLE
    SalesID ,
    VehicleYear ,
    VehicleMake ,
    VehicleModel ,
    VehicleStockNumber ,
    VehicleVIN ,
    VehicleExteriorColor ,
    VehicleInteriorColor ,
    VehicleMileage ,
    VehicleType ,
    InServiceDate ,
    LeaseAnnualMiles ,
    ExtendedWarrantyName ,
    ExtendedWarrantyTerm ,
    ExtendedWarrantyLimitMiles ,
    LicensePlateNumber ,
    ModelDescriptionOfCarSold ,
    VehicleClassification ,
    ModelNumberOfCarSold ,
    ExtendedWarrantyFlag ,
    TrimLevel ,
    SubTrimLevel ,
    BodyDescription ,
    BodyDoorCount ,
    TransmissionDesc ,
    EngineDesc ,
    TypeCode ,
    Weight ,
    LeaseEstimatedMiles
    VALUES (
    @SalesID,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleStockNumber,@VehicleVIN,
    @VehicleExteriorColor,@VehicleInteriorColor,@VehicleMileage,@VehicleType,
    @InServiceDate,@LeaseAnnualMiles,@ExtendedWarrantyName,@ExtendedWarrantyTerm,
    @ExtendedWarrantyLimitMiles,@LicensePlateNumber,@ModelDescriptionOfCarSold,
    @VehicleClassification,@ModelNumberOfCarSold,@ExtendedWarrantyFlag,
    @TrimLevel,@SubTrimLevel,@BodyDescription,@BodyDoorCount,
    @TransmissionDesc,@EngineDesc,@TypeCode,@Weight,@LeaseEstimatedMiles
    --======================================================================================
    --Insert into SALES_FEE Table
    INSERT INTO SALES_FEE
    SalesID ,
    Fee_Name ,
    Fee_Fee ,
    Fee_Commission
    VALUES (
    @SalesID,
    case
    when @Fee_1_Name is not null then @Fee_1_Name
    when @Fee_2_Name is not null then @Fee_2_Name
    when @Fee_3_Name is not null then @Fee_3_Name
    when @Fee_4_Name is not null then @Fee_4_Name
    when @Fee_5_Name is not null then @Fee_5_Name
    when @Fee_6_Name is not null then @Fee_6_Name
    when @Fee_7_Name is not null then @Fee_7_Name
    when @Fee_8_Name is not null then @Fee_8_Name
    when @Fee_9_Name is not null then @Fee_9_Name
    else @Fee_10_Name end,
    case
    when @Fee_1_Fee is not null then @Fee_1_Fee
    when @Fee_2_Fee is not null then @Fee_2_Fee
    when @Fee_3_Fee is not null then @Fee_3_Fee
    when @Fee_4_Fee is not null then @Fee_4_Fee
    when @Fee_5_Fee is not null then @Fee_5_Fee
    when @Fee_6_Fee is not null then @Fee_6_Fee
    when @Fee_7_Fee is not null then @Fee_7_Fee
    when @Fee_8_Fee is not null then @Fee_8_Fee
    when @Fee_9_Fee is not null then @Fee_9_Fee
    else @Fee_10_Fee end,
    case
    when @Fee_1_Commission is not null then @Fee_1_Commission
    when @Fee_2_Commission is not null then @Fee_2_Commission
    when @Fee_3_Commission is not null then @Fee_3_Commission
    when @Fee_4_Commission is not null then @Fee_4_Commission
    when @Fee_5_Commission is not null then @Fee_5_Commission
    when @Fee_6_Commission is not null then @Fee_6_Commission
    when @Fee_7_Commission is not null then @Fee_7_Commission
    when @Fee_8_Commission is not null then @Fee_8_Commission
    when @Fee_9_Commission is not null then @Fee_9_Commission
    else @Fee_10_Commission end
    --======================================================================================
    --Insert into SALES_HR Table
    INSERT INTO SALES_HR
    SalesID ,
    Salesman_Number ,
    Salesman_Name ,
    ClosingManagerName ,
    ClosingManagerNumber ,
    F_AND_I_ManagerNumber ,
    F_AND_I_ManagerName ,
    SalesManagerNumber ,
    SalesManagerName
    VALUES (
    @SalesID ,
    case
    when @Salesman_1_Number is not null then @Salesman_1_Number
    when @Salesman_2_Number is not null then @Salesman_2_Number
    when @Salesman_3_Number is not null then @Salesman_3_Number
    when @Salesman_4_Number is not null then @Salesman_4_Number
    when @Salesman_5_Number is not null then @Salesman_5_Number
    else @Salesman_6_Number end,
    case
    when @Salesman_1_Name is not null then @Salesman_1_Name
    when @Salesman_2_Name is not null then @Salesman_2_Name
    when @Salesman_3_Name is not null then @Salesman_3_Name
    when @Salesman_4_Name is not null then @Salesman_4_Name
    when @Salesman_5_Name is not null then @Salesman_5_Name
    else @Salesman_6_Name end,
    @ClosingManagerName ,
    @ClosingManagerNumber ,
    @F_AND_I_ManagerNumber ,
    @F_AND_I_ManagerName ,
    @SalesManagerNumber ,
    @SalesManagerName
    --======================================================================================
    --Insert into SALES_COBUYER Table
    INSERT INTO SALES_COBUYER
    SalesID ,
    CoBuyerName ,
    CoBuyerFirstName ,
    CoBuyerLastName ,
    CoBuyerAddress ,
    CoBuyerCity ,
    CoBuyerState ,
    CoBuyerZip ,
    CoBuyerCounty ,
    CoBuyerHomePhone ,
    CoBuyerWorkPhone ,
    CoBuyerBirthDate ,
    CoBuyerCustNum ,
    CoBuyerCell ,
    CoBuyerEmail ,
    CoBuyerSalutation ,
    CoBuyerMiddleName ,
    CoBuyerCountry ,
    CoBuyerAddress2 ,
    CoBuyerOptOut ,
    CoBuyerOccupation ,
    CoBuyerEmployer ,
    CoBuyerPhoneBlock ,
    CoBuyerMailBlock ,
    CoBuyerEmailBlock
    VALUES (
    @SalesID,@CoBuyerName,@CoBuyerFirstName,@CoBuyerLastName,@CoBuyerAddress,
    @CoBuyerCity,@CoBuyerState,@CoBuyerZip,@CoBuyerCounty,@CoBuyerHomePhone,
    @CoBuyerWorkPhone,@CoBuyerBirthDate,@CoBuyerCustNum,@CoBuyerCell,
    @CoBuyerEmail,@CoBuyerSalutation,@CoBuyerMiddleName,@CoBuyerCountry,
    @CoBuyerAddress2,@CoBuyerOptOut,@CoBuyerOccupation,@CoBuyerEmployer,
    @CoBuyerPhoneBlock,@CoBuyerMailBlock,@CoBuyerEmailBlock
    --======================================================================================
    --Insert into SALES_CUSTOMER Table
    INSERT INTO SALES_CUSTOMER
    SalesID ,
    IndividualBusinessFlag ,
    PhoneBlock ,
    EmailBlock ,
    CustomerName ,
    CustomerFirstName ,
    CustomerLastName ,
    CustomerAddress ,
    CustomerCity ,
    CustomerState ,
    CustomerZip ,
    CustomerCounty ,
    CustomerHomePhone ,
    CustomerWorkPhone ,
    CustomerCellPhone ,
    CustomerPagerPhone ,
    CustomerEmail ,
    CustomerBirthDate ,
    MailBlock ,
    CustomerSuffix ,
    CustomerSalutation ,
    CustomerAddress2 ,
    CustomerMiddleName ,
    GlobalOptOut ,
    InsuranceName ,
    InsuranceAgentName ,
    InsuranceAddress ,
    InsuranceCity ,
    InsuranceState ,
    InsuranceZip ,
    InsurancePhone ,
    InsurancePolicyNumber ,
    InsuranceEffectiveDate ,
    InsuranceExpirationDate ,
    InsuranceCompensationDeduction ,
    Country ,
    Occupation ,
    Employer ,
    CASS_STD_LINE1 ,
    CASS_STD_LINE2 ,
    CASS_STD_CITY ,
    CASS_STD_STATE ,
    CASS_STD_ZIP ,
    CASS_STD_ZIP4 ,
    CASS_STD_DPBC ,
    CASS_STD_CHKDGT ,
    CASS_STD_CART ,
    CASS_STD_LOT ,
    CASS_STD_LOTORD ,
    CASS_STD_URB ,
    CASS_STD_FIPS ,
    CASS_STD_EWS ,
    CASS_STD_LACS ,
    CASS_STD_ZIPMOV ,
    CASS_STD_Z4LOM ,
    CASS_STD_NDIAPT ,
    CASS_STD_NDIRR ,
    CASS_STD_LACSRT ,
    CASS_STD_ERROR_CD ,
    NCOA_AC_ID ,
    NCOA_COA_ADDSRC ,
    NCOA_COA_MATCH ,
    NCOA_COA_MOVTYP ,
    NCOA_COA_DATE ,
    NCOA_COA_DELCD ,
    NCOA_COA_RTYPE ,
    NCOA_COA_RTNCD ,
    NCOA_COA_LINE1 ,
    NCOA_COA_LINE2 ,
    NCOA_COA_CITY ,
    NCOA_COA_STATE ,
    NCOA_COA_ZIP ,
    NCOA_COA_ZIP4 ,
    NCOA_COA_DPBC ,
    NCOA_COA_CHKDGT ,
    NCOA_COA_CART ,
    NCOA_COA_LOT ,
    NCOA_COA_LOTORD ,
    NCOA_COA_URB ,
    NCOA_COA_Z4LOM ,
    NCOA_COA_ACTION ,
    NCOA_COA_QNAME ,
    NCOA_DPV_AA ,
    NCOA_DPV_A1 ,
    NCOA_DPV_BB ,
    NCOA_DPV_CC ,
    NCOA_DPV_M1 ,
    NCOA_DPV_M3 ,
    NCOA_DPV_N1 ,
    NCOA_DPV_P1 ,
    NCOA_DPV_P3 ,
    NCOA_DPV_RR ,
    NCOA_DPV_R1 ,
    NCOA_DPV_STATUS ,
    NCOA_DPV_F1 ,
    NCOA_DPV_G1 ,
    NCOA_DPV_U1
    VALUES (
    @SalesID ,
    @IndividualBusinessFlag ,
    @PhoneBlock ,
    @EmailBlock ,
    @CustomerName ,
    @CustomerFirstName ,
    @CustomerLastName ,
    @CustomerAddress ,
    @CustomerCity ,
    @CustomerState ,
    @CustomerZip ,
    @CustomerCounty ,
    @CustomerHomePhone ,
    @CustomerWorkPhone ,
    @CustomerCellPhone ,
    @CustomerPagerPhone ,
    @CustomerEmail ,
    @CustomerBirthDate ,
    @MailBlock ,
    @CustomerSuffix ,
    @CustomerSalutation ,
    @CustomerAddress2 ,
    @CustomerMiddleName ,
    @GlobalOptOut ,
    @InsuranceName ,
    @InsuranceAgentName ,
    @InsuranceAddress ,
    @InsuranceCity ,
    @InsuranceState ,
    @InsuranceZip ,
    @InsurancePhone ,
    @InsurancePolicyNumber ,
    @InsuranceEffectiveDate ,
    @InsuranceExpirationDate ,
    @InsuranceCompensationDeduction ,
    @Country ,
    @Occupation ,
    @Employer ,
    @CASS_STD_LINE1 ,
    @CASS_STD_LINE2 ,
    @CASS_STD_CITY ,
    @CASS_STD_STATE ,
    @CASS_STD_ZIP ,
    @CASS_STD_ZIP4 ,
    @CASS_STD_DPBC ,
    @CASS_STD_CHKDGT ,
    @CASS_STD_CART ,
    @CASS_STD_LOT ,
    @CASS_STD_LOTORD ,
    @CASS_STD_URB ,
    @CASS_STD_FIPS ,
    @CASS_STD_EWS ,
    @CASS_STD_LACS ,
    @CASS_STD_ZIPMOV ,
    @CASS_STD_Z4LOM ,
    @CASS_STD_NDIAPT ,
    @CASS_STD_NDIRR ,
    @CASS_STD_LACSRT ,
    @CASS_STD_ERROR_CD ,
    @NCOA_AC_ID ,
    @NCOA_COA_ADDSRC ,
    @NCOA_COA_MATCH ,
    @NCOA_COA_MOVTYP ,
    @NCOA_COA_DATE ,
    @NCOA_COA_DELCD ,
    @NCOA_COA_RTYPE ,
    @NCOA_COA_RTNCD ,
    @NCOA_COA_LINE1 ,
    @NCOA_COA_LINE2 ,
    @NCOA_COA_CITY ,
    @NCOA_COA_STATE ,
    @NCOA_COA_ZIP ,
    @NCOA_COA_ZIP4 ,
    @NCOA_COA_DPBC ,
    @NCOA_COA_CHKDGT ,
    @NCOA_COA_CART ,
    @NCOA_COA_LOT ,
    @NCOA_COA_LOTORD ,
    @NCOA_COA_URB ,
    @NCOA_COA_Z4LOM ,
    @NCOA_COA_ACTION ,
    @NCOA_COA_QNAME ,
    @NCOA_DPV_AA ,
    @NCOA_DPV_A1 ,
    @NCOA_DPV_BB ,
    @NCOA_DPV_CC ,
    @NCOA_DPV_M1 ,
    @NCOA_DPV_M3 ,
    @NCOA_DPV_N1 ,
    @NCOA_DPV_P1 ,
    @NCOA_DPV_P3 ,
    @NCOA_DPV_RR ,
    @NCOA_DPV_R1 ,
    @NCOA_DPV_STATUS ,
    @NCOA_DPV_F1 ,
    @NCOA_DPV_G1 ,
    @NCOA_DPV_U1
    --======================================================================================
    --Insert into SALES_AMOUNT Table
    INSERT INTO SALES_AMOUNT
    SalesID ,
    HoldBackAmount ,
    ExtendedWarrantyDollar ,
    ExtendedWarrantyProfit ,
    FrontGross ,
    BackGross ,
    MileageRate ,
    APRRate ,
    ResidualAmount ,
    LicenseFee ,
    RegistrationFee ,
    TotalTax ,
    Cost ,
    InvoiceAmount ,
    FinanceCharge ,
    TotalPickupPayment ,
    TotalAccessories ,
    TotalDriveOffAmount ,
    SalesmanCommission ,
    GrossProfitSale ,
    FinanceReserve ,
    CreditLifePremium ,
    CreditLifeCommision ,
    TotalInsuranceReserve ,
    BalloonAmount ,
    CashPrice ,
    AmountFinanced ,
    TotalOfPayments ,
    MSRP ,
    DownPayment ,
    SecurityDesposit ,
    Rebate ,
    Term ,
    RetailPayment ,
    LeasePayment ,
    LeaseNetCapCost ,
    LeaseTotalCapReduction ,
    APRRate2 ,
    APRRate3 ,
    GAPPremium ,
    LeaseTerm ,
    CashDeposit ,
    AHPremium ,
    LeaseRate ,
    Incentives ,
    StateDMVTotFee ,
    BuyRate ,
    DMVAmount ,
    CreditLifePrem ,
    CreditLifeRes ,
    AHRes ,
    Salesman2Commission ,
    ListPrice ,
    NetTradeAmount ,
    APRRate4 ,
    Term2 ,
    SecurityDeposit2 ,
    DownPayment2 ,
    TotalOfPayments2 ,
    BasePayment ,
    JournalSaleAmount
    VALUES (
    @SalesID,@HoldBackAmount,@ExtendedWarrantyDollar,@ExtendedWarrantyProfit,
    @FrontGross,@BackGross,@MileageRate,@APRRate,@ResidualAmount,@LicenseFee,
    @RegistrationFee,@TotalTax,@Cost,@InvoiceAmount,@FinanceCharge,
    @TotalPickupPayment,@TotalAccessories,@TotalDriveOffAmount,@SalesmanCommission,
    @GrossProfitSale,@FinanceReserve,@CreditLifePremium,@CreditLifeCommision,
    @TotalInsuranceReserve,@BalloonAmount,@CashPrice,@AmountFinanced,@TotalOfPayments,
    @MSRP,@DownPayment,@SecurityDesposit,@Rebate,@Term,@RetailPayment,@LeasePayment,
    @LeaseNetCapCost,@LeaseTotalCapReduction,@APRRate2,@APRRate3,@GAPPremium,
    @LeaseTerm,@CashDeposit,@AHPremium,@LeaseRate,@Incentives,@StateDMVTotFee,
    @BuyRate,@DMVAmount,@CreditLifePrem,@CreditLifeRes,@AHRes,@Salesman2Commission,
    @ListPrice,@NetTradeAmount,@APRRate4,@Term2,@SecurityDeposit2,
    @DownPayment2,@TotalOfPayments2,@BasePayment,@JournalSaleAmount
    --===========================================================================
    --Insert into SALES_BANKINFO Table
    INSERT INTO SALES_BANKINFO
    SalesID ,
    SLCT2 ,
    DealDateOffset ,
    DealerSelect ,
    DealStatus ,
    DealType ,
    SaleType ,
    BankCode ,
    BankName ,
    PaymentType ,
    BankAddress ,
    BankCity ,
    BankState ,
    BankZip ,
    AFTReserve ,
    Language ,
    ROSNumber
    VALUES (
    @SalesID,@SLCT2,@DealDateOffset,@DealerSelect,@DealStatus,@DealType,
    @SaleType,@BankCode,@BankName,@PaymentType,@BankAddress,@BankCity,
    @BankState,@BankZip,@AFTReserve,@Language,@ROSNumber
    ---=======================================================
    INSERT INTO SALES_DATE
    SalesID ,
    AccountingDate ,
    InventoryDate ,
    StatusDate ,
    LastInstallmentDate ,
    RetailFirstPayDate ,
    LeaseFirstPayDate ,
    DayToFirstPayment ,
    EntryDate ,
    DealBookDate ,
    RealBookDate
    VALUES (
    @SalesID ,
    convert (datetime,@AccountingDate) ,
    -- CAST (@AccountingDate AS datetime),
    convert (datetime,@InventoryDate) ,
    -- CAST (@InventoryDate AS datetime),
    convert (datetime,@StatusDate) ,
    -- CAST (@StatusDate AS datetime),
    convert (datetime,@LastInstallmentDate),
    -- CAST (@LastInstallmentDate AS datetime),
    convert (datetime,@RetailFirstPayDate) ,
    -- CAST (@RetailFirstPayDate AS datetime),
    @LeaseFirstPayDate ,
    convert (datetime,@DayToFirstPayment),
    -- CAST (@DayToFirstPayment AS datetime),
    convert (datetime,@EntryDate),
    -- CAST (@EntryDate AS datetime),
    convert (datetime,@DealBookDate),
    -- CAST (@DealBookDate AS datetime),
    convert (datetime,@RealBookDate)
    -- CAST (@RealBookDate AS datetime)
    */---=======================================================
    --======================================================================================
    -- Move cursor to Next record
    FETCH NEXT FROM Sales_Cursor
    INTO @FileType ,
    @ACDealerID ,
    @ClientDealerID ,
    @DMSType ,
    @DealNumber ,
    @CustomerNumber ,
    @CustomerName ,
    @CustomerFirstName ,
    @CustomerLastName ,
    @CustomerAddress ,
    @CustomerCity ,
    @CustomerState ,
    @CustomerZip ,
    @CustomerCounty ,
    @CustomerHomePhone ,
    @CustomerWorkPhone ,
    @CustomerCellPhone ,
    @CustomerPagerPhone ,
    @CustomerEmail ,
    @CustomerBirthDate ,
    @MailBlock ,
    @CoBuyerName ,
    @CoBuyerFirstName ,
    @CoBuyerLastName ,
    @CoBuyerAddress ,
    @CoBuyerCity ,
    @CoBuyerState ,
    @CoBuyerZip ,
    @CoBuyerCounty ,
    @CoBuyerHomePhone ,
    @CoBuyerWorkPhone ,
    @CoBuyerBirthDate ,
    @Salesman_1_Number ,
    @Salesman_1_Name ,
    @Salesman_2_Number ,
    @Salesman_2_Name ,
    @ClosingManagerName ,
    @ClosingManagerNumber ,
    @F_AND_I_ManagerNumber ,
    @F_AND_I_ManagerName ,
    @SalesManagerNumber ,
    @SalesManagerName ,
    @EntryDate ,
    @DealBookDate ,
    @VehicleYear ,
    @VehicleMake ,
    @VehicleModel ,
    @VehicleStockNumber ,
    @VehicleVIN ,
    @VehicleExteriorColor ,
    @VehicleInteriorColor ,
    @VehicleMileage ,
    @VehicleType ,
    @InServiceDate ,
    @HoldBackAmount ,
    @DealType ,
    @SaleType ,
    @BankCode ,
    @BankName ,
    @SalesmanCommission ,
    @GrossProfitSale ,
    @FinanceReserve ,
    @CreditLifePremium ,
    @CreditLifeCommision ,
    @TotalInsuranceReserve ,
    @BalloonAmount ,
    @CashPrice ,
    @AmountFinanced ,
    @TotalOfPayments ,
    @MSRP ,
    @DownPayment ,
    @SecurityDesposit ,
    @Rebate ,
    @Term ,
    @RetailPayment ,
    @PaymentType ,
    @RetailFirstPayDate ,
    @LeaseFirstPayDate ,
    @DayToFirstPayment ,
    @LeaseAnnualMiles ,
    @MileageRate ,
    @APRRate ,
    @ResidualAmount ,
    @LicenseFee ,
    @RegistrationFee ,
    @TotalTax ,
    @ExtendedWarrantyName ,
    @ExtendedWarrantyTerm ,
    @ExtendedWarrantyLimitMiles ,
    @ExtendedWarrantyDollar ,
    @ExtendedWarrantyProfit ,
    @FrontGross ,
    @BackGross ,
    @TradeIn_1_VIN ,
    @TradeIn_2_VIN ,
    @TradeIn_1_Make ,
    @TradeIn_2_Make ,
    @TradeIn_1_Model ,
    @TradeIn_2_Model ,
    @TradeIn_1_ExteriorColor ,
    @TradeIn_2_ExteriorColor ,
    @TradeIn_1_Year ,
    @TradeIn_2_Year ,
    @TradeIn_1_Mileage ,
    @TradeIn_2_Mileage ,
    @TradeIn_1_Gross ,
    @TradeIn_2_Gross ,
    @TradeIn_1_Payoff ,
    @TradeIn_2_Payoff ,
    @TradeIn_1_ACV ,
    @TradeIn_2_ACV ,
    @Fee_1_Name ,
    @Fee_1_Fee ,
    @Fee_1_Commission ,
    @Fee_2_Name ,
    @Fee_2_Fee ,
    @Fee_2_Commission ,
    @Fee_3_Name ,
    @Fee_3_Fee ,
    @Fee_3_Commission ,
    @Fee_4_Name ,
    @Fee_4_Fee ,
    @Fee_4_Commission ,
    @Fee_5_Name ,
    @Fee_5_Fee ,
    @Fee_5_Commission ,
    @Fee_6_Name ,
    @Fee_6_Fee ,
    @Fee_6_Commission ,
    @Fee_7_Name ,
    @Fee_7_Fee ,
    @Fee_7_Commission ,
    @Fee_8_Name ,
    @Fee_8_Fee ,
    @Fee_8_Commission ,
    @Fee_9_Name ,
    @Fee_9_Fee ,
    @Fee_9_Commission ,
    @Fee_10_Name ,
    @Fee_10_Fee ,
    @Fee_10_Commission ,
    @ContractDate ,
    @InsuranceName ,
    @InsuranceAgentName ,
    @InsuranceAddress ,
    @InsuranceCity ,
    @InsuranceState ,
    @InsuranceZip ,
    @InsurancePhone ,
    @InsurancePolicyNumber ,
    @InsuranceEffectiveDate ,
    @InsuranceExpirationDate ,
    @InsuranceCompensationDeduction ,
    @TradeIn_1_InteriorColor ,
    @TradeIn_2_InteriorColor ,
    @PhoneBlock ,
    @LicensePlateNumber ,
    @Cost ,
    @InvoiceAmount ,
    @FinanceCharge ,
    @TotalPickupPayment ,
    @TotalAccessories ,
    @TotalDriveOffAmount ,
    @EmailBlock ,
    @ModelDescriptionOfCarSold ,
    @VehicleClassification ,
    @ModelNumberOfCarSold ,
    @GAPPremium ,
    @LastInstallmentDate ,
    @CashDeposit ,
    @AHPremium ,
    @LeaseRate ,
    @DealerSelect ,
    @LeasePayment ,
    @LeaseNetCapCost ,
    @LeaseTotalCapReduction ,
    @DealStatus ,
    @CustomerSuffix ,
    @CustomerSalutation ,
    @CustomerAddress2 ,
    @CustomerMiddleName ,
    @GlobalOptOut ,
    @LeaseTerm ,
    @ExtendedWarrantyFlag ,
    @Salesman_3_Number ,
    @Salesman_3_Name ,
    @Salesman_4_Number ,
    @Salesman_4_Name ,
    @Salesman_5_Number ,
    @Salesman_5_Name ,
    @Salesman_6_Number ,
    @Salesman_6_Name ,
    @APRRate2 ,
    @APRRate3 ,
    @APRRate4 ,
    @Term2 ,
    @SecurityDeposit2 ,
    @DownPayment2 ,
    @TotalOfPayments2 ,
    @BasePayment ,
    @JournalSaleAmount ,
    @IndividualBusinessFlag ,
    @InventoryDate ,
    @StatusDate ,
    @ListPrice ,
    @NetTradeAmount ,
    @TrimLevel ,
    @SubTrimLevel ,
    @BodyDescription ,
    @BodyDoorCount ,
    @TransmissionDesc ,
    @EngineDesc ,
    @TypeCode ,
    @SLCT2 ,
    @DealDateOffset ,
    @AccountingDate ,
    @CoBuyerCustNum ,
    @CoBuyerCell ,
    @CoBuyerEmail ,
    @CoBuyerSalutation ,
    @CoBuyerPhoneBlock ,
    @CoBuyerMailBlock ,
    @CoBuyerEmailBlock ,
    @RealBookDate ,
    @CoBuyerMiddleName ,
    @CoBuyerCountry ,
    @CoBuyerAddress2 ,
    @CoBuyerOptOut ,
    @CoBuyerOccupation ,
    @CoBuyerEmployer ,
    @Country ,
    @Occupation ,
    @Employer ,
    @Salesman2Commission ,
    @BankAddress ,
    @BankCity ,
    @BankState ,
    @BankZip ,
    @LeaseEstimatedMiles ,
    @AFTReserve ,
    @CreditLifePrem ,
    @CreditLifeRes ,
    @AHRes ,
    @Language ,
    @BuyRate ,
    @DMVAmount ,
    @Weight ,
    @StateDMVTotFee ,
    @ROSNumber ,
    @Incentives ,
    @CASS_STD_LINE1 ,
    @CASS_STD_LINE2 ,
    @CASS_STD_CITY ,
    @CASS_STD_STATE ,
    @CASS_STD_ZIP ,
    @CASS_STD_ZIP4 ,
    @CASS_STD_DPBC ,
    @CASS_STD_CHKDGT ,
    @CASS_STD_CART ,
    @CASS_STD_LOT ,
    @CASS_STD_LOTORD ,
    @CASS_STD_URB ,
    @CASS_STD_FIPS ,
    @CASS_STD_EWS ,
    @CASS_STD_LACS ,
    @CASS_STD_ZIPMOV ,
    @CASS_STD_Z4LOM ,
    @CASS_STD_NDIAPT ,
    @CASS_STD_NDIRR ,
    @CASS_STD_LACSRT ,
    @CASS_STD_ERROR_CD ,
    @NCOA_AC_ID ,
    @NCOA_COA_ADDSRC ,
    @NCOA_COA_MATCH ,
    @NCOA_COA_MOVTYP ,
    @NCOA_COA_DATE ,
    @NCOA_COA_DELCD ,
    @NCOA_COA_RTYPE ,
    @NCOA_COA_RTNCD ,
    @NCOA_COA_LINE1 ,
    @NCOA_COA_LINE2 ,
    @NCOA_COA_CITY ,
    @NCOA_COA_STATE ,
    @NCOA_COA_ZIP ,
    @NCOA_COA_ZIP4 ,
    @NCOA_COA_DPBC ,
    @NCOA_COA_CHKDGT ,
    @NCOA_COA_CART ,
    @NCOA_COA_LOT ,
    @NCOA_COA_LOTORD ,
    @NCOA_COA_URB ,
    @NCOA_COA_Z4LOM ,
    @NCOA_COA_ACTION ,
    @NCOA_COA_QNAME ,
    @NCOA_DPV_AA ,
    @NCOA_DPV_A1 ,
    @NCOA_DPV_BB ,
    @NCOA_DPV_CC ,
    @NCOA_DPV_M1 ,
    @NCOA_DPV_M3 ,
    @NCOA_DPV_N1 ,
    @NCOA_DPV_P1 ,
    @NCOA_DPV_P3 ,
    @NCOA_DPV_RR ,
    @NCOA_DPV_R1 ,
    @NCOA_DPV_STATUS ,
    @NCOA_DPV_F1 ,
    @NCOA_DPV_G1 ,
    @NCOA_DPV_U1;
    END
    CLOSE Sales_Cursor;
    DEALLOCATE Sales_Cursor;
    GO
    SET ANSI_PADDING OFF
    GO

    Duplicate thread:
    problem - original

  • Set the color of a row depending the value of the column in JTable?

    Hi All,
    I have a JTable that add rows when the user clicks on the button. In this way there can be any no. of rows in my table. My table contains five columns. When a new row is added , it is added with new data each time. Also the data of the rows keep on changing time to time.
    My problem is that when the data value for the third column comes out to be -ve then color of the row should be red and if its value is +ve then the color of the row should be green.
    I have tried for this in the way but it is not working properly.
    public Component prepareRenderer(TableCellRenderer renderer,int rowIndex, int vColIndex)
         Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
    if(change<0 && rowIndex<table.getRowCount() )
              c.setForeground(Color.red);
              c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    else if(change>0&&rowIndex<table.getRowCount() )
    c.setForeground(new Color(20,220,20));
         c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    return c;
    where change is the value of the third column.
    Any help is highly appreciated.
    Thanx in advance.
    Regards,
    Har Krishan

    Why do you have 3 postings on this topic all made within minutes of each other? (see [url http://forum.java.sun.com/thread.jspa?threadID=574547&tstart=0]here and [url http://forum.java.sun.com/thread.jspa?threadID=574543&tstart=0]here).
    If you created a post by mistake then make a comment in the posting so people don't waste there time attempting to answer an old post.
    where change is the value of the third column.How do you know "change" is the value of the third column? Did you use a System.out.println(...) to verify this.
    A better approach is to use:
    Object o = table.getModel().getValueAt(row, 2);
    Then convert the Object to an int value and do your testing. This way you are guaranteed to be testing against the correct value.

  • Passing values of the column in the last level of a dimension hierarchy.

    My report has two colums
    Column1 (Dimension has a hierarchy)
    Columns2 (Fact with an Aggregation Rule)
    I want to use the drill down facility in column 1 and pass the value in the last level of the hierarchy to navigate to another report. Can someone help me on this?
    [Note: The above is possible when the column that is on the last level of the drill hierarchy is in the main report]

    @ubuntupenguin Thanx for your prompt reply.
    I am currently able to store all the necessary symbols in an array. But, How do I query for multiple symbols in the SQL Query ?
    I have an array symArr[] which consists of all the symbols I need to query from the database. So, How should I write the SQL Query is my question.
    I could have created a string which looks something like this from the symArr[] array:
    XOM,AA,BAC,BB,BBC,....
    But, the problem would be when I try to query these symbols in the php data service using "SELECT * FROM TABLENAME WHERE SYMBOL IN (?)"
    where the variable $symbol is the populated string (XOM,AA,BAC,BB,BBC,.... ). So, to rephrase my question, Could I use SELECT * FROM TABLENAME WHERE SYMBOL IN (?) to query for Multiple symbols or is there a better approach.
    Thanx in advance.
    -Krishna

  • How to add only highest values in the column

    Hello All,
    We have report where I need to add only highest values in 'Price' column.
    Ex:
    Group  Mat      Price
    Grp1    Mat1    50
               Mat2    75
               Mat3    100
    Grp2    Mat1    50
               Mat2    100
    I need my result as 200...
    Any input is appreciated!
    Thanks in advance !!
    Venu.

    Sriman/Surendra,
    Unfortunately, this approach does not work because the Calculate Result As --> Maximum applies not only to the subtotals but also to the grand total. Therefore, the result in Venu's example will be:
    MAX(Grp1) = 100
    MAX(Grp2) = 100
    MAX(All Grps) = 100
    We have the same requirement as Venu, but have not found a satisfactory solution yet. The only way we have solved such problems in the past is to use VBA in workbooks, but the report we are using now is a Web report.
    Hope this helps to clarify the issue...
    Bob

Maybe you are looking for

  • HT201250 Can I use Time Machine on two different Macs to back up to one external drive?

    Can I use Time Machine on two different Macs to back up to one external drive? I have one 1T Western Digital backup drive that works well with Time Machine and my MacBook Pro.  I now want to back up my wife's MacBook Air using Time Machine on her Mac

  • Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection

    Hi All, I am getting below exception when I am trying to establish HTTPS connection using Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection sometime my code works and some time it gives me this exception below is the exception whi

  • Old apple tv can no longer sync back to computer

    I have an old apple tv that I would sync movies and tv shows for my kids. This way if the network wasn't working properly my wife could still put on a show. Recently all of the shows in my tv shows or my movies is gone and i now need to go to my shar

  • Reports in ABAP

    Generally we create T.codes for screens. Can we create T.codes for reports ?

  • Mesh 2602i AP - One-way Neighbor

    Hi everyone I have two test AP's set up as RAP and MAP.  MAP shows the correct neighbor info, but RAP does not show anything.  I try to do a link test on the MAP, but it displays the following error - ERROR: Cannot get stats from destination AP Unabl