firstly I know cursors are bad, but my new boss told me use one, this is why i am new to them!hmmm Forced into Evil haha!
ERROR Msg. 'Missing keyword near select' -I asume its the second select, tried with a semi colon after the from , i tried to use a table Alias and not to use one, still same message about 'Missing keyword near select'
-------------------------------------------
DECLARE Crs_DelosCatSkinner CURSOR
FOR
SELECT
--how to handle in cursor-- '????' AS Program_ID,
A.CertificateNrClean AS Policy_Number,
--how to handle in cursor-- CONVERT(varchar(10),A.TermBegin,101) AS Policy_Effective_Date,
A.CertificateNrClean AS Risk_ID_Location_ID,
--AS CoveCode,
--AS Limit,
--how to handle in cursor--'' AS Deductable,
--how to handle in cursor--'' AS Covered_Cause_Of_Loss,
--how to handle in cursor--'80' AS [Co-Insurance_Factor],
A.ProgramCode, A.CovI, A.PremiumI, A.CovII, A.PremiumII, A.CovIV, A.CovOptOtherStructures, A.CovIII_LU,
A.CovOptLossOfUse,A.CovEPersonalLiability, A.CovOptPersonalLiability, A.CovFMedPay, A.CovOptMedPay,
A.CovReplacementCostStructures, A.CovOptReplacementCostStructures, A.CovReplacementCostContents,
A.CovOptReplacementCostContents, A.CovPersonalInjury, A.CovOptPersonalInjury, A.CovAnimalLiability,
A.CovOptAnimalLiability, A.CovOrdinanceLaw, A.CovOptOrdinanceLaw, A.CovOptWaterBackUp,
A.CovLossAssessment_NonHO6, A.CovOptLossAssessment, A.CovWaterDamage, A.CovOptWaterDamage
FROM APLICATION AS A
FOR SELECT --<OPEN Crs_DelosCatSkinner
OPEN Crs_DelosCatSkinner-- the servercentral did not include this,i think se equivoquO ->OPEN Crs_DelosCatSkinner
DECLARE
@CertificateNrCleanForPolicy_Number VARCHAR(14) ,
@CertificateNrCleanForRisk_ID_Location_ID VARCHAR(14),
@ProgramCode VARCHAR(2), @CovI MONEY, @PremiumI MONEY, @CovII MONEY, @PremiumII MONEY, @CovIV MONEY, @CovOptOtherStructures MONEY, @CovIII_LU MONEY,
@CovOptLossOfUse MONEY,@CovEPersonalLiability MONEY, @CovOptPersonalLiability MONEY, @CovFMedPay MONEY, @CovOptMedPay MONEY,
@CovReplacementCostStructures INT, @CovOptReplacementCostStructures MONEY, @CovReplacementCostContents BIT,
@CovOptReplacementCostContents MONEY, @CovPersonalInjury BIT, @CovOptPersonalInjury MONEY, @CovAnimalLiability INT,
@CovOptAnimalLiability MONEY, @CovOrdinanceLaw DECIMAL(9,6), @CovOptOrdinanceLaw MONEY,@CovWaterBackUp INT,@CovOptWaterBackUp MONEY,
@CovLossAssessment_NonHO6 MONEY, @CovOptLossAssessment MONEY, @CovWaterDamage MONEY, @CovOptWaterDamage MONEY
FETCH NEXT FROM Crs_DelosCatSkinner INTO
@CertificateNrCleanForPolicy_Number,
@CertificateNrCleanForRisk_ID_Location_ID,
@ProgramCode, @CovI, @PremiumI, @CovII, @PremiumII, @CovIV, @CovOptOtherStructures, @CovIII_LU,
@CovOptLossOfUse,@CovEPersonalLiability, @CovOptPersonalLiability, @CovFMedPay, @CovOptMedPay,
@CovReplacementCostStructures, @CovOptReplacementCostStructures, @CovReplacementCostContents,
@CovOptReplacementCostContents, @CovPersonalInjury, @CovOptPersonalInjury, @CovAnimalLiability,
@CovOptAnimalLiability, @CovOrdinanceLaw, @CovOptOrdinanceLaw, @CovOptWaterBackUp,
@CovLossAssessment_NonHO6, @CovOptLossAssessment, @CovWaterDamage, @CovOptWaterDamage
WHILE FETCH_STATUS = 0 BEGIN
SELECT--CT
@CertificateNrCleanForPolicy_Number,
@CertificateNrCleanForRisk_ID_Location_ID,
@ProgramCode, @CovI, @PremiumI, @CovII, @PremiumII, @CovIV, @CovOptOtherStructures, @CovIII_LU,
@CovOptLossOfUse, @CovEPersonalLiability, @CovOptPersonalLiability, @CovFMedPay, @CovOptMedPay,
@CovReplacementCostStructures, @CovOptReplacementCostStructures, @CovReplacementCostContents,
@CovOptReplacementCostContents, @CovPersonalInjury, @CovOptPersonalInjury, @CovAnimalLiability,
@CovOptAnimalLiability, @CovOrdinanceLaw, @CovOptOrdinanceLaw, @CovOptWaterBackUp,
@CovLossAssessment_NonHO6, @CovOptLossAssessment, @CovWaterDamage, @CovOptWaterDamage
FROM vwApplication AS A
ERROR Msg. 'Missing keyword near select' -I asume its the second select, tried with a semi colon after the from , i tried to use a table Alias and not to use one, still same message about 'Missing keyword near select'
-------------------------------------------
DECLARE Crs_DelosCatSkinner CURSOR
FOR
SELECT
--how to handle in cursor-- '????' AS Program_ID,
A.CertificateNrClean AS Policy_Number,
--how to handle in cursor-- CONVERT(varchar(10),A.TermBegin,101) AS Policy_Effective_Date,
A.CertificateNrClean AS Risk_ID_Location_ID,
--AS CoveCode,
--AS Limit,
--how to handle in cursor--'' AS Deductable,
--how to handle in cursor--'' AS Covered_Cause_Of_Loss,
--how to handle in cursor--'80' AS [Co-Insurance_Factor],
A.ProgramCode, A.CovI, A.PremiumI, A.CovII, A.PremiumII, A.CovIV, A.CovOptOtherStructures, A.CovIII_LU,
A.CovOptLossOfUse,A.CovEPersonalLiability, A.CovOptPersonalLiability, A.CovFMedPay, A.CovOptMedPay,
A.CovReplacementCostStructures, A.CovOptReplacementCostStructures, A.CovReplacementCostContents,
A.CovOptReplacementCostContents, A.CovPersonalInjury, A.CovOptPersonalInjury, A.CovAnimalLiability,
A.CovOptAnimalLiability, A.CovOrdinanceLaw, A.CovOptOrdinanceLaw, A.CovOptWaterBackUp,
A.CovLossAssessment_NonHO6, A.CovOptLossAssessment, A.CovWaterDamage, A.CovOptWaterDamage
FROM APLICATION AS A
FOR SELECT --<OPEN Crs_DelosCatSkinner
OPEN Crs_DelosCatSkinner-- the servercentral did not include this,i think se equivoquO ->OPEN Crs_DelosCatSkinner
DECLARE
@CertificateNrCleanForPolicy_Number VARCHAR(14) ,
@CertificateNrCleanForRisk_ID_Location_ID VARCHAR(14),
@ProgramCode VARCHAR(2), @CovI MONEY, @PremiumI MONEY, @CovII MONEY, @PremiumII MONEY, @CovIV MONEY, @CovOptOtherStructures MONEY, @CovIII_LU MONEY,
@CovOptLossOfUse MONEY,@CovEPersonalLiability MONEY, @CovOptPersonalLiability MONEY, @CovFMedPay MONEY, @CovOptMedPay MONEY,
@CovReplacementCostStructures INT, @CovOptReplacementCostStructures MONEY, @CovReplacementCostContents BIT,
@CovOptReplacementCostContents MONEY, @CovPersonalInjury BIT, @CovOptPersonalInjury MONEY, @CovAnimalLiability INT,
@CovOptAnimalLiability MONEY, @CovOrdinanceLaw DECIMAL(9,6), @CovOptOrdinanceLaw MONEY,@CovWaterBackUp INT,@CovOptWaterBackUp MONEY,
@CovLossAssessment_NonHO6 MONEY, @CovOptLossAssessment MONEY, @CovWaterDamage MONEY, @CovOptWaterDamage MONEY
FETCH NEXT FROM Crs_DelosCatSkinner INTO
@CertificateNrCleanForPolicy_Number,
@CertificateNrCleanForRisk_ID_Location_ID,
@ProgramCode, @CovI, @PremiumI, @CovII, @PremiumII, @CovIV, @CovOptOtherStructures, @CovIII_LU,
@CovOptLossOfUse,@CovEPersonalLiability, @CovOptPersonalLiability, @CovFMedPay, @CovOptMedPay,
@CovReplacementCostStructures, @CovOptReplacementCostStructures, @CovReplacementCostContents,
@CovOptReplacementCostContents, @CovPersonalInjury, @CovOptPersonalInjury, @CovAnimalLiability,
@CovOptAnimalLiability, @CovOrdinanceLaw, @CovOptOrdinanceLaw, @CovOptWaterBackUp,
@CovLossAssessment_NonHO6, @CovOptLossAssessment, @CovWaterDamage, @CovOptWaterDamage
WHILE FETCH_STATUS = 0 BEGIN
SELECT--CT
@CertificateNrCleanForPolicy_Number,
@CertificateNrCleanForRisk_ID_Location_ID,
@ProgramCode, @CovI, @PremiumI, @CovII, @PremiumII, @CovIV, @CovOptOtherStructures, @CovIII_LU,
@CovOptLossOfUse, @CovEPersonalLiability, @CovOptPersonalLiability, @CovFMedPay, @CovOptMedPay,
@CovReplacementCostStructures, @CovOptReplacementCostStructures, @CovReplacementCostContents,
@CovOptReplacementCostContents, @CovPersonalInjury, @CovOptPersonalInjury, @CovAnimalLiability,
@CovOptAnimalLiability, @CovOrdinanceLaw, @CovOptOrdinanceLaw, @CovOptWaterBackUp,
@CovLossAssessment_NonHO6, @CovOptLossAssessment, @CovWaterDamage, @CovOptWaterDamage
FROM vwApplication AS A