|
-
Jan 25th, 2010, 08:43 PM
#1
Thread Starter
Addicted Member
Unknown Column 'LastTransType' in 'fieldlist'
i am using mysql community in my dummy server and i'm using enterprise in my live server. i'm using vb.net 2003 in my application. my problem is during insertion of data to my dummy server, it saved successfully while in my live server i encountered this error "Unknown column 'LastTransType' in 'fieldlist'". they have the same database structure because i just copy my database from my dummy server to my live server.
Thanks in advance!
Here's my query:
Code:
SqlDetails = "Insert into tbl_rarenewaldetails (RaNumber,Ptn,OrNumber,Tin,BranchName," & _
" BranchAdd,Transdate,CustName,CustAdd,CorpName,Interest,I_Pct,Ld,Sc,ME,LoyaltyDiscount,TransAmt," & _
" PTNPrincipal,NetProceed,OwnEmployee,CustLastname,CustFirstname," & _
" CustMiddleInitial,LoanDate,MaturityDate,ExpiryDate,OwnTelNo,CustTelNO,CustGender," & _
" AI_amt,AI_Pct,StorageCode,Transtype,OwnManager,ReqCostCenter,OwnCostCenter,ReqBranchName,LastTransaction,LastTransDate)" & _
" VALUES('" & FinalRAN & "','" & Local_Ptn & "','" & Local_Ornumber & "'," & _
" '" & Local_Tin & "','" & Trim(Replace(Local_BranchName, "'", "''")) & "'," & _
" '" & Trim(Replace(Local_BranchAdd, "'", "''")) & "','" & Format(xTrandate, "yyyy-MM-dd hh:mm:ss") & "','" & Local_CustName & "','" & Replace(Local_CustAdd, "'", "''") & "'," & _
" '" & Replace(jCorpName, "'", "''") & "','" & IValue & "','" & oldPT_Tran.I_PCT & "','" & LDValue & "'," & _
" '" & oldPT_Tran.SC_Value & "','" & mvalue & "','" & discountIvalue & "','" & TransactionAmt & "','" & oldPT_Tran.PTNPrincipal & "','" & NetProceeds & "'," & _
" '" & Trim(txtEmployee.Text) & "','" & Trim(oldPT_Tran.CustLastName) & "','" & Trim(oldPT_Tran.CustFirstName) & "'," & _
" '" & oldPT_Tran.CustMiddleInitial & "','" & Format(oldPT_Tran.LoanDate, "yyyy-MM-dd hh:mm:ss") & "'," & _
" '" & Format(GetMaturity(BranchServerDate), "yyyy-MM-dd hh:mm:ss") & "','" & Format(GetExpiry(BranchServerDate), "yyyy-MM-dd hh:mm:ss") & "'," & _
" '" & Local_TelNo & "','" & Cust_TelNo & "','" & oldPT_Tran.CustGender & "'," & _
" '" & oldPT_Tran.AI_AMT & "','" & oldPT_Tran.AI_PCT & "','" & oldPT_Tran.SF_code & "', 'RENEW','" & Trim(sLoginEmployee) & "'," & _
" '" & ReqCostCenter & "','" & OwnCostCenter & "','" & Mid(Trim(Replace(txtReqBranchName.Text, "'", "''")), 5) & "'," & _
" '" & oldPT_Tran.TransType & "','" & Format(oldPT_Tran.TransDate, "yyyy-MM-dd") & "')"
-
Jan 26th, 2010, 11:28 AM
#2
Re: Unknown Column 'LastTransType' in 'fieldlist'
LastTransType does not appear anywhere in your code, which leads me to believe that the issue is caused by the fact that you concatenate values to your string (and have made some kind of mistake somewhere in that massive chunk of text), rather than using Parameters - which would make this kind of issue much less likely to happen, and much easier to spot the cause too.
For an explanation of why you should be using parameters (and links to code examples), see the article Why should I use Parameters instead of putting values into my SQL string? from our Database Development FAQs/Tutorials (at the top of this forum).
-
Jan 27th, 2010, 07:10 PM
#3
Thread Starter
Addicted Member
Re: Unknown Column 'LastTransType' in 'fieldlist'
Hello! there Mr. si_the_geek,
i followed your suggestion to changed all my sql query string to parameterized one..and perfectly solved my problem.thank you also for the links.additional information to me..
i rated your post as very helpful to me..thanks!
-
Jan 27th, 2010, 07:58 PM
#4
Re: Unknown Column 'LastTransType' in 'fieldlist'
Also, you should have the same database for dev/test and production for you to be able to do proper simulation and testing before deployment.
-
Jan 28th, 2010, 04:29 AM
#5
Thread Starter
Addicted Member
Re: Unknown Column 'LastTransType' in 'fieldlist'
 Originally Posted by leinad31
Also, you should have the same database for dev/test and production for you to be able to do proper simulation and testing before deployment.
ill keep that in mind sir..thank you!.
-
Jan 28th, 2010, 10:18 AM
#6
Re: Unknown Column 'LastTransType' in 'fieldlist'
As you now have it sorted out, could you please do us a little favour, and mark the thread as Resolved?
(this saves time reading for those of us who like to answer questions, and also helps those who search to find answers)
You can do it by clicking on "Thread tools" just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).
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
|