• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1923
  • Last Modified:

Maximum length is 128.

HELP!!!

When executed in query analyzer (or DoCmd.RunSQL for that matter...)

EXEC spUPDATE_InitialDescriptor 1128, "Thinly sliced smoked ham, sandwiched with real cheddar cheese and baked egg in a hearty bagel.  Have it grilled or microwave at your office."

I get this message...

Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with 'Thinly sliced smoked ham, sandwiched with real cheddar cheese and baked egg in a hearty bagel.  Have it grilled or microwave at ' is too long. Maximum length is 128.

I would give more points on this if i could--  but please don't make me have a conniption over this one--  I need to pass longer strings into a parameter for a stored procedure...

Should I use ADO instead?  GetChunk/AppendChunk?

Thanks a ton!!
206 694 6384
0
AAMFK
Asked:
AAMFK
  • 15
  • 3
1 Solution
 
HotwuCommented:
looks like a type error bro, not necessarily what you are using to insert the data. try changing your data type?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This should work:

EXEC spUPDATE_InitialDescriptor 1128, 'Thinly sliced smoked ham, sandwiched with real cheddar cheese
and baked egg in a hearty bagel.  Have it grilled or microwave at your office.'

The " (double quotes) are used for identifiers...

You can also try this:
SET QUOTED_IDENTIFIER OFF
EXEC spUPDATE_InitialDescriptor 1128, "Thinly sliced smoked ham, sandwiched with real cheddar cheese
and baked egg in a hearty bagel.  Have it grilled or microwave at your office."

Cheers
0
 
AAMFKAuthor Commented:
The datatype I have been using is varchar (600)

Additionally, I have tried Char and NVarChar...

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
AAMFKAuthor Commented:
A;

What does this Sp do?

SET QUOTED_IDENTIFIER OFF

0
 
AAMFKAuthor Commented:
Also--  just wanted to let people know that the files that Im importing are up to 4400 characters--

I just found that out--  I was thinking that 500 was the maximum--  but i wrote something that let me keep track of whenever the MaxLength is increased...

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Normally, your identifiers (table names, column names) can be named without any quotes or brackets:

SELECT YourColumn FROM YourTable

However, if you have names that have special caracters in it (like spaces), or if the names are reserved words, you need to enclose the names:

SELECT "Your Column" FROM "Your Table"
SELECT [Your Column] FROM [Your Table]

If you want to specify a string constant, you have to use single quotes:
INSERT INTO YourTable VALUES ('My Name')

SET QUOTED_IDENTIFIER OFF
This will make that the double quotes will also be used for strings, ie the next examples will produce the same result:
INSERT INTO YourTable VALUES ('My Name')
INSERT INTO YourTable VALUES ("My Name")

Cheers
0
 
AAMFKAuthor Commented:
Ok-  Ill give that a shot..

Im trying to keep on raising the value for this question--  I am desperate for a solution for this one.. (holding up a _big_ project involving the past 6-9 months of my life..)
0
 
AAMFKAuthor Commented:
Im looking for some help with the TSQL WriteText or UpdateText commands/functions..

I read BOL for SQL 7.0; and it all still seems kindof obnoxious..

Have you guys ever used these TSQL Commands?

I think that I basically have them working now--  except for the fact that I still cough on any text around 600 characters..
0
 
AAMFKAuthor Commented:
Ok guys... please help...

I am using the TSQL WriteText/UpdateText commands (in the Stored Procedure)..

Basically, it looks like it helps--  but then again I am only importing something like 2200 out of 4500 text files successfully.

Again, I really wish that I had more points to give--  I am increasing the points on this as often as I can...

0
 
AAMFKAuthor Commented:
This is the new SP that is still causing problems..


Alter PROCEDURE dbo.spUpdate_InitialDescriptor
@PLU smallint,
@STRING TEXT
AS
exec sp_DbOption 'BRIAZZ', 'select into/bulkcopy', True
Declare @Pointervalue Varbinary(16)
-- declare a local variable to store the pointer
-- find and assig the value of the pointer
Select @Pointervalue = TEXTPTR(InitialDescriptor)
From Products
WHERE     (PLU = @PLU)
-- Alter the value of the text field
WRITETEXT DBO.Products.InitialDescriptor @Pointervalue @String
0
 
AAMFKAuthor Commented:
I lied.  here is the text for this SP:

Alter PROCEDURE dbo.spUpdate_NutritionalStatement
@PLU smallint,
@STRING TEXT
AS
exec sp_DbOption 'Briazz', 'select into/bulkcopy', True
Declare @Pointervalue Varbinary(16)
-- declare a local variable to store the pointer
-- find and assig the value of the pointer
Select @Pointervalue = TEXTPTR(NutitionalStatement)
From Products
WHERE     (PLU = @PLU)
-- Alter the value of the text field
WRITETEXT DBO.Products.NutitionalStatement @Pointervalue @String

Here is the EXEC Statement that calls this (with the associated data)

EXEC spUPDATE_NutitionalStatement 1091, 'Serv size: 1 package of cereal, Amount Per Serving:  Calories  530, Fat Cal. 60,  Total Fat  6g(10%DV), Sat Fat 0g(0%DV),  Cholest.  0mg(0%DV), Sodium 530mg(22%DV),  Total Carb.  111g(37%DV), Fiber 8g(30%DV), Sugars 48g,  Protein  10g, Vitamin A(0%DV), Vitamin C(0%DV), Calcium(6%DV), Iron(15%DV), Percent Daily Values(DV) are based on a 2000 calorie diet.'
0
 
AAMFKAuthor Commented:
i think that i got most of the nutritionalstatement problems ironed out..

i think that it was just that i was misspelling Nutritional...

Can anyone help me more?  Please?
0
 
AAMFKAuthor Commented:
so in other words; im still having occasional problems with long fields...

Does anyone know for sure how long WRITETEXT can handle?  

Or is the limitation in the ADP Database itself?  (Obviously the answer to this is no, because when i try these with the query analyzer, it doesn't work either...)

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I don't know the max size for the writetext, but i know the following:
Select @Pointervalue = TEXTPTR(NutitionalStatement)

If the NutitionalStatement is NULL (which is normally the case after the row has been created, TEXTPTR returns NULL too, which makes the WriteText function fail!
You have to update the NutitionalStatement field first:
UPDATE Products
SET NutitionalStatement = 'x'
WHERE  (PLU = @PLU)
after this, you can use the TEXTPTR function...

Cheers
0
 
AAMFKAuthor Commented:
Ill give that a shot.. thanks..

Aaron
0
 
AAMFKAuthor Commented:
that didn't help..

the files aren't null..  

are there any better TSQL Debugges other than the Query Analyzer that comes with SQL 2000????

Aaron
0
 
AAMFKAuthor Commented:
hotwu

how could this be a datatype error..
i dont' understand.

the field itself is 'text'--

can i/should i make a custom datatype?
0
 
AAMFKAuthor Commented:
thanks for all your help, guys..

0
 
AAMFKAuthor Commented:
thanks for all the help, guys.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 15
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now