Thank you for replying so quickly. I believe I tracked down the cause of the default record being added instead of a populated one. For the cases the work as expected, the SQL script used to get the source table is a simple Select:
Code: Select all
SELECT
"EnImpact"."Index",
"EnImpact"."EnergyImpactID",
"EnImpact"."Version",
"EnImpact"."VersionSrc",
"EnImpact"."LastMod",
"EnImpact"."IOU",
"EnImpact"."BldgType",
"EnImpact"."BldgVint",
"EnImpact"."BldgHVAC",
"EnImpact"."BldgLoc",
"EnImpact"."NormUnit",
"EnImpact"."NumUnits",
"EnImpact"."MeasArea",
"EnImpact"."ScalBasis",
"EnImpact"."ACustEUkWh", "EnImpact"."ACustEUkW", "EnImpact"."ACustEUtherm",
"EnImpact"."ACustWBkWh", "EnImpact"."ACustWBkW", "EnImpact"."ACustWBtherm",
"EnImpact"."AStdWBkWh", "EnImpact"."AStdWBkW", "EnImpact"."AStdWBtherm",
"EnImpact"."AStdEUkWh", "EnImpact"."AStdEUkW", "EnImpact"."AStdEUtherm",
"EnImpact"."ElecImpProfileID", "EnImpact"."GasImpProfileID"
FROM meas."EnImpact"
WHERE "EnImpact"."EnergyImpactID" = 'RE-HV-ResEvapAC-17p4S' AND "EnImpact"."Flag" > 0
ORDER BY "IOU", "BldgType", "BldgVint", "BldgHVAC", "BldgLoc";
The result of an InsertRecord command in this case is:
Code: Select all
INSERT INTO meas."EnImpact"
("Index", "EnergyImpactID", "Version", "VersionSrc", "LastMod", "IOU", "BldgType", "BldgVint", "BldgHVAC", "BldgLoc", "NormUnit", "NumUnits", "MeasArea", "ScalBasis", "ACustEUkWh", "ACustEUkW", "ACustEUtherm", "ACustWBkWh", "ACustWBkW", "ACustWBtherm", "AStdWBkWh", "AStdWBkW", "AStdWBtherm", "AStdEUkWh", "AStdEUkW", "AStdEUtherm", "ElecImpProfileID", "GasImpProfileID")
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28)
But for the cases that write a blank, default record, the SQL script is calculating many of the fields:
Code: Select all
SELECT
"EnImpact"."Index",
"EnImpact"."EnergyImpactID",
"EnImpact"."Version",
"EnImpact"."VersionSrc",
"EnImpact"."LastMod",
"Com-InLtg-Exit"."IOU" as "IOU",
"Com-InLtg-Exit"."BldgType" AS "BldgType",
"Com-InLtg-Exit"."BldgVint" AS "BldgVint",
"Com-InLtg-Exit"."BldgHVAC" AS "BldgHVAC",
"Com-InLtg-Exit"."BldgLoc" AS "BldgLoc",
"EnImpact"."NormUnit",
"EnImpact"."NumUnits",
"EnImpact"."MeasArea",
"EnImpact"."ScalBasis",
("EnImpact"."ACustEUkWh" * 36) AS "ACustEUkWh",
("EnImpact"."ACustEUkW" * 36) AS "ACustEUkW",
("EnImpact"."ACustEUtherm" * 36) AS "ACustEUtherm",
("EnImpact"."ACustEUkWh" * 36 * CAST("kWh/kWh" AS float)) AS "ACustWBkWh",
("EnImpact"."ACustEUkW" * 36 * CAST("kW/kW" AS float)) AS "ACustWBkW",
("EnImpact"."ACustEUkWh" * 36 * CAST("therm/kWh" AS float)) AS "ACustWBtherm",
("EnImpact"."ACustEUkWh" * 10) AS "AStdEUkWh",
("EnImpact"."ACustEUkW" * 10) AS "AStdEUkW",
("EnImpact"."ACustEUtherm" * 10) AS "AStdEUtherm",
("EnImpact"."ACustEUkWh" * 10 * CAST("kWh/kWh" AS float)) AS "AStdWBkWh",
("EnImpact"."ACustEUkW" * 10 * CAST("kW/kW" AS float)) AS "AStdWBkW",
("EnImpact"."ACustEUkWh" * 10 * CAST("therm/kWh" AS float)) AS "AStdWBtherm",
"EnImpact"."ElecImpProfileID", "EnImpact"."GasImpProfileID"
FROM meas."EnImpact"
INNER JOIN ie."Com-InLtg-Exit" on "EnImpact"."BldgType" = "Com-InLtg-Exit"."BldgType" AND "EnImpact"."BldgLoc" = "Com-InLtg-Exit"."BldgLoc" AND "EnImpact"."IOU" = "Com-InLtg-Exit"."IOU"
WHERE "EnImpact"."EnergyImpactID" = 'Com-Iltg-dWatt-IEbase-Exit'
ORDER BY "IOU", "BldgType", "BldgVint", "BldgHVAC", "BldgLoc";
The result of an InsertRecord command is now:
Code: Select all
INSERT INTO meas."EnImpact" DEFAULT VALUES
Perhaps a more informed user would not expect the latter case to work; I can certainly develop a work-around.