Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-02-18 : 09:27:10
|
| SJ writes "Hi guys:When I tried to create a user-defiened function I got this errorError 2739:Cannot use empty object or column names. Use a single space if necessary.the purpose of this function is:it takes arabic string with arabic script and remove the arabic script , then return a free script string ..the function is :================================================CREATE FUNCTION fn_RemoveTashkeel (@InputString ntext)RETURNS ntextASBEGIN DECLARE @OutputString ntext COLLATE Arabic_BIN DECLARE @TashkeelChr char(8) COLLATE Arabic_BIN DECLARE @feed int SET @OutputString=@InputString-- @TashkeelChr holds arabic script string SET @TashkeelChr="Arabic Script List" SET @feed=1 WHILE @feed<=LEN(@TashkeelChr) BEGIN SET @OutputString=REPLACE(@OutputString,SUBSTRING(@TashkeelChr,@feed,1),"") SET @feed=@feed+1 END RETURN(@OutputString)END" |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-02-18 : 10:05:14
|
| the Error is because ofSET @OutputString=REPLACE(@OutputString,SUBSTRING(@TashkeelChr,@feed,1),"") -- replace it with single quotesAvoid using double quotes in your codeCREATE FUNCTION fn_RemoveTashkeel (@InputString ntext)RETURNS ntextASBEGINDECLARE @OutputString ntext COLLATE Arabic_BIN DECLARE @TashkeelChr char(8) COLLATE Arabic_BIN DECLARE @feed intSET @OutputString=@InputString-- @TashkeelChr holds arabic script stringSET @TashkeelChr="Arabic Script List" SET @feed=1WHILE @feed<=LEN(@TashkeelChr)BEGINSET @OutputString=REPLACE(@OutputString,SUBSTRING(@TashkeelChr,@feed,1),'')SET @feed=@feed+1ENDRETURN(@OutputString)END"--------------------------------------------------------------"Happiness is not something you experience, it's something you remember." |
 |
|
|
|
|
|
|
|