0

这是我想继续到下一行的 SQL 语句,但它在 value 子句中显示错误,我实际上想将语句分成多行

sqlstr = "insert into       pos_invoice_hdr(invoice_no, loc_code, invoce_type, invoice_date, cust_code, gross_amt, disc_percent, net_amt, doctor_code, loose_qty, pkt_qty, remarks, ccy, card_no, card_type, invoice_by) _"
    "values("@invoice_no, @loc_code, @invoice_type, @invoice_Date, @cust_code, @gross_amt, @disc_percent, @net")"
4

2 回答 2

0

您的语句的输入参数比表格预期的要少。

16个领域...

(invoice_no, 
 loc_code, 
 invoce_type, 
 invoice_date, 
 cust_code, 
 gross_amt, 
 disc_percent, 
 net_amt, 
 doctor_code, 
 loose_qty, 
 pkt_qty, 
 remarks, 
 ccy, 
 card_no, 
 card_type, 
 invoice_by) _"
values

8个值...

("@invoice_no, 
@loc_code, 
@invoice_type,
@invoice_Date, 
@cust_code, 
@gross_amt,
@disc_percent,
@net")"

您要么需要删除以下字段..

doctor_code, 
     loose_qty, 
     pkt_qty, 
     remarks, 
     ccy, 
     card_no, 
     card_type, 
     invoice_by

或添加更多值。

于 2013-11-10T14:43:13.450 回答
0

你试过这样的事情吗?

sqlstr = "insert into pos_invoice_hdr(invoice_no, loc_code, invoce_type,   invoice_date, cust_code, gross_amt, disc_percent, net_amt, doctor_code, loose_qty, pkt_qty,  remarks, ccy, card_no, card_type, invoice_by)" & _
     "values(@invoice_no, @loc_code, @invoice_type, @invoice_Date, @cust_code,   @gross_amt, @disc_percent, @net)"

就像是

 Dim str as string 
       str = "first string" & _
           "second string"
于 2013-12-06T01:16:26.923 回答