Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 13th, 2012, 04:22 AM
Harry707 Harry707 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 3 Harry707 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 13 sec
Reputation Power: 0
Unhappy Column unknown error

Hey guys,
I am using firebird Db in java/swing and i am running into a problem, i have a table named "TBLCASHTRANSACTION" which has a column name "LOGINID". I have a text field named "textField_1" in which i would enter the LoginId and afterwords when i run this query :

SELECT * FROM TBLCASHTRANSACTION WHERE LOGINID = "+ textField_1.getText();

I get this error:


org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -206
Column unknown
SSK0050606111535350002490
At line 1, column 50


Where SSK0050606111535350002490 is the loginid i entered in the textfield. What could be the problem. Please help .

Thanks,
Harry

Reply With Quote
  #2  
Old March 13th, 2012, 04:35 AM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 2,349 swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level)swampBoogie User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 4 Days 7 h 27 m 6 sec
Reputation Power: 390
Enclose the search value in ' ', i.e.

Code:
"SELECT * FROM TBLCASHTRANSACTION WHERE LOGINID = '"+ textField_1.getText() + "'";
Comments on this post
mariuz agrees!

Reply With Quote
  #3  
Old March 13th, 2012, 04:39 AM
Harry707 Harry707 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 3 Harry707 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 13 sec
Reputation Power: 0
Quote:
Originally Posted by swampBoogie
Enclose the search value in ' ', i.e.

Code:
"SELECT * FROM TBLCASHTRANSACTION WHERE LOGINID = '"+ textField_1.getText() + "'";



K man thanks i`ll try this

Reply With Quote
  #4  
Old March 13th, 2012, 05:26 AM
Harry707 Harry707 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 3 Harry707 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 13 sec
Reputation Power: 0
swampBoogie Thanks your the man

Reply With Quote
  #5  
Old March 15th, 2012, 02:10 AM
tsteinmaurer tsteinmaurer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2010
Posts: 34 tsteinmaurer User rank is Lance Corporal (50 - 100 Reputation Level)tsteinmaurer User rank is Lance Corporal (50 - 100 Reputation Level)tsteinmaurer User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 2 m 19 sec
Reputation Power: 3
It would be even better to use a parametrized query using parameters. You don't have to take care on the enclosed quotes at all then.
Comments on this post
clivew agrees: Especially when dealing with login as it prevents SQL injection
mariuz agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Column unknown error

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap