-
Apr 20th, 2012, 12:43 AM
#1
Thread Starter
Fanatic Member
Error in Sql Statement
Hi
sql = "insert into [#m_temp] (cust_id,invoice_no,invoice_date,padi_no,wo_no,po_no,itype,uom,amount,icode,idesc,make,model,capacit y) select t0.cust_id,t0.invoice_no,t0.invoice_dt,t0.padi_no,'','','',t1.uom,t1.amount,t1.icode,t2.idesc,t2.mak e,t2.model,t2.capacity from salesinvoice t0 inner join padi_det t1 on t0.padi_no = t1.padi_no inner join itemmaster t2 on t1.icode = t2.icode"
cnn1.Execute sql
Thanks
-
Apr 20th, 2012, 12:59 AM
#2
Re: Error in Sql Statement
1. 'capacit y' is syntatically incorrect
2. ,","," is also syntactically incorrect
-
Apr 20th, 2012, 01:11 AM
#3
Thread Starter
Fanatic Member
Re: Error in Sql Statement
Hi
Actually it's giving me error when i write second inner join statement i.e inner join itemmaster t2 on t1.icode = t2.icode
Thanks
-
Apr 20th, 2012, 07:33 AM
#4
Re: Error in Sql Statement
1) this is a database issue, should be in the database area - I've asked the mods to move it.
2)As far as I can tell, the space in "capacit y" could be an issue.... the '','','', is actually syntatically correct, provided they are single quote marks in succession indicating an empty string.
3)Perhaps it would be beneficial to the rest of us trying to help you if you were to post the error message you're getting. Otherwise we're left to guess at the problem, and can only assume that either your fingers fell off, or the wheels on your car fell off. In any event, all I can offer is for you to remove the eels from your hovercraft.
-tg
edit - one more thing... you may want to pull that select portion and run it by itself in SSMS/QueryAnalyzer/QueryBuilder (since you didn't indicate WHAT database you're using, again, we're left ot guess) and make sure it runs... I see other spaces in the middle of words besides "capacit y" ....
-
Apr 20th, 2012, 07:48 AM
#5
Re: Error in Sql Statement
Thread moved to the 'Database Development' forum - which is where you should always post SQL related questions (while SQL can be used in VB, it is certainly not specific to VB)
Thanks for letting us know folks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|