problem wif my insert statement

  • could some check whats wrong wif my insert statement??

    INSERT INTO Photovoltaic

    (PV_site, PV_state, PV_type_of_system, PV_nominal_power, PV_module, PV_mounting,

    PV_building_type, PV_topology, PV_new_of_retrofit, PV_peroid_of_design, PV_period_of_construction,

    PV_commissioning_date, PV_site_photo, PV_peak_nominal_rating, PV_normalized_monthly_yield,

    PV_normalized_monthly_energy_yield, User_application_id, Org_application_id)

    SELECT 'rew', 'gdfgd','gdfg', 34.4, 'rew', 'gdfgd','gdfg', 'gdfg', 'rew', 'gdfgd','gdfg', GETDATE(),

    BulkColumn FROM OPENROWSET(Bulk 'C:\Inetpub\wwwroot\PVMS\images\uitm2.png', SINGLE_BLOB) AS BLOB, 43.3, 323.3, 33.4,

    '80e4020b-3661-4c26-b658-a7d12dfbf68d', '6aeb3ad8-40a6-4509-8844-2c7925121294'

    i got this error ...

    Incorrect syntax near '43.3'.

    someone assist me??

  • Encapsulate it into an extra select statement:

    INSERT INTO Photovoltaic

    ( PV_site

    , PV_state

    , PV_type_of_system

    , PV_nominal_power

    , PV_module

    , PV_mounting

    , PV_building_type

    , PV_topology

    , PV_new_of_retrofit

    , PV_peroid_of_design

    , PV_period_of_construction

    , PV_commissioning_date

    , PV_site_photo

    , PV_peak_nominal_rating

    , PV_normalized_monthly_yield

    , PV_normalized_monthly_energy_yield

    , User_application_id

    , Org_application_id

    )

    SELECT 'rew'

    , 'gdfgd'

    , 'gdfg'

    , 34.4

    , 'rew'

    , 'gdfgd'

    , 'gdfg'

    , 'gdfg'

    , 'rew'

    , 'gdfgd'

    , 'gdfg'

    , GETDATE()

    , ( SELECT BulkColumn

    FROM OPENROWSET(Bulk 'C:\Inetpub\wwwroot\PVMS\images\uitm2.png',

    SINGLE_BLOB) AS BLOB

    )

    , 43.3

    , 323.3

    , 33.4

    , '80e4020b-3661-4c26-b658-a7d12dfbf68d'

    , '6aeb3ad8-40a6-4509-8844-2c7925121294'

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply