ExaGridDba

insert and update WE8MSWIN1252 characters with sqlplus

Feb 11th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ export NLS_LANG=.WE8MSWIN1252
  2. $ sqlplus win/win @ vnlsparameters.SQL
  3.  
  4. PARAMETER            VALUE
  5. -------------------- ----------------------------------------
  6. NLS_CHARACTERSET     WE8MSWIN1252
  7.  
  8. $ cat karr.SQL
  9. SET linesize 400
  10. SET trimspool ON
  11. COLUMN saying format a30
  12. COLUMN dmp format a110
  13.  
  14. CREATE TABLE karr ( saying VARCHAR2( 50 ));
  15. INSERT INTO karr ( saying ) VALUES ( 'Plus '  || UNISTR( '\00e7') || 'a change' );
  16. SELECT saying, DUMP ( saying ) dmp FROM karr;
  17. UPDATE karr SET saying = q'{Plus c'est la m}'  || unistr( '\00ea' ) || 'me chose';
  18. select saying, dump ( saying ) dmp from karr;
  19.  
  20. drop table karr;
  21.  
  22. quit
  23. $ sqlplus win/win @ karr.sql
  24. Table created.
  25.  
  26. 1 row created.
  27.  
  28. SAYING                         DMP
  29. ------------------------------ --------------------------------------------------------------------------------------------------------------
  30. Plus ça change                 Typ=1 Len=14: 80,108,117,115,32,231,97,32,99,104,97,110,103,101
  31.  
  32. 1 row updated.
  33.  
  34. SAYING                         DMP
  35. ------------------------------ --------------------------------------------------------------------------------------------------------------
  36. Plus c'est la même chose       Typ=1 Len=24: 80,108,117,115,32,99,39,101,115,116,32,108,97,32,109,234,109,101,32,99,104,111,115,101
  37.  
  38. TABLE dropped.
Advertisement
Add Comment
Please, Sign In to add comment