Unicode parameter in Select Query
-
I want to search the record by a word which is Unicode. So I can give it in SQL Mgnt Studio like this..
select VocNo from VocableMaster where VocDescSan like N'अपाप'
It can give me result.where 'N' denotes it is Unicode string. But I cant send it via Delphi. I tried following ways :-
1> select VocNo from VocableMaster where VocDescSan like N'''+reVocSan.Text+'''
then it gives me no result becoz reVocSan.Text will be '????'(due to unicode)
2>select VocNo from VocableMaster where VocDescSan like N:VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about VocDescSan parameter not found. bcoz it combines both N and para.
3>select VocNo from VocableMaster where VocDescSan like N :VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about Column Name not found for 'N' (if space between N and para)
4>select VocNo from VocableMaster where VocDescSan like N+:VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about Column Name not found for 'N'
5>select VocNo from VocableMaster where VocDescSan like :VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will not give any error. but couldnt give any Result. I will check it in SQL mgnt Studio.
select VocNo from VocableMaster where VocDescSan like 'अपाप'
Can anyone have solution for this..
I have never failed,I just found 1000 ways that never works. Regards, Victory.
-
I want to search the record by a word which is Unicode. So I can give it in SQL Mgnt Studio like this..
select VocNo from VocableMaster where VocDescSan like N'अपाप'
It can give me result.where 'N' denotes it is Unicode string. But I cant send it via Delphi. I tried following ways :-
1> select VocNo from VocableMaster where VocDescSan like N'''+reVocSan.Text+'''
then it gives me no result becoz reVocSan.Text will be '????'(due to unicode)
2>select VocNo from VocableMaster where VocDescSan like N:VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about VocDescSan parameter not found. bcoz it combines both N and para.
3>select VocNo from VocableMaster where VocDescSan like N :VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about Column Name not found for 'N' (if space between N and para)
4>select VocNo from VocableMaster where VocDescSan like N+:VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about Column Name not found for 'N'
5>select VocNo from VocableMaster where VocDescSan like :VocDescSan)) and '); Parameters.ParamByName('VocDescSan').DataType := ftWideString; Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will not give any error. but couldnt give any Result. I will check it in SQL mgnt Studio.
select VocNo from VocableMaster where VocDescSan like 'अपाप'
Can anyone have solution for this..
I have never failed,I just found 1000 ways that never works. Regards, Victory.