This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Stored procedure call removes spaces in text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Stored procedure call removes spaces in text" Watch "Stored procedure call removes spaces in text" New topic
Author

Stored procedure call removes spaces in text

Trader Joey
Ranch Hand

Joined: May 11, 2000
Posts: 33
Hi All,
I have written a stored procedure to store some data into a table. The stored procedure contains an insert statement that inserts a new record. There are a number of fields that are of type varchar. When I insert a new record using this stored procedure, all the spaces in the varchar fields are missing. so "how are you today" is stored as "howareyoutoday". Can anyone help me to solve this problem?
I am using SQL Server as my database, the Microsoft JDBC connector for SQL.
This is interesting too.
When I call the stored procedure using the SQL server query analyser, the result is fine. The spaces show properly. Its only when I run the stored procedure through a Java client that the error occurs.
Thanks
Nikhil
[ May 27, 2003: Message edited by: Nikhil Nikhil ]
 
 
subject: Stored procedure call removes spaces in text
 
Similar Threads
SQL Server 2000 Return Value
Hibernate 3 : Storing return value from Stored procedure call
identity
Transaction management
calling stored procedure from java