修改OracleXE管理界面端口

2014年8月19日 12:54

OracleXE管理界面默认端口是8080,修改方法:进入OracleXE命令行界面,执行以下命令
SQL> connect / as sysdba
已连接。
SQL> exec dbms_xdb.sethttpport(8081);
PL/SQL过程已成功完成。
 

Tags: OracleXE
评论(0) 阅读(1587)

sqlfront.h 没有那个文件或目录

2014年4月23日 17:12

  • 安装pymssql,出现下面情况
[wyq@localhost ~]$ sudo pip install pymssql
Downloading/unpacking pymssql
  Downloading pymssql-2.1.0.tar.bz2 (1.9MB):   0%  8.2kB
  Downloading pymssql-2.1.0.tar.bz2 (1.9MB): 1.9MB downloaded
  Running setup.py egg_info for package pymssql
    setup.py: platform.system() => 'Linux'
    setup.py: platform.architecture() => ('64bit', 'ELF')
    setup.py: platform.linux_distribution() => ('Fedora', '20', 'Heisenbug')
    setup.py: platform.libc_ver() => ('glibc', '2.2.5')
    setup.py: Not using bundled FreeTDS
    setup.py: include_dirs = ['/usr/local/include']
    setup.py: library_dirs = ['/usr/local/lib']
    
    warning: no files found matching 'pymssql_version.py'
    warning: no files found matching 'win32/freetds.zip'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
Installing collected packages: pymssql
  Running setup.py install for pymssql
    setup.py: platform.system() => 'Linux'
    setup.py: platform.architecture() => ('64bit', 'ELF')
    setup.py: platform.linux_distribution() => ('Fedora', '20', 'Heisenbug')
    setup.py: platform.libc_ver() => ('glibc', '2.2.5')
    setup.py: Not using bundled FreeTDS
    setup.py: include_dirs = ['/usr/local/include']
    setup.py: library_dirs = ['/usr/local/lib']
    building '_mssql' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB
    _mssql.c:346:22: 致命错误:sqlfront.h:没有那个文件或目录
     #include "sqlfront.h"
                          ^
    编译中断。
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-K_4vEY-record/install-record.txt --single-version-externally-managed:
    setup.py: platform.system() => 'Linux'

setup.py: platform.architecture() => ('64bit', 'ELF')

setup.py: platform.linux_distribution() => ('Fedora', '20', 'Heisenbug')

setup.py: platform.libc_ver() => ('glibc', '2.2.5')

setup.py: Not using bundled FreeTDS

setup.py: include_dirs = ['/usr/local/include']

setup.py: library_dirs = ['/usr/local/lib']

running install

running build

running build_ext

building '_mssql' extension

creating build

creating build/temp.linux-x86_64-2.7

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB

_mssql.c:346:22: 致命错误:sqlfront.h:没有那个文件或目录

 #include "sqlfront.h"

                      ^

编译中断。

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-K_4vEY-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip_build_root/pymssql
Traceback (most recent call last):
  File "/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 147, in main
    return command.main(args[1:], options)
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 169, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 21: ordinal not in range(128)
  • 需要安装freetds
sudo yum install freetds-devel
SQLServer和Sybase使用的协议是TDS协议,linux中使用freetds连接SQLServer.
 
 

Tags: sqlserver;python;pymssql
评论(1) 阅读(5624)

SQL标准规定中null值判断是否合理?

2014年2月11日 18:50

在postgres中判断null值时,下面语句的结果不相等,为什么?
select * from user_info where user_name is null
select * from user_info where user_name = null
 
原因是postgres遵循sql标准,在ANSI SQL(SQL-92)标准中规定的Null值的比较取值结果都为False.
它认为NULL 代表一个未知的数值,无法知道两个未知的数值是否相等。
 
这个理由很不充分,既然无法判断,那么is null又是如何判断它是空的呢?
 
虽然null表面含义是未知值,但是计算机中不可能有不确定的表示. 常见程序语言中null实际都是一个特殊值,一个确定的特殊值。所以在编程语言中是允许使用null=null(值比较)的. SQL中不允许是否合理?
 

Tags: sql;postgres
评论(2) 阅读(1742)

postgres递归查询

2014年2月11日 16:58

Tags: postgres
评论(0) 阅读(2178)