473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error in Insert from excel sheet

112 100+
Hi All,
when i am trying to insert records from excel sheet to wko table in my database. My Excel sheet contains 400 records. I am getting the error message. please check this code and advise me.


INSERT [dbo].[wko]([wko_workorderid], [wko_itemid],[wko_origstartdate], [wko_startdate],
[wko_origrequireddate], [wKO_requireddate],[wko_routusedflag], [wko_barcodeprintflag],
[wko_printflag], [wko_backflushflag],[wko_fwdschedflag], [wko_wIPInspflag], [wko_startqty],
[wko_origstartqty],[wko_requiredqty], [Wko_origrequiredqty], [wko_scrapqty], [wko_scrapamt],
[wko_rejectqty], [wko_rejectamt], [wko_completeqty], [wko_statuscode], [wko_workordertypecode],
[wko_lastsplitnbr], [wko_actualsetupamt],[wko_actuallabamt], [wko_actualmatlamt], [wko_actualoutplantamt],
[wko_actualvarburdamt],[wko_actualfixburdamt], [wko_actualmatlburdamt],[wko_stdlabamt],
[wko_stdoutplantamt], [wko_stdvarburdamt],[wko_stdfixburdamt],[wko_stdmatlburdamt], [wko_estlabamt],
[wko_estoutplantamt], [wko_estvarburdamt], [wko_estfixburdamt], [wko_estmatlburdamt],
[wko_closedlabamt], [wko_closedmatlamt], [wko_closedoutplantamt],[wko_closedvarburdamt],
[wko_closedfixburdamt], [wko_closedmatlburdamt],[wko_issueovershort],[wko_backflushoperationseq],
[wko_backflushlabor],[wko_labcostpluspercent], [wko_matlcostpluspercent])
SELECT [wko_workorderid], [wko_itemid],[wko_origstartdate], [wko_startdate],
[wko_origrequireddate], [wKO_requireddate],[wko_routusedflag], [wko_barcodeprintflag],
[wko_printflag], [wko_backflushflag],[wko_fwdschedflag], [wko_wIPInspflag], [wko_startqty],
[wko_origstartqty],[wko_requiredqty], [Wko_origrequiredqty], [wko_scrapqty], [wko_scrapamt],
[wko_rejectqty], [wko_rejectamt], [wko_completeqty], [wko_statuscode], [wko_workordertypecode],
[wko_lastsplitnbr], [wko_actualsetupamt],[wko_actuallabamt], [wko_actualmatlamt], [wko_actualoutplantamt],
[wko_actualvarburdamt],[wko_actualfixburdamt], [wko_actualmatlburdamt],[wko_stdlabamt],
[wko_stdoutplantamt], [wko_stdvarburdamt],[wko_stdfixburdamt],[wko_stdmatlburdamt], [wko_estlabamt],
[wko_estoutplantamt], [wko_estvarburdamt], [wko_estfixburdamt], [wko_estmatlburdamt],
[wko_closedlabamt], [wko_closedmatlamt], [wko_closedoutplantamt],[wko_closedvarburdamt],
[wko_closedfixburdamt], [wko_closedmatlburdamt],[wko_issueovershort],[wko_backflushoperationseq],
[wko_backflushlabor],[wko_labcostpluspercent], [wko_matlcostpluspercent]
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Documents and Settings\mohammed\Desktop\test.xls;IMEX=1',
'SELECT * FROM [Sheet1$]') Rowset_1
WHERE (wko_workorderid LIKE N'A%')

I am getting error message like this:
Server: Msg 512, Level 16, State 1, Procedure WKO_ITrig, Line 20
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.


Thanks
Aug 14 '07 #1
0 1473

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
11
by: Hi5 | last post by:
Hi, I am new to access I usedto work in Oracle and Mysql. I am after a way that enables me to populate a database I designed in access with lots of data which can be sorted in excel sheets, ...
4
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine....
0
by: Anish G | last post by:
Hi All, I am getting the below given error while running my application in live server. In my local machine, its working fine. Please help me as it is very urgent for me. Exception from...
1
by: imtmub | last post by:
I have wko(Workorder) table exist in my ERP. Now i have some excel sheet that contains some new workorder(more than1000 Records). Now i need to insert all the records which present in the sheet to...
1
vinci
by: vinci | last post by:
Please help me out... i only have two weeks to do it... here is my code: Dim ex As New Object Dim wb As Excel.Workbook Dim sheet As Excel.Worksheet
14
by: veer | last post by:
can any one help by providing the method inserting the records in excel file because i created it all it works fine but i have no idea about how to insert new records in the existing excel file....
4
by: ielamrani | last post by:
Hi, I am getting this error when I try to export to an excel sheet. When I click on a button to export the first time it's fine, I rename the exported excel sheet and I try to export it again and I...
7
Walt in Decatur
by: Walt in Decatur | last post by:
I'm trying to use this method to copy an range in Excel workbook that is closed to the one that's open. I'm using the following code, which gets the "Can't find installable ISAM" error when I get to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.