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

Similar Messages

  • Problem while running the report from stored procedure

    Hi,
    I using stored procedure to generate my report.
    my stored procedure's code looks like this.
    CREATE OR REPLACE PROCEDURE PROJECTOVERVIEWREPORT1(query in VARCHAR2)
    IS
    myPlist SRW_PARAMLIST;
    myIdent SRW.Job_Ident;
    myStatus SRW.Status_Record;
    BEGIN
    srw.start_Debugging;
    myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));
    srw.add_parameter(myPlist,'GATEWAY','http://localhost:8888/reports/rwservlet');
    srw.add_parameter(myPlist,'SERVER','rep_kalyan1');
    srw.add_parameter(myPlist,'REPORT','BillFormat.RDF');
    srw.add_parameter(myPlist,'USERID','atl3_dev_jul04/atl3_dev_jul04@mgi');
    srw.add_parameter(myPlist,'destype','file');
    srw.add_parameter(myPlist,'desformat','pdf');
    srw.add_parameter(myPlist,'documentnumber','17181');
    srw.add_parameter(myPlist,'papertype','N');
    srw.add_parameter(myPlist,'desname','c:\temp\17181.pdf');
    myIdent := srw.run_report(myPlist);
    myStatus := srw.report_status(myIdent);
    srw.stop_Debugging;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
    NULL;
    END PROJECTOVERVIEWREPORT1;
    Iam running the oc4j instance and the report server in my local machine.
    when i have typed http://localhost:8888/reports/rwservlet
    Iam able to see the help page.
    My rdf file is placed in OralceHome/reports/integ folder.
    Iam executing my stored procedure it is returning some error.
    Iam doing any thing wrong.
    Do i need to modify anything.
    Is the place of rdf file correct.
    plz help me solving the above problem.
    --Kalyan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    This is the error message iam getting..
    any idea????
    * WELCOME TO EVENT-BASED-REPORTING API *
    * API-Version : 9i *
    * (C) Oracle Corporation, 2000 *
    * Debugging turned ON *************************************
    *** Length of Paramlist : 1
    OK : Parameter added : GATEWAY=http://localhost:8888/reports/rwservlet
    *** Length of Paramlist : 2
    OK : Parameter added : SERVER=rep_kalyan1
    *** Length of Paramlist : 3
    OK : Parameter added : REPORT=BillFormat.RDF
    *** Length of Paramlist : 4
    OK : Parameter added : USERID=atl3_dev_jul04/atl3_dev_jul04@mgi
    *** Length of Paramlist : 5
    OK : Parameter added : DESTYPE=file
    *** Length of Paramlist : 6
    OK : Parameter added : DESFORMAT=pdf
    *** Length of Paramlist : 7
    OK : Parameter added : DOCUMENTNUMBER=17181
    *** Length of Paramlist : 8
    OK : Parameter added : PAPERTYPE=N
    *** Length of Paramlist : 9
    OK : Parameter added : DESNAME=c:\temp\17181.pdf
    Starting run_report: building url
    *** Building URL (RUN_REPORT)
    OK : URL built : http://localhost:8888/reports/rwservlet?SERVER=rep%5Fkalyan1&REPORT=BillFormat%2ERDF&USERID=atl3%5Fdev%5Fjul04%2Fatl3%5Fdev%5Fjul04%40mgi&DESTYPE=file&DESFORMAT=pdf&DOCUMENTNUMBER=17181&PAPERTYPE=N&DESNAME=c%3A%5Ctemp%5C17181%2Epdf&statu
    *** Submitting HTTP Request
    *** using URL :http://localhost:8888/reports/rwservlet?SERVER=rep%5Fkalyan1&REPORT=BillFormat%2ERDF&USERID=atl3%5Fdev%5Fjul04%2Fatl3%5Fdev%5Fjul04%40mgi&DESTYPE=file&DESFORMAT=pdf&DOCUMENTNUMBER=17181&PAPERTYPE=N&DESNAME=c%3A%5Ctemp%5C17181%2Epdf&statusf
    ERROR : HTTP request failed

  • How to insert varchar2 value in timestamp column in table?

    Hi all,
    Hope doing well,
    sir i am using one stored procedure and storing time in varchar2 variable in this format: 08:00:00
    now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
    thanks

    952646 wrote:
    Hi all,
    Hope doing well,
    sir i am using one stored procedure and storing time in varchar2 variable A "Very Bad Idea"(tm)
    When you do this, there is no fundamental difference between "08:00:00" and "here's your sign".
    Data should always be stored in the correct data type. For dates and times, that data type is either DATE or TIMESTAMP. Period.
    in this format: 08:00:00
    now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
    Hopefully as remediation to the original bad design.
    thanks

  • If variable name is the same as the column name in procedure ?

    If variable name is the same as the column name in procedure , What should i do?
    For Example :
    CREATE OR REPLACE PROCEDURE "TEST_PROC" (MIN_SALARY in UMBER)
    as
    begin
    INSERT INTO TEST SELECT JOB_ID,MIN_SALARY FROM JOBS WHERE MIN_SALARY = MIN_SALARY;
    end;

    You could follow a better naming convention and have the parameters to the procedures named in a way so as not to be confused with column names.
    You could prefix the variable names with the name of the procedure they appear in but then what if your have procedure names same as table names?
    SQL> create or replace procedure test_proc(sal in number) is
      2    cnt number ;
      3  begin
      4    select count(*) into cnt from scott.emp where scott.emp.sal = test_proc.sal ;
      5    dbms_output.put_line('cnt='||cnt) ;
      6  end ;
      7  /
    Procedure created.
    SQL> set serveroutput on
    SQL> exec test_proc(800) ;
    cnt=1
    PL/SQL procedure successfully completed.
    SQL>If you search you can find several posts here itself on naming convention to avoid such issues in first place.

  • Need validation when insert the data through AddAnotherRow  functionality

    hi All,
    i need to validate customer id when i insert the data through AddAnotherRow functionality in AdvancedTable.
    CO:
    if ("AdvanceTabRN".equals(pageContext.getParameter(SOURCE_PARAM)) && ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
    am.insrtCustcondtls();
    AM:(For Inserting the Data based on EO Based VO)
    public void insrtCustcondtls()
    XxcurTradeCustomerDtlsEOVOImpl CrteVO=getXxcurTradeCustomerDtlsEOVO1();
    Number cust_seq=getOADBTransaction().getSequenceValue("customer_id_seq");
    CrteVO.setMaxFetchSize(0);
    Row row=CrteVO.createRow();
    CrteVO.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Here Customer ID is Primary key.
    if customer id is already in the table then i need to throw an exception like customer id is already existing or we need to throw an exception.
    Thanks,
    Mallik.

    Hi Mallik,
    Our doDml() method fires when you try to issue commit if you want to validate data at commit then just add the code in the Entity Object Class as I posted in previous post or if you want to validate records with data at add new Row button then you can follow the following aproach.
    1. create a data base pl/sql function which take the customer id as input and return 1 if the customer already existed or 0 if not existed.
    2. Now we can call this database function at Add new Row button
    i. if it returns 1 then we will throw Exception.
    ii. if it return 0 then we will let the record save in data base.
    The following code will help you.
    private String getCustomerId(OAPageContext pageContext,
    OAWebBean webBean, String customerID) {
    OAApplicationModule am =
    (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction transaction = (OADBTransaction)am.getOADBTransaction();
    String value = null;
    CallableStatement cs = null;
    try {
    String plSqlStatement =
    "begin :1 := nameOfYourFunction(" + customerID +
    "); end;";
    System.out.println(plSqlStatement);
    cs = transaction.createCallableStatement(plSqlStatement, 0);
    System.out.println("got executed");
    cs.registerOutParameter(1, Types.CHAR);
    cs.executeUpdate();
    value = cs.getString(1).toString();
    return value;
    } catch (Exception e) {
    e.printStackTrace();
    return value;
    Finally you can call this method as follow
    if ("AdvanceTabRN".equals(pageContext.getParameter(SOURCE_PARAM)) && ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
    String custID;
    am.insrtCustcondtls();
    custID=getCustomerId(pageContext,webBean,customerID)
    if(custID.equals("1")) {
    throw new OAException("Your message");
    Now its up to you which aproach you follow.
    Haroon.

  • Problem in accessing the database through VPN

    I am having problem connecting to the database through VPN but it is working perfectly fine if i connect to the network directly.
    It would be really great if you could help me to resolve this issue.
    Thanks

    I am having problem connecting to the database through VPN but it is working perfectly fine if i connect to the network directly.Fix the VPN problem.
    Check the logfiles.
    For better advice provide any meaningful detail.
    If I do not poke myself in the eye, it does not hurt.
    Tell me to to stop feeling pain.

  • Insert the image through form in brief with example

    Dear Friends,
    i want to insert the image through Oracle forms
    which built-ins are used for that
    i have to store the image and retrieve the stored image also
    If any one have already created form then mail me at [email protected]
    thanks
    yours truly
    Rahul

    Hi Rahul,
    The following two built-ins are used to insert and retrieve the stored images
    write_image_file
    read_image_file

  • We are on holiday in Mexico. Our iPad has no problem connecting to the Internet through a subscription WiFi network. But, both of our laptops can not with the same password. What can we try?

    We are on holiday in Mexico. Our iPad2 has no problem connecting to the Internet through our hotel's subscription WiFi network. But, both of our macbookpros can not with the same password. What can we try?
    We can join the network, but can not access the Internet. The password is correct. We have tried network assistant and diagnostics, restarting the laptops, re-joining the network. Our iPhone 4s also works all the time.
    Same location. Signal strength is good.

    Since I couldn't figure out a way to edit our original post, here's another potential clue.
    Our laptops, when in System Preferences>Network, say "WiFi has the self-assigned IP address of XXXXXXXXX and will not be able to connect to the Internet".
    Strangely, my six year old MBP running OS 10.6.8 accessed the Internet straight away, just by opening Safari to my home page. My wife's six month old MBP running OS 10.7.2 could not.

  • Reading values from lookup columns through custom workflow in SharePoint 2013

    We are able to read the values of text, number columns through custom workflow (via coding) in SharePoint 2013. However, we are not able to read values from lookup columns. So, request anyone to provide help on this.
    Thanks & regards,
    Aditya

    Hi,
    According to your post, my understanding is that you want to read values from lookup columns through custom workflow in SharePoint 2013.
    Since the workflow just doesn't get lookup fields, let's give it something static to work with instead. If we can capture the ID of the lookup field and store that as a static value in our list, the workflow can happily use that to look up our related.
    For more information, you can refer to:
    SharePoint 2013 Workflows and Lookup Columns
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Improve the performance in stored procedure using sql server 2008 - esp where clause in very big table - Urgent

    Hi,
    I am looking for inputs in tuning stored procedure using sql server 2008. l am new to performance tuning in sql,plsql and oracle. currently facing issue in stored procedure - need to increase the performance by code optmization/filtering the records using where clause in larger table., the requirement is Stored procedure generate Audit Report which is accessed by approx. 10 Admin Users typically 2-3 times a day by each Admin users.
    It has got CTE ( common table expression ) which is referred 2  time within SP. This CTE is very big and fetches records from several tables without where clause. This causes several records to be fetched from DB and then needed processing. This stored procedure is running in pre prod server which has 6gb of memory and built on virtual server and the same proc ran good in prod server which has 64gb of ram with physical server (40sec). and the execution time in pre prod is 1min 9seconds which needs to be reduced upto 10secs or so will be the solution. and also the exec time differs from time to time. sometimes it is 50sec and sometimes 1min 9seconds..
    Pl provide what is the best option/practise to use where clause to filter the records and tool to be used to tune the procedure like execution plan, sql profiler?? I am using toad for sqlserver 5.7. Here I see execution plan tab available while running the SP. but when i run it throws an error. Pl help and provide inputs.
    Thanks,
    Viji

    You've asked a SQL Server question in an Oracle forum.  I'm expecting that this will get locked momentarily when a moderator drops by.
    Microsoft has its own forums for SQL Server, you'll have more luck over there.  When you do go there, however, you'll almost certainly get more help if you can pare down the problem (or at least better explain what your code is doing).  Very few people want to read hundreds of lines of code, guess what's it's supposed to do, guess what is slow, and then guess at how to improve things.  Posting query plans, the results of profiling, cutting out any code that is unnecessary to the performance problem, etc. will get you much better answers.
    Justin

  • Failed to retrieve all the results. Try running the query or stored procedure again

    I have a Product table in Azure SQL Database. I can't open data in Product table. I got an error message like this.."Failed to retrieve all the results. Try running the query or stored procedure again". In my Database
    all tables showing their data expect Product table. Please let me know why only Product table showing error message. Thanks in Advance.

    Hi,
    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience
    As this requires an expert advice, I suggest you to open a support case and our experts would be able to assist you further.
    http://support2.microsoft.com/common/international.aspx?RDPATH=%2fdefault.aspx%3fid%3dfh%253ben-us%253bofferprophone
    Girish Prajwal

  • Problem while inserting the same value on a primary key column

    hi all ,
    in my application there is a block with a pat_id column "primary key" ,
    if the user inserts the same value in this column , a message appears asking me if i want to save the changes or not ,
    i do not know what changes is the message asking about , and sure i do not want this message to appear to the user
    when he insert the same values by mistake ?
    thanks

    as a primary key field dont fill this with manually try use db seq.
    Use pre-insert trigger .

  • EJB3 problem in inserting the data to the database, editing

    the code below i have written to view the data but unable to insert the data and edit the data plz help me out how to write and wat is the logic
    package com.fms.fins.ref.ejb;
    import java.util.Collection;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless
    public class SLawBean implements ILaw{
         @PersistenceContext(unitName="fins-entity") EntityManager em;
         public List searchLaw()
              List ss = em.createQuery("from Law eLaw").getResultList();
              return ss;
         public Collection addLaw(){
              Collection cc=em.createQuery("into Law cLaw")
              .setParameter(0, "cLaw.LAW_ID")
              .setParameter(0, "cLaw.LAW_DESCRIPTION")
              .getResultList();
              return cc;
    package com.fms.fins.par;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratorType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    @Entity
    @Table(name="LAW")
    public class Law {
         private String lawId;
         private String lawDescription;
         public Law(){}
         @Id(generate=GeneratorType.AUTO)
         @Column(name="law_id")
         public String getLawId(){
              return lawId;
         public void setLawId(String lawId){
              this.lawId = lawId;
         @Column(name="law_description")
         public String getLawDescription(){
              return lawDescription;
         public void setLawDescription(String lawDescription){
              this.lawDescription = lawDescription;
    package com.fms.fins.ref.web;
    //import java.util.Iterator;
    import java.util.Collection;
    import java.util.List;
    //import javax.faces.component.html.HtmlCommandButton;
    import com.fms.base.util.EjbLoader;
    import com.fms.fins.par.Law;
    import com.fms.fins.ref.ejb.ILaw;
    public class LawBean extends Law{
         //private HtmlCommandButton commandButton1;
         //private HtmlCommandButton commandButton2;
         //private HtmlCommandButton commandButton3;
         private List elawList;
         public List getElawList() {
              return elawList;
         public void setElawList(List elawList) {
              this.elawList = elawList;
         public String actionViewlaw() throws Exception {
              try{
                   EjbLoader ejbLoader = new EjbLoader();
                   ILaw ejbILaw = (ILaw)ejbLoader.getEjb(ILaw.class.getName());
                   1. getElawList(ejbILaw.searchLaw());
                   2. elawList = ejbILaw.searchLaw();
                   elawList = ejbILaw.searchLaw();
              }catch(Exception ex){
                   ex.printStackTrace();
                   //throw ex;
              return "viewlaw";
         private Collection clawList;
         public Collection getClawList() {
              return clawList;
         public void setClawList(Collection clawList) {
              this.clawList = clawList;
         public String actionAddLaw()throws Exception{
              try{
                   EjbLoader ejbLoader = new EjbLoader();
                   ILaw ejbILaw = (ILaw)ejbLoader.getEjb(ILaw.class.getName());
                   clawList=ejbILaw.addLaw();
              }catch(Exception e){
                   e.printStackTrace();
              return "addlaw";
          }

    Hi Vengal !
    What is your module configuration in comm channel ??
    what is your current result and the expected one.
    Regards,
    Matias.

  • Problem faced when the column is moved in Jtable

    Say , in a JTable 3 columns are present. the cells under the 2nd column is editable and 3rd is not editable. when i move the rd column to the second column position, the cells which were under second column becomes non editable. How to overcome this??

    when i move the rd column to the second column position, the cells which
    were under second column becomes non editable.Why do they become non editable?
    If I understand correctly when you call a TableModel's isCellEditable(int
    rowIndex, int columnIndex) the columnIndex argument has nothing to
    do with with where on the displayed JTable the column is being displayed.

  • How to insert parameter value into multiple columns and rows

    Hi All,
    I have one procedure insert_tab and I am passing
    100~101~102:103~104~105:106~107~108 as a parameter to that procedure. I wanted to insert each numeric value into one column. The output of the table should contain
    Table:
    Col1 Col2 Col3
    100 101 102
    103 104 105
    106 107 108
    Awaiting for your reply..

    That's not more clear for me...
    Anyway, if you really want a procedure for that, try :
    SQL> create table tblstr (col1 number,col2 number,col3 number);
    Table created.
    SQL>
    SQL> create or replace procedure insert_fct (p_string IN varchar2)
      2  as
      3  v_string     varchar2(4000):=p_string||':';
      4  v_substring  varchar2(4000);
      5 
      6  begin
      7      while instr(v_string,':') > 0 loop
      8            v_substring := substr(v_string,1,instr(v_string,':')-1)||'~';
      9            insert into tblstr(col1,col2,col3)
    10            values (substr(v_substring,1,instr(v_substring,'~',1,1)-1),
    11                    substr(v_substring,instr(v_substring,'~',1,1)+1,instr(v_substring,'~',1,2)-instr(v_substring,'~',1,1)-1),
    12                    substr(v_substring,instr(v_substring,'~',1,2)+1,instr(v_substring,'~',1,3)-instr(v_substring,'~',1,2)-1));
    13            v_string:=substr(v_string,instr(v_string,':')+1);
    14      end loop;
    15  end;
    16  /
    Procedure created.
    SQL>
    SQL> show err
    No errors.
    SQL>
    SQL> select * from tblstr;
    no rows selected
    SQL> exec insert_fct('100~101~102:103~104~105:106~107~108')
    PL/SQL procedure successfully completed.
    SQL> select * from tblstr;
          COL1       COL2       COL3
           100        101        102
           103        104        105
           106        107        108
    SQL> exec insert_fct('109~~')
    PL/SQL procedure successfully completed.
    SQL> exec insert_fct('~110~')
    PL/SQL procedure successfully completed.
    SQL> exec insert_fct('~~111')
    PL/SQL procedure successfully completed.
    SQL> select * from tblstr;
          COL1       COL2       COL3
           100        101        102
           103        104        105
           106        107        108
           109
                      110
                                 111
    6 rows selected.
    SQL> Nicolas.

Maybe you are looking for

  • Maximum File size on DMP

    Hello, Is there a maximum file size that DMP 4400G can support. We are trying to upload a 7GB MPEG file to the DMP with an attached 16Gb USB flash drive. However, it fails when it reaches 56% with an FTP error: ( "Unable to write data to the transpor

  • Searching for a particular file

    Hi I know the file name is odbc.ini and i know the drive name is c: And how do i get the path of the file through program. Thanx in advance. Subhas

  • Alternative of COLLATE Keyword in Oracle

    I have to convert sql server code in oracle .. wt i can use intead of COLLATE IN oracle .. is in alternative is there in oracle

  • Need to revert back to copper service

    Anyone know how to get Verizon to revert back from FIOS to standard copper service? I have tried for 2 months and customer service either processes incorrect info or promises to fulfill request, but nothing has been done.  Last cust. service person I

  • Strange error transferring songs to my Zen X

    I have a 40GB Nomad Zen Xtra, with firmware .20.08. Anyway, I can transfer my music just fine most of the time, but occasionally I get a strange error for some of the music, sometimes it can even be for a whole album. The error says,"Error: Unable to