I have the following ASP code below which is used within a import from a .csv file. I am getting the error on line
rs_add_pg_asset_attr("level_3_integer_attribute_description") = rs_get_costs("sp_import_pg_attribute_value")
I'm guessing the code is trying to set 2 columns in two different recordsets to be equal to the same thing? Correct me if I'm wrong. The data in level_3_integer_attribute_description
is type decimal(13,3), NULL
and the data in sp_import_pg_attribute_value
is a whole range of different values type varchar(255), NULL
I cannot work out why this is failing!!! Please help!
str_get_pg_attribute_id_sql = "SELECT * FROM tbl_level_3_cbs_attribute WHERE level_3_cbs_attribute_description = '" & rs_get_costs("sp_import_pg_attribute") & "'"
str_get_pg_attribute_id_sql = str_get_pg_attribute_id_sql & " AND level_3_cbs_id = " & int_level_3_id
rs_get_pg_attribute_id.Open str_get_pg_attribute_id_sql, dbConnection, 3
if rs_get_pg_attribute_id.RecordCount <> 0 then
''//Does the attribute already exist?
str_get_pg_attribute_sql = "SELECT * FROM tbl_asset_level_3_attribute_link WHERE "
str_get_pg_attribute_sql = str_get_pg_attribute_sql & "level_3_cbs_attribute_id = " & rs_get_pg_attribute_id("level_3_cbs_attribute_id") & " AND asset_level_3_id = " & int_pg_asset_id
rs_get_pg_attribute.Open str_get_pg_attribute_sql, dbConnection, 3
if rs_get_pg_attribute.RecordCount = 0 then
''//No, add the attribute record
sqlString="select top 1 * from tbl_asset_level_3_attribute_link"
rs_add_pg_asset_attr.Open sqlString, dbConnection, adOpenKeyset, adLockOptimistic
rs_add_pg_asset_attr.AddNew
rs_add_pg_asset_attr("level_3_cbs_attribute_id") = rs_get_pg_attribute_id("level_3_cbs_attribute_id")
rs_add_pg_asset_attr("asset_level_3_id") = int_pg_asset_id
if rs_get_pg_attribute_id("level_3_cbs_attribute_type") = "I" then
rs_add_pg_asset_attr("level_3_integer_attribute_description") = rs_get_costs("sp_import_pg_attribute_value")
else
rs_add_pg_asset_attr("level_3_string_attribute_description") = rs_get_costs("sp_import_pg_attribute_value")
end if