waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Unable to install ibm_db on mac #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install IBM DB2 client app
2. export IBM_DB_DIR and IBM_DB_LIB to point to appropriate folders
3. Run: easy_install ibm_db

What is the expected output? What do you see instead?

Expected to install ibm_db.

Instead received the following error:

Searching for ibm-db
Reading http://pypi.python.org/simple/ibm_db/
Reading http://code.google.com/p/ibm-db/downloads/list
Best match: ibm-db 1.0.3
Downloading 
http://pypi.python.org/packages/source/i/ibm_db/ibm_db-1.0.3.tar.gz#md5=14cc3a1a
a925950b6063888b9d2c8188
Processing ibm_db-1.0.3.tar.gz
Running ibm_db-1.0.3/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-noFYYx/ibm_db-1.0.3/egg-dist-tmp-ovG6cW
IBM DataServer environment not set. 
Please set IBM_DB_DIR to path to sqllib,
and set IBM_DB_LIB to lib directory under sqllib
e.g. export IBM_DB_DIR=/home/db2inst1/sqllib
     export IBM_DB_LIB=/home/db2inst1/sqllib/lib

No eggs found in /tmp/easy_install-noFYYx/ibm_db-1.0.3/egg-dist-tmp-ovG6cW 
(setup script problem?)

What version of the product are you using? On what operating system?

Python-2.6.1

Macbook pro:
Darwin MacBook-Pro.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 
18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

Please provide any additional information below.

Although, the intent is to use the Informix driver, the script asks for DB2 
client paths. This is confusing. 

Original issue reported on code.google.com by vsrivas...@gmail.com on 8 Oct 2010 at 6:04

GoogleCodeExporter commented 9 years ago
This is not due to setup script problem. 
To resolve this you needs to follow following steps
1) Download and install IBM DS Driver from 
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-
informixfpd
2) Export the following environment variables
    export IBM_DB_LIB=<DS_DRIVER_PATH>/lib
    export IBM_DB_DIR=<DS_DRIVER_PATH>
3) easy_install ibm_db

Original comment by rahul.pr...@in.ibm.com on 12 Oct 2010 at 6:13

GoogleCodeExporter commented 9 years ago
I downloaded the IBM Data Server Driver for ODBC and CLI version 9.5 for MAC OS 
X 32 Bit
db2_driver_for_odbc_cli-32.tar.Z  (14MB)

when I run easy_install ibm_db I get following errors:
....
ibm_db.c:8908: error: ‘SQL_ATTR_INFO_ACCTSTR’ undeclared (first use in this 
function)
ibm_db.c:8909: error: ‘SQL_ATTR_INFO_APPLNAME’ undeclared (first use in 
this function)
ibm_db.c:8913: error: ‘SQL_DBMS_NAME’ undeclared (first use in this 
function)
ibm_db.c:8914: error: ‘SQL_DBMS_VER’ undeclared (first use in this function)
ibm_db.c:8918: error: ‘SQL_API_SQLROWCOUNT’ undeclared (first use in this 
function)
lipo: can't open input file: /var/tmp//ccLyyi0E.out (No such file or directory)
error: Setup script exited with error: command 'gcc-4.2' failed with exit 
status 1

Apparently I am missing something.

Original comment by vsrivas...@gmail.com on 23 Nov 2010 at 3:54

GoogleCodeExporter commented 9 years ago
Sorry for inconvenience, this error comes due to DS Driver version 9.5 for MAC 
OS as it doesn't contain include directory. This directory is required as  all 
the header files reside under this  directory. 

I don't know another link to download DS Driver for MAC OS. I will ask DS 
Driver folks over here about this issue and will let you know if found 
something helpful.

For temporary solution you can download DS Driver of Linux 32 bit and copy 
include directory from this to MAC OS DS Driver directory. 

Original comment by rahul.pr...@in.ibm.com on 23 Nov 2010 at 3:33

GoogleCodeExporter commented 9 years ago
I downloaded the linux drivers. I can't find the include files anywhere:

These are the two files I have downloaded:
db2_driver_for_odbc_cli-32.tar.Z    v9.5fp3_linuxia32_rtcl.tar.gz

are these the right files? Is it possible to build it on linux, I will give it 
a shot on linux.

Original comment by vsrivas...@gmail.com on 24 Nov 2010 at 1:06

GoogleCodeExporter commented 9 years ago
What other alternatives are there to access Informix via django framework? 

Original comment by vsrivas...@gmail.com on 24 Nov 2010 at 1:17

GoogleCodeExporter commented 9 years ago
v9.5fp3_linuxia32_rtcl.tar.gz is Data Server Runtime so, this one is not a 
correct file you have downloaded. 

