Link to home
Start Free TrialLog in
Avatar of AAMFK
AAMFK

asked on

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
Avatar of Hotwu
Hotwu

looks like a type error bro, not necessarily what you are using to insert the data. try changing your data type?
Avatar of Guy Hengel [angelIII / a3]
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
Avatar of AAMFK

ASKER

The datatype I have been using is varchar (600)

Additionally, I have tried Char and NVarChar...

Avatar of AAMFK

ASKER

A;

What does this Sp do?

SET QUOTED_IDENTIFIER OFF

Avatar of AAMFK

ASKER

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...

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
Avatar of AAMFK

ASKER

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..)
Avatar of AAMFK

ASKER

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..
Avatar of AAMFK

ASKER

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...

Avatar of AAMFK

ASKER

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
Avatar of AAMFK

ASKER

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.'
Avatar of AAMFK

ASKER

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?
Avatar of AAMFK

ASKER

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...)

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AAMFK

ASKER

Ill give that a shot.. thanks..

Aaron
Avatar of AAMFK

ASKER

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
Avatar of AAMFK

ASKER

hotwu

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

the field itself is 'text'--

can i/should i make a custom datatype?
Avatar of AAMFK

ASKER

thanks for all your help, guys..

Avatar of AAMFK

ASKER

thanks for all the help, guys.