6 Replies Latest reply: Sep 13, 2012 2:42 AM by 697861 RSS

    dynamic library+ Linux + ORACLE 10.2

    697861
      I have Linux + ORACLE 10.2

      $ env | grep LAN
      NLS_LANG=AMERICAN_AMERICA.UTF8
      LANG=en_US.UTF-8

      database parameters:
      1 NLS_LANGUAGE AMERICAN
      2 NLS_TERRITORY AMERICA
      3 NLS_CHARACTERSET UTF8
      4 NLS_NCHAR_CHARACTERSET AL16UTF16

      I have a dynamic library and plsql function:

      #include <stdio.h>
      int sysrun(char command, char ying, char *yang)
      {
      FILE *fpointer ;
      fpointer = fopen("out6.txt","wt");
      if (!fpointer)
      {
      printf( "!!! file error \n" );
      return;
      }
      fprintf(fpointer,"ying:%s yang:%s command:%s \n",ying,yang,command);
      fclose(fpointer);
      return 0;
      //return system(command);
      }

      //---------


      create or replace function sysrun_2 (syscomm in varchar2, ying IN VARCHAR2, yang IN VARCHAR2 )
      return binary_integer
      as language C
      name "sysrun"
      library shell_lib
      parameters(syscomm string, ying string,yang string);

      I send to library russian words(by sqlplus), but it write in a file bad symbols
      'п╡я▀'

      I run query on sqlplus:
      SELECT CONVERT('п╡я▀', VALUE) conv,VALUE FROM
      v$nls_valid_values v
      where parameter = 'CHARACTERSET';

      And see, that the best code page is CL8KOI8R

      why CL8KOI8R? And where's from ?
      And how can I change it ?

      P.S. when I call library from Linux it's ok !!