This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes adding text to one column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "adding text to one column" Watch "adding text to one column" New topic
Author

adding text to one column

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
hello could someone help please
i just wondered if you could put multiple querys into one column for example i have a column name called firstname and i want to put 10 first names in there would i have to write firstname 10 times and then write each value individuly or is there a better way?
thanks for yr time ben
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
Do you mean that you want to store in the FirstName column something like this:
FirstName1,FirstName2,FirstName3,FirstName4,...
(in which case you'd set your FirstName column to be the string created by appending FirstName1 + "," + FirstName2 +"," - the db doesn't care what you really put in the column if it's a text field with sufficient length)
Or do you mean that you want to write a query like this:
SELECT * FROM TableX Where FirstName Like "FirstName1" OR FirstName Like "FirstName2" OR . . .
(also could be written like
SELECT * FROM TableX where FirstName In ("FirstName1", "FirstName2", "FirstName3". . .) - but then you need a precise text match, instead of the ability to do a LIKE query).
 
Don't get me started about those stupid light bulbs.
 
subject: adding text to one column
 
Similar Threads
HELP !! problem with setparameter in entitymanager
I need some help
help with getting the table name from the user input
Getting Last Record in Jtable
can you put multiple words in a database by using one statement