Solved

Maximum length is 128.

Posted on 2001-06-07
19
1,899 Views
Last Modified: 2008-03-04
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
Comment
Question by:AAMFK
  • 15
  • 3
19 Comments
 

Expert Comment

by:Hotwu
Comment Utility
looks like a type error bro, not necessarily what you are using to insert the data. try changing your data type?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
The datatype I have been using is varchar (600)

Additionally, I have tried Char and NVarChar...

0
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
A;

What does this Sp do?

SET QUOTED_IDENTIFIER OFF

0
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 120 total points
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
Ill give that a shot.. thanks..

Aaron
0
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
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
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
thanks for all your help, guys..

0
 
LVL 1

Author Comment

by:AAMFK
Comment Utility
thanks for all the help, guys.

0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now