I want to pass a value longer more than 128 character but get an error.
what can i do?
I use sql 2005 and Visual Basic 6
thank'sI think you need to give a better description of the error; please give the exact message that you are getting. There is no problem passing an argument to a stored procedure that is longer than 128 characters. Also, can you potentially change the stored procedure and re-create or alter the stored procedure if the problem terns out to be the size of the argument?|||Thank for quikly response,
first i'm sorry about my english.
i was tried to pass parameter more small to the stored, and all was ok, the resultes are right.
I think the problem are only the lengh, i've only italian error description :
"La lunghezza del valore identificatore che inizia con '*MY PARAMETER*' è eccessiva.
La lunghezza massima consentita è 128."
I've edit stored for replace value more small to real value.
Example:
'VALUES EXPLANATION
SHORT VALUE REAL VALUE
DOF DATAORAFINE
DOS DATAORASCADENZA
DOI DATAORAINIZIO
'**************************************
'STORED CODE
SET @.CRITDATA = REPLACE(@.CRITDATA,'DOF','DATAORAFINE')
SET @.CRITDATA = REPLACE(@.CRITDATA,'DOS','DATAORASCADENZA')
SET @.CRITDATA = REPLACE(@.CRITDATA,'DOI','DATAORAINIZIO')
There is an other solution
thank's
Davide|||
Can you post the entire procedure? This works:
create procedure test
(
@.parameter varchar(200)
) as
select len(@.parameter), @.parameter
go
exec test '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
go
Returns:
-- --
200 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
I've used double apen fore execute query from SQL MANAGEMENT STUDIO, now with the single apex work!
Thanks a lot|||
Just to be clear.
You were putting double quotes ("text") around the argument rather than single('text').
The problem was that putting double quotes around the text is the same as putting it in square brackets ([text]). This means that the text is treated as an identifier (and not as text), and identifiers in SQL Server are limited to 128 characters.
Thought we ought to make it clear what the problem had been and how it had been fixed.
|||"You were putting double quotes ("text") around the argument rather than single('text'). "
Ah, nice catch. That went right over (past) my head, if only I could have read Italian (from google's translator:)
“The length of the identificatore value that it begins with “*MY PARAMETER*” is excessive. The concurred maximum length is 128.”
D'oh!
No comments:
Post a Comment