Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Delphi
  4. Unicode parameter in Select Query

Unicode parameter in Select Query

Scheduled Pinned Locked Moved Delphi
databasedelphihelpquestion
2 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijay victory
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • V vijay 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.

      N Offline
      N Offline
      nortee
      wrote on last edited by
      #2

      Hi, Have you check that your application is set to Unicode/UCS4 encoding?

      Cheers, Glen Vlotman "You cannot code for stupidity"

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups