Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data type mismatch when inserting data into table.

Status
Not open for further replies.

Niki_S

Programmer
Jun 4, 2021
232
LK
I have a cursor as tempBatchSibNew and I created a table and now I want to insert some records into my table. For that I did my code like this.
Code:
CREATE TABLE C:\TEMPFILES\Grn_qty (nPoDtlID n(15),cGrnNO c(15),CwhRatio c(15),cDocType c(15),cDocNo c(15),nTrnsQty n(15),nGrnQtyVal n(10,2))


	SELECT tempBatchSibNew
	SCAN
		INSERT INTO C:\TEMPFILES\Grn_qty (nPoDtlID,cGrnNO,CwhRatio) ;
		 VALUES (tempBatchSibNew.nPoDtlID,tempBatchSibNew.cGrnNO,tempBatchSibNew.CwhRatio)
	ENDSCAN 

	SELECT tempBatchTransDt
	SCAN 
		UPDATE C:\TEMPFILES\Grn_qty SET nTrnsQty=tempBatchTransDt.nTrnsQty,nGrnQtyVal=GrnQtyVal  WHERE nPoDtlID=tempBatchSibNew.nPoDtlID 
	ENDSCAN
When I run my code it says Data type mismatch. What is the mistake in my code?
Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top