you needs to download v9.5fp3_linuxia32_dsdriver.tar.gz for linux 32 bit DS 
Driver.

db2_driver_for_odbc_cli-32.tar.Z is correct one which you have downloaded for 
MAC OS.

If you want to give a shot from Linux then there is latest DS Driver available 
on http://www-01.ibm.com/support/docview.wss?uid=swg24027908

Original comment by rahul.pr...@in.ibm.com on 24 Nov 2010 at 1:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
we haven't run the Django regression suite with Informix, because we haven't 
found time to spend on this yet. But the Django adapter relies on the 
ibm_db_dbi wrapper which in turn depends on the ibm_db python driver, the 
latter 2 which already support IDS.
we don't expect to see much issues if any with the Django to Informix.

you can access Informix through Linux or Window as a client.

Original comment by rahul.pr...@in.ibm.com on 24 Nov 2010 at 2:33

GoogleCodeExporter commented 9 years ago
I don't see any include folder in the v9.7fp3_25384_linuxia32_dsdriver.tar.gz 
for linux and I am getting the same error as in comment 2. I have python 2.6 on 
the ubuntu system. Would it be possible for you to outline what I need to 
install as prerequisite to install ibm_db.

I am confused, because there is neither a lib folder nor a include folder. What 
do I set the IBM_DB_DIR and IBM_DB_LIB to? Is there an easy_install or 
equivalent script to do dependency resolution and install the relevant 
libraries and header files?

I really appreciate your help. Here's the list of files that I have in the 
dsdriver files:

|-- bin
|   `-- clpplus
|-- installDSDriver
|-- java
|   |-- db2jcc4.jar
|   |-- db2jcc.jar
|   |-- jdbc4_LI_br.rtf
|   |-- jdbc4_LI_cn.rtf
|   |-- jdbc4_LI_cs
|   |-- jdbc4_LI_cz.rtf
|   |-- jdbc4_LI_de
|   |-- jdbc4_LI_de.rtf
|   |-- jdbc4_LI_en
|   |-- jdbc4_LI_en.rtf
|   |-- jdbc4_LI_es
|   |-- jdbc4_LI_es.rtf
|   |-- jdbc4_LI_fr
|   |-- jdbc4_LI_fr.rtf
|   |-- jdbc4_LI_it
|   |-- jdbc4_LI_it.rtf
|   |-- jdbc4_LI_ja
|   |-- jdbc4_LI_jp.rtf
|   |-- jdbc4_LI_ko
|   |-- jdbc4_LI_kr.rtf
|   |-- jdbc4_LI_pl
|   |-- jdbc4_LI_pl.rtf
|   |-- jdbc4_LI_pt
|   |-- jdbc4_LI_tr
|   |-- jdbc4_LI_tr.rtf
|   |-- jdbc4_LI_tw.rtf
|   |-- jdbc4_LI_zh
|   |-- jdbc4_LI_zh_TW
|   |-- jdbc_LI_br.rtf
|   |-- jdbc_LI_cn.rtf
|   |-- jdbc_LI_cs
|   |-- jdbc_LI_cz.rtf
|   |-- jdbc_LI_de
|   |-- jdbc_LI_de.rtf
|   |-- jdbc_LI_en
|   |-- jdbc_LI_en.rtf
|   |-- jdbc_LI_es
|   |-- jdbc_LI_es.rtf
|   |-- jdbc_LI_fr
|   |-- jdbc_LI_fr.rtf
|   |-- jdbc_LI_it
|   |-- jdbc_LI_it.rtf
|   |-- jdbc_LI_ja
|   |-- jdbc_LI_jp.rtf
|   |-- jdbc_LI_ko
|   |-- jdbc_LI_kr.rtf
|   |-- jdbc_LI_pl
|   |-- jdbc_LI_pl.rtf
|   |-- jdbc_LI_pt
|   |-- jdbc_LI_tr
|   |-- jdbc_LI_tr.rtf
|   |-- jdbc_LI_tw.rtf
|   |-- jdbc_LI_zh
|   |-- jdbc_LI_zh_TW
|   |-- sqlj4.zip
|   `-- sqlj.zip
|-- license
|   |-- cs_CZ.iso88592
|   |   |-- dsdriver_LI_cs
|   |   |-- jdbc4_LI_cs
|   |   |-- jdbc_LI_cs
|   |   `-- odbc_LI_cs
|   |-- cs_CZ.utf8
|   |   |-- dsdriver_LI_cs
|   |   |-- jdbc4_LI_cs
|   |   |-- jdbc_LI_cs
|   |   `-- odbc_LI_cs
|   |-- de_DE.iso88591
|   |   |-- dsdriver_LI_de
|   |   |-- jdbc4_LI_de
|   |   |-- jdbc_LI_de
|   |   `-- odbc_LI_de
|   |-- de_DE.utf8
|   |   |-- dsdriver_LI_de
|   |   |-- jdbc4_LI_de
|   |   |-- jdbc_LI_de
|   |   `-- odbc_LI_de
|   |-- dsdriver_notices.txt
|   |-- en_US.iso88591
|   |   |-- dsdriver_LI_en
|   |   |-- jdbc4_LI_en
|   |   |-- jdbc_LI_en
|   |   `-- odbc_LI_en
|   |-- es_ES.iso88591
|   |   |-- dsdriver_LI_es
|   |   |-- jdbc4_LI_es
|   |   |-- jdbc_LI_es
|   |   `-- odbc_LI_es
|   |-- es_ES.utf8
|   |   |-- dsdriver_LI_es
|   |   |-- jdbc4_LI_es
|   |   |-- jdbc_LI_es
|   |   `-- odbc_LI_es
|   |-- fr_FR.iso88591
|   |   |-- dsdriver_LI_fr
|   |   |-- jdbc4_LI_fr
|   |   |-- jdbc_LI_fr
|   |   `-- odbc_LI_fr
|   |-- fr_FR.utf8
|   |   |-- dsdriver_LI_fr
|   |   |-- jdbc4_LI_fr
|   |   |-- jdbc_LI_fr
|   |   `-- odbc_LI_fr
|   |-- it_IT.iso88591
|   |   |-- dsdriver_LI_it
|   |   |-- jdbc4_LI_it
|   |   |-- jdbc_LI_it
|   |   `-- odbc_LI_it
|   |-- it_IT.utf8
|   |   |-- dsdriver_LI_it
|   |   |-- jdbc4_LI_it
|   |   |-- jdbc_LI_it
|   |   `-- odbc_LI_it
|   |-- ja_JP.eucJP
|   |   |-- dsdriver_LI_ja
|   |   |-- jdbc4_LI_ja
|   |   |-- jdbc_LI_ja
|   |   `-- odbc_LI_ja
|   |-- ja_JP.sjis
|   |   |-- dsdriver_LI_ja
|   |   |-- jdbc4_LI_ja
|   |   |-- jdbc_LI_ja
|   |   `-- odbc_LI_ja
|   |-- ja_JP.utf8
|   |   |-- dsdriver_LI_ja
|   |   |-- jdbc4_LI_ja
|   |   |-- jdbc_LI_ja
|   |   `-- odbc_LI_ja
|   |-- ko_KR.eucKR
|   |   |-- dsdriver_LI_ko
|   |   |-- jdbc4_LI_ko
|   |   |-- jdbc_LI_ko
|   |   `-- odbc_LI_ko
|   |-- ko_KR.utf8
|   |   |-- dsdriver_LI_ko
|   |   |-- jdbc4_LI_ko
|   |   |-- jdbc_LI_ko
|   |   `-- odbc_LI_ko
|   |-- pl_PL.iso88592
|   |   |-- dsdriver_LI_pl
|   |   |-- jdbc4_LI_pl
|   |   |-- jdbc_LI_pl
|   |   `-- odbc_LI_pl
|   |-- pl_PL.utf8
|   |   |-- dsdriver_LI_pl
|   |   |-- jdbc4_LI_pl
|   |   |-- jdbc_LI_pl
|   |   `-- odbc_LI_pl
|   |-- pt_BR.iso88591
|   |   |-- dsdriver_LI_pt
|   |   |-- jdbc4_LI_pt
|   |   |-- jdbc_LI_pt
|   |   `-- odbc_LI_pt
|   |-- pt_BR.utf8
|   |   |-- dsdriver_LI_pt
|   |   |-- jdbc4_LI_pt
|   |   |-- jdbc_LI_pt
|   |   `-- odbc_LI_pt
|   |-- ru_RU.iso88595
|   |   |-- jdbc4_LI_ru
|   |   |-- jdbc_LI_ru
|   |   `-- odbc_LI_ru
|   |-- ru_RU.koi8r
|   |   |-- jdbc4_LI_ru
|   |   |-- jdbc_LI_ru
|   |   `-- odbc_LI_ru
|   |-- ru_RU.utf8
|   |   |-- jdbc4_LI_ru
|   |   |-- jdbc_LI_ru
|   |   `-- odbc_LI_ru
|   |-- tr_TR.iso88599
|   |   |-- dsdriver_LI_tr
|   |   |-- jdbc4_LI_tr
|   |   |-- jdbc_LI_tr
|   |   `-- odbc_LI_tr
|   |-- tr_TR.utf8
|   |   |-- dsdriver_LI_tr
|   |   |-- jdbc4_LI_tr
|   |   |-- jdbc_LI_tr
|   |   `-- odbc_LI_tr
|   |-- zh_CN.eucCN
|   |   |-- dsdriver_LI_zh
|   |   |-- jdbc4_LI_zh
|   |   |-- jdbc_LI_zh
|   |   `-- odbc_LI_zh
|   |-- zh_CN.gbk
|   |   |-- dsdriver_LI_zh
|   |   |-- jdbc4_LI_zh
|   |   |-- jdbc_LI_zh
|   |   `-- odbc_LI_zh
|   |-- zh_CN.utf8
|   |   |-- dsdriver_LI_zh
|   |   |-- jdbc4_LI_zh
|   |   |-- jdbc_LI_zh
|   |   `-- odbc_LI_zh
|   |-- zh_TW.big5
|   |   |-- dsdriver_LI_zh_TW
|   |   |-- jdbc4_LI_zh_TW
|   |   |-- jdbc_LI_zh_TW
|   |   `-- odbc_LI_zh_TW
|   |-- zh_TW.eucTW
|   |   |-- dsdriver_LI_zh_TW
|   |   |-- jdbc4_LI_zh_TW
|   |   |-- jdbc_LI_zh_TW
|   |   `-- odbc_LI_zh_TW
|   `-- zh_TW.utf8
|       |-- dsdriver_LI_zh_TW
|       |-- jdbc4_LI_zh_TW
|       |-- jdbc_LI_zh_TW
|       `-- odbc_LI_zh_TW
|-- odbc_cli_driver
|   `-- linuxia32
|       `-- ibm_data_server_driver_for_odbc_cli.tar.Z
|-- php
|   `-- php32
|       |-- ibm_db2_4.4.6.so
|       |-- ibm_db2_5.2.1.so
|       |-- pdo_ibm_5.2.1.so
|       `-- README
|-- python32
|   |-- ibm_db-0.7.2.5-py2.5-linux-i686.egg
|   |-- ibm_db_sa-0.1.6-py2.5.egg
|   `-- README
|-- ruby
|   `-- ruby32
|       |-- ibm_db-1.1.1.gem
|       `-- README
`-- tools
    |-- clpplus.jar
    `-- jline-0.9.93.jar

Original comment by vsrivas...@gmail.com on 24 Nov 2010 at 4:59

GoogleCodeExporter commented 9 years ago
Follow following steps to install ibm_db
1) Extract v9.7fp3_25384_linuxia32_dsdriver.tar.gz then you will find following 
directory structure

 dsdriver
  | -- clpplus
  | -- jdbc_sqlj_driver
  | -- license
  | -- odbc_cli_driver 
  |     ' -- linuxia32
  |           ' -- ibm_data_server_driver_for_odbc_cli.tar.Z
  |                      |
  |                      |After Extracting this file
  |                    clidriver      ( you needs to set IBM_DB_DIR to path to this directory)
  | -- php_driver           
  | -- python32
  | -- ruby_driver
  | -- installDSDriver

2) Export the following environment variables
    export IBM_DB_DIR=<path upto clidriver>
    export IBM_DB_LIB=<path upto clidriver>/lib

3) easy_install ibm_db

There is no other prerequisite to install ibm_db.

Original comment by rahul.pr...@in.ibm.com on 24 Nov 2010 at 6:55

GoogleCodeExporter commented 9 years ago
After successful installation of ibm_db you needs to set LD_LIBRARY_PATH.
for this issue following command
$ export LD_LIBRARY_PATH=<path upto clidriver>/lib:$LD_LIBRARY_PATH

Original comment by rahul.pr...@in.ibm.com on 24 Nov 2010 at 7:13

GoogleCodeExporter commented 9 years ago
Thanks a lot for your help. I have installed the ibm_db and ibm_db_django 
successfully.
What settings do I need to connect to the database. I know settings needed for 
CSDK, but is there any setting for db2driver?

following is the entry in my /opt/IBM/informix/etc/sqlhosts file:

berttcpDbServer onsoctcp        bert    informixOnline

I can connect to the database using CSDK dbaccess utility.

I am getting the following exception

File 
"/usr/local/lib/python2.6/dist-packages/ibm_db-1.0.3-py2.6-linux-i686.egg/ibm_db
_dbi.py", line 479, in pconnect
    raise _get_exception(inst)
ibm_db_dbi.OperationalError: ibm_db_dbi::OperationalError: [IBM][CLI Driver] 
SQL30081N  A communication error has been detected. Communication protocol 
being used: "TCP/IP".  Communication API being used: "SOCKETS".  Location where 
the error was detected: "10.90.176.103".  Communication function detecting the 
error: "recv".  Protocol specific error code(s): "*", "*", "0".  SQLSTATE=08001 
SQLCODE=-30081

Original comment by vsrivas...@gmail.com on 24 Nov 2010 at 1:48

GoogleCodeExporter commented 9 years ago
Add following entry in your /opt/IBM/informix/etc/sqlhosts file:
berttcpDbServer_ids     onsoctcp        bert  9090
berttcpDbServer_drda    drsoctcp        bert  9091

and update PORT no of settings.py to 9091.

Original comment by rahul.pr...@in.ibm.com on 25 Nov 2010 at 7:01

GoogleCodeExporter commented 9 years ago
I made the changes as suggested, but am getting the following errors when 
running python manage.py test:

Following is my configuration:
$ cat settings.py
...
DATABASES = {
    'default': {
        'ENGINE': 'ibm_db_django', 
        'NAME': 'mydb',  
        # if I use mydb@berttcpDbServer_ids or mydb@berttcpDbServer_drda 
        # I get message saying db not found on remote server
        'USER': 'myuser', 
        'PASSWORD': 'mypassword',    
        'HOST': 'bert',    
        'PORT': '9091',   
    }
}
...

----------------------
$ python manage.py test

Preparing Database...
Creating table auth_permission
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/commands/test.py", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/test/simple.py", line 313, in run_tests
    old_config = self.setup_databases()
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/test/simple.py", line 270, in setup_databases
    connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
  File "/usr/local/lib/python2.6/dist-packages/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/creation.py", line 123, in create_test_db
    call_command( 'syncdb', database = self.connection.alias, verbosity = verbosity, interactive = False )
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/management/commands/syncdb.py", line 95, in handle_noargs
    cursor.execute(statement)
  File "/usr/local/lib/python2.6/dist-packages/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/pybase.py", line 100, in execute
    return super( DB2CursorWrapper, self ).execute( operation, parameters )
  File "/usr/local/lib/python2.6/dist-packages/ibm_db-1.0.3-py2.6-linux-i686.egg/ibm_db_dbi.py", line 1153, in execute
    self._execute_helper(None, parameters)
  File "/usr/local/lib/python2.6/dist-packages/ibm_db-1.0.3-py2.6-linux-i686.egg/ibm_db_dbi.py", line 1073, in _execute_helper
    raise _get_exception(inst)
django.db.utils.DatabaseError: Statement Execute Failed: [IBM][CLI 
Driver][IDS/UNIX64] A syntax error has occurred. SQLCODE=-201

Original comment by vsrivas...@gmail.com on 29 Nov 2010 at 4:44

GoogleCodeExporter commented 9 years ago
Hi Vsrivastav,

As you will see in our supported databases list of the ibm_db_django adapter 
and in this post 
http://groups.google.com/group/ibm_db/browse_frm/thread/72b3a1215acab49/79ec8e89
b9714d1e?lnk=gst&q=Informix+IDS#79ec8e89b9714d1e only the ibm_db & ibm_db_dbi 
has been fully tested with IDS & Django is still in the list of to be supported.

The above error you got because the generated sql of CREATE TABLE for 
“AUTH_PERMISSION” table is not compatible with IDS. 

We havent done the work yet to ensure that with IDS, in all cases, we are 
generating the right IDS SQL syntax. This is the work to be done to move IDS 
into the list of supported databases for ibm_db_django. This is a pending 
work-item which we have never had a chance to get to yet. Any chance that you 
would be interested in contributing to this effort...ibm_db_django is an 
opensource adaptor so, you can also become a contributor by signing 
contribution agreement which is available at 
http://code.google.com/p/ibm-db/wiki/Contributions and your code will get 
committed after due review

Thanks,
Rahul Priyadarshi

Original comment by rahul.pr...@in.ibm.com on 1 Dec 2010 at 12:06

GoogleCodeExporter commented 9 years ago
I would definitely like to help. I will send the contribution agreement when I 
have some changes.
I appreciate your timely responses and help.
Vivek

Original comment by vsrivas...@gmail.com on 2 Dec 2010 at 3:51

GoogleCodeExporter commented 9 years ago
What is sysibm.sysdummy1 database?

dhcp-64-100-85-50:dtacs vivsriva$ python manage.py test
Preparing Database...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_flatpage_sites
Creating table django_flatpage
Creating table django_redirect
Creating table django_comments
Creating table django_comment_flags
Creating table django_admin_log
/Library/Python/2.6/site-packages/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/i
bm_db_dbi.py:60: DeprecationWarning: BaseException.message has been deprecated 
as of Python 2.6
  self.message = message
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.6/site-packages/django/core/management/commands/test.py", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Library/Python/2.6/site-packages/django/test/simple.py", line 313, in run_tests
    old_config = self.setup_databases()
  File "/Library/Python/2.6/site-packages/django/test/simple.py", line 270, in setup_databases
    connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/creation.py", line 123, in create_test_db
    call_command( 'syncdb', database = self.connection.alias, verbosity = verbosity, interactive = False )
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 103, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/Library/Python/2.6/site-packages/django/core/management/sql.py", line 185, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/Library/Python/2.6/site-packages/django/dispatch/dispatcher.py", line 162, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 25, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/Library/Python/2.6/site-packages/django/contrib/contenttypes/models.py", line 38, in get_for_model
    defaults = {'name': smart_unicode(opts.verbose_name_raw)},
  File "/Library/Python/2.6/site-packages/django/db/models/manager.py", line 135, in get_or_create
    return self.get_query_set().get_or_create(**kwargs)
  File "/Library/Python/2.6/site-packages/django/db/models/query.py", line 373, in get_or_create
    obj.save(force_insert=True, using=self.db)
  File "/Library/Python/2.6/site-packages/django/db/models/base.py", line 434, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/Library/Python/2.6/site-packages/django/db/models/base.py", line 527, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/Library/Python/2.6/site-packages/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/Library/Python/2.6/site-packages/django/db/models/query.py", line 1479, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py", line 789, in execute_sql
    self.query.model._meta.db_table, self.query.model._meta.pk.column)
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/operations.py", line 113, in last_insert_id
    return cursor.last_identity_val
  File "/Library/Python/2.6/site-packages/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/ibm_db_dbi.py", line 1132, in _get_last_identity_val
    raise _get_exception(inst)
ibm_db_dbi.OperationalError/Library/Python/2.6/site-packages/ibm_db-1.0.3-py2.6-
macosx-10.6-universal.egg/ibm_db_dbi.py:63: DeprecationWarning: 
BaseException.message has been deprecated as of Python 2.6
  return 'ibm_db_dbi::'+str(self.__class__.__name__)+': '+str(self.message)
: ibm_db_dbi::OperationalError: Statement Execute Failed: [IBM][CLI 
Driver][IDS/UNIX64] The specified table (sysibm.sysdummy1) is not in the 
database. SQLCODE=-206

Original comment by vsrivas...@gmail.com on 9 Dec 2010 at 3:41

GoogleCodeExporter commented 9 years ago
The "sysibm.sysdummy1"  table is a spacial in-memory table that can be used to 
discover the value of DB2 registers.
Here we are using it to get last generated identity value from the DB2 catalog.

you needs to change the sql to get last generated identity value for informix 
because "sysibm.sysdummy1" table is not available in Informix.

you can use "SELECT DBINFO('sqlca.sqlerrd1') FROM systables where tabid = 1" 
sql instead of "SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1" in 
ibm_db_dbi.py file at line number 1117.

Original comment by rahul.pr...@in.ibm.com on 9 Dec 2010 at 8:01

GoogleCodeExporter commented 9 years ago
ok changed the last_insert_id method. Now I am getting error about 
unique_together_index.
How do I resolve this?

dhcp-64-100-85-50:dtacs vivsriva$ python manage.py test
Preparing Database...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_flatpage_sites
Creating table django_flatpage
Creating table django_redirect
Creating table django_comments
Creating table django_comment_flags
Creating table django_admin_log
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.6/site-packages/django/core/management/commands/test.py", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Library/Python/2.6/site-packages/django/test/simple.py", line 313, in run_tests
    old_config = self.setup_databases()
  File "/Library/Python/2.6/site-packages/django/test/simple.py", line 270, in setup_databases
    connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/creation.py", line 123, in create_test_db
    call_command( 'syncdb', database = self.connection.alias, verbosity = verbosity, interactive = False )
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 137, in handle_noargs
    index_sql = connection.creation.sql_indexes_for_model(model, self.style)
  File "/Library/Python/2.6/site-packages/django/db/backends/creation.py", line 253, in sql_indexes_for_model
    output.extend(self.sql_indexes_for_field(model, f, style))
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/creation.py", line 63, in sql_indexes_for_field
    if len( model._meta.unique_together_index ) != 0:
AttributeError: 'Options' object has no attribute 'unique_together_index'

Original comment by vsrivas...@gmail.com on 9 Dec 2010 at 1:50

GoogleCodeExporter commented 9 years ago
Is there a way to print the SQL statement which is causing error?

Original comment by vsrivas...@gmail.com on 9 Dec 2010 at 2:19

GoogleCodeExporter commented 9 years ago
1. How do I fix the fixtures problem?
2. Why am I getting "Index already exists on the column (or on the set of 
columns)"?

Installing index for auth.Permission model
/Library/Python/2.6/site-packages/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/i
bm_db_dbi.py:60: DeprecationWarning: BaseException.message has been deprecated 
as of Python 2.6
  self.message = message
Failed to install index for auth.Permission model: Statement Execute Failed: 
[IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on the set 
of columns). SQLCODE=-350
Installing index for auth.Group_permissions model
Failed to install index for auth.Group_permissions model: Statement Execute 
Failed: [IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on 
the set of columns). SQLCODE=-350
Installing index for auth.User_user_permissions model
Failed to install index for auth.User_user_permissions model: Statement Execute 
Failed: [IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on 
the set of columns). SQLCODE=-350
Installing index for auth.User_groups model
Failed to install index for auth.User_groups model: Statement Execute Failed: 
[IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on the set 
of columns). SQLCODE=-350
Installing index for auth.Message model
Failed to install index for auth.Message model: Statement Execute Failed: 
[IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on the set 
of columns). SQLCODE=-350
Installing index for flatpages.FlatPage_sites model
Failed to install index for flatpages.FlatPage_sites model: Statement Execute 
Failed: [IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on 
the set of columns). SQLCODE=-350
Installing index for flatpages.FlatPage model
Installing index for redirects.Redirect model
Failed to install index for redirects.Redirect model: Statement Execute Failed: 
[IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on the set 
of columns). SQLCODE=-350
Installing index for comments.Comment model
Failed to install index for comments.Comment model: Statement Execute Failed: 
[IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on the set 
of columns). SQLCODE=-350
Installing index for comments.CommentFlag model
Failed to install index for comments.CommentFlag model: Statement Execute 
Failed: [IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on 
the set of columns). SQLCODE=-350
Installing index for admin.LogEntry model
Failed to install index for admin.LogEntry model: Statement Execute Failed: 
[IBM][CLI Driver][IDS/UNIX64] Index already exists on the column (or on the set 
of columns). SQLCODE=-350
No fixtures found.
....Problem installing fixture 
'/Library/Python/2.6/site-packages/django/contrib/auth/fixtures/authtestdata.jso
n': Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/django/core/management/commands/loaddata.py", line 172, in handle
    obj.save(using=using)
  File "/Library/Python/2.6/site-packages/django/core/serializers/base.py", line 165, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "/Library/Python/2.6/site-packages/django/db/models/base.py", line 496, in save_base
    manager.using(using).filter(pk=pk_val).exists())):
  File "/Library/Python/2.6/site-packages/django/db/models/query.py", line 496, in exists
    return self.query.has_results(using=self.db)
  File "/Library/Python/2.6/site-packages/django/db/models/sql/query.py", line 417, in has_results
    return bool(compiler.execute_sql(SINGLE))
  File "/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py", line 727, in execute_sql
    cursor.execute(sql, params)
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/pybase.py", line 100, in execute
    return super( DB2CursorWrapper, self ).execute( operation, parameters )
  File "/Library/Python/2.6/site-packages/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/ibm_db_dbi.py", line 1153, in execute
    self._execute_helper(None, parameters)
  File "/Library/Python/2.6/site-packages/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/ibm_db_dbi.py", line 1058, in _execute_helper
    for param in parameters:
Exception: SQLNumResultCols failed: [IBM][CLI Driver][IDS/UNIX64] A syntax 
error has occurred. SQLCODE=-201

Original comment by vsrivas...@gmail.com on 9 Dec 2010 at 4:54

GoogleCodeExporter commented 9 years ago
When I try to create Site object and save it, the following SQL is generated. 
Where should I look to fix this?

(Pdb) from django.contrib.sites.models import Site
(Pdb) from django.conf import settings
(Pdb) Site(id=settings.SITE_ID, domain="example.com", name="example.com").save()
SELECT a FROM ( SELECT a, ( ROW_NUMBER() OVER() ) AS "Z.__ROWNUM" FROM (  
SELECT (1) AS a FROM django_site WHERE  django_site.id = ?   ) AS M ) Z WHERE 
"Z.__ROWNUM" <= 1
(1,)
*** Exception: SQLNumResultCols failed: [IBM][CLI Driver][IDS/UNIX64] A syntax 
error has occurred. SQLCODE=-201

Original comment by vsrivas...@gmail.com on 10 Dec 2010 at 2:41

GoogleCodeExporter commented 9 years ago
ok found them in compiler.py and query.py

Original comment by vsrivas...@gmail.com on 10 Dec 2010 at 6:15

GoogleCodeExporter commented 9 years ago
The driver is generating the following insert statements:
1. Informix does not support True/False literals, which file would I change to 
replace them with "0/1".
2. How do I remove the 'u' prefix from string and date literals?

INSERT INTO auth_user (id, username, first_name, last_name, email, password, 
is_staff, is_active, is_superuser, last_login, date_joined) VALUES (?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?)
(1,
 u'testclient',
 u'Test',
 u'Client',
 u'testclient@example.com',
 u'sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161',
 False,
 True,
 False,
 u'2006-12-17 07:03:31',
 u'2006-12-17 07:03:31')

Original comment by vsrivas...@gmail.com on 10 Dec 2010 at 8:42

GoogleCodeExporter commented 9 years ago
>>>
File 
"/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_d
b_django/creation.py", line 63, in sql_indexes_for_field
    if len( model._meta.unique_together_index ) != 0:
AttributeError: 'Options' object has no attribute 'unique_together_index'
>>>
we defined 'unique_together_index' in 'sql_create_model' method of 
'DatabaseCreation' class, It resides in creation.py file. 
Flow should comes through 'sql_create_model' method to 'sql_indexes_for_field' 
for creation of each model. But somehow due to other errors flow is not coming 
in this way. You may put a check for 'unique_together_index' attribute through 
hasattr().

>>>
Is there a way to print the SQL statement which is causing error?
>>>
You can capture all the sqls through enabling CLI Trace. 

>>>
1. How do I fix the fixtures problem?
>>>
Are you talking about "NO fixtures found" problem?
This one is not an error because fixtures are used to load initial data or load 
bulk data into database. So, it is not necessary  that each test cases have its 
fixture.

>>>
Why am I getting "Index already exists on the column (or on the set of 
columns)"?
>>>
This may come if you rerun the test suit and prior created Indexes do not get 
flushed out. 

>>>
Informix does not support True/False literals, which file would I change to 
replace them with "0/1".
>>>
In pybase.py file there are two methods defined execute() and executemany() you 
can modify these two methods to do this.

>>>
How do I remove the 'u' prefix from string and date literals?
>>>
The prefix 'u' is used to denote Unicode data, so there is no need to remove 
this prefix. 

Original comment by rahul.pr...@in.ibm.com on 11 Dec 2010 at 9:01

GoogleCodeExporter commented 9 years ago
> You can capture all the sqls through enabling CLI Trace. 
V: How do I enable the CLI trace? I have not used CLI before so if you can 
point me how to set it up, it would help tremendously. 

>Are you talking about "NO fixtures found" problem?
>This one is not an error because fixtures are used to load initial data or 
load bulk data into database. So, it is not necessary  that each test cases 
have its fixture.
V: The python manage.py test gives following errors:

Problem installing fixture 
'/Library/Python/2.6/site-packages/django/contrib/auth/fixtures/authtestdata.jso
n': Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/django/core/management/commands/loaddata.py", line 172, in handle
    obj.save(using=using)
  File "/Library/Python/2.6/site-packages/django/core/serializers/base.py", line 165, in save
    models.Model.save_base(self.object, using=using, raw=True)
  File "/Library/Python/2.6/site-packages/django/db/models/base.py", line 527, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/Library/Python/2.6/site-packages/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/Library/Python/2.6/site-packages/django/db/models/query.py", line 1479, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py", line 783, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/Library/Python/2.6/site-packages/django/db/models/sql/compiler.py", line 727, in execute_sql
    cursor.execute(sql, params)
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db_django-1.0.1-py2.6.egg/ibm_db_django/pybase.py", line 113, in execute
    return super( DB2CursorWrapper, self ).execute( operation, parameters )
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/ibm_db_dbi.py", line 1165, in execute
    self._execute_helper(None, parameters)
  File "/Users/vivsriva/opt/local_python/lib/python/ibm_db-1.0.3-py2.6-macosx-10.6-universal.egg/ibm_db_dbi.py", line 1083, in _execute_helper
    raise _get_exception(inst)
DatabaseError: Statement Execute Failed: [IBM][CLI Driver][IDS/UNIX64] Data 
conversion error. SQLCODE=-415

I am assuming that the authtestdata.json is loaded into the database, but there 
is some problem with SQL being generated to load the data.

> The prefix 'u' is used to denote Unicode data, so there is no need to remove 
this prefix. 
V: In informix 11.50 I am getting syntax error when 'u' prefix is used.

Original comment by vsrivas...@gmail.com on 16 Dec 2010 at 10:09

GoogleCodeExporter commented 9 years ago
1) Refer following link to enable cli trace 
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db
2.luw.apdv.cli.doc/doc/c0007645.html

2) Through cli trace you can find, for which table this error is coming and for 
which data type column it would be.

3) This Unicode problem may comes when you database is not enabled for Unicode. 
so, create a Unicode supported database.

Original comment by rahul.pr...@in.ibm.com on 17 Dec 2010 at 9:03

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 16 Apr 2012 at 8:45