File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes text field in stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "text field in stored procedure" Watch "text field in stored procedure" New topic

text field in stored procedure

joseph cooper
Ranch Hand

Joined: Nov 08, 2005
Posts: 44
There is a text field defined in the database. I am working with a stored procedures and trying to insert information into this text field. I am receiving this error: "The text, ntext, and image data types are invalid for local variables."

-- code --

declare @Bas_Txt as text
declare @Bas_Cmt_Tx as varchar(200)
set @Bas_Txt = '<HTML> </HTML>'
set @Bas_Cmt_Tx = 'trial setup'

Set NoCount On
Insert into dbo.BASELINE(Bas_Txt, Bas_Cmt_Tx)
Values (@Bas_Txt, @Bas_Cmt_Tx)

I have done some looking on google and I am not sure if this can be done. If not, is there a work around?

thanks in advance.
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
Stored procedure languages are (usually) specific to their databases, and have nothing to do with Java; you'll probably have better luck on a forum dedicated to whatever database you are using (I can't tell, I don't recognize that particular stored procedure language).
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

It is ok to ask stored procedure questions here at JavaRanch. I recommend editing your post to put the language/database you are using in the subject. That way people who know that language/database are sure to read your post.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
joseph cooper
Ranch Hand

Joined: Nov 08, 2005
Posts: 44
I am working with SQL2000 and windows XP.
I agree. Here's the link:
subject: text field in stored procedure
It's not a secret anymore!