Skip to content

Incorrect SQL Syntax - Unclosed quotation mark after the character string #51

Description

@huaguoping

Hi, everyone.
I encountered a strange problem.When I run the same code on test platform using the same conf, it work well. Once I run the same code on production platform, I got the following error:

General SQL Server error: Check messages from the SQL Server

Msg 170, Level 15
General SQL Server error: Check messages from the SQL Server

Msg 105, Level 15, State 1
Server 'SERVER', Line 24
        Unclosed quotation mark before the character string '<E5><90>?'.

Msg 170, Level 15, State 1
Server 'SERVER', Line 24
        Line 24: Incorrect syntax near '<E5><90>?'.

My code is :

_, err := db.Exec(`
		INSERT INTO Table (
			field1
			, field2
			, field3
			, field4
			, field5
			, field6
			, field7
			, field8
			, field9) 
			VALUES (
				?
				,?
				,?
				,?
				,?
				,?
				,?
				,?
				,?)`, info.TopMarketId, Info.MarketId, Info.GoodsId, Info.GoodsAttribute, Info.TrackDate, Info.Value, Info.TimeCreated, Info.TimeLastUpdated, Info.Type)
	if err != nil {
		log.Println("DB Exec failed: ", err.Error())
		return err
	}

Anyone can help?Thank you very much : )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions