473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can't get LCHARVAR's with InformixDB

I'm using the InformixDB package, which has been a real lifesaver, but
I'm finding I can't get any data from the Informix LCHARVAR types.
They're coming in as empty strings.

The cursor._description for the field in question is:
('msg_text', 'lvarchar', 0, 0, None, None, 1)

Appreciate any help... thanks.

Aug 1 '06 #1
10 1485
On Tue, 2006-08-01 at 09:02, fh*****@gmail.com wrote:
I'm using the InformixDB package, which has been a real lifesaver, but
I'm finding I can't get any data from the Informix LCHARVAR types.
They're coming in as empty strings.

The cursor._description for the field in question is:
('msg_text', 'lvarchar', 0, 0, None, None, 1)

Appreciate any help... thanks.
What version are you using? I thought I fixed lvarchars a long time ago.

-Carsten
Aug 1 '06 #2

Carsten Haese wrote:
What version are you using? I thought I fixed lvarchars a long time ago.
2.2, with Python 2.4 on Windows... I installed via
InformixDB-2.2.win32-py2.4.exe

I can see the data with other tools... it's multi-line, stuff like
stack traces, etc., and many start with newlines... but whatever it is,
I'm consistently getting empty strings.

Aug 1 '06 #3
On Tue, 2006-08-01 at 09:27, fh*****@gmail.com wrote:
Carsten Haese wrote:
What version are you using? I thought I fixed lvarchars a long time ago.

2.2, with Python 2.4 on Windows... I installed via
InformixDB-2.2.win32-py2.4.exe
Hm, this certainly warrants further investigation. I don't use lvarchars
myself, so it's possible that I did something that accidentally broke
the output binding for lvarchars.

Could you possibly send me a minimal test script that shows the problem?
Also, in case it matters, I'd like to know which versions of IDS and
CSDK or Informix Connect you're using.

Thanks,

Carsten.
Aug 1 '06 #4

Carsten Haese wrote:
Could you possibly send me a minimal test script that shows the problem?
Also, in case it matters, I'd like to know which versions of IDS and
CSDK or Informix Connect you're using.

Here's a sample script:

sql = '''select msg_tx from dev_log'''
import informixdb
conn = informixdb.connect('mydb')
cursor = conn.cursor()
cursor.execute(sql)
print 'description is <%s>' % cursor.description
print cursor.fetchall()

Output is:
description is <('msg_tx', 'lvarchar', 0, 0, None, None, 1)>
[('',), ('',), ('',), ('',), ('',), ('',)]

But one of them should be:
'''Something:SomethingElse - going for 221 possibilities [User:
HOST-NAME\XYZZY]:
Id OtherData
5878 C
5968 X
6732 V
[many more lines like this]
'''

Some hunting around, and I found this:

C:\Program Files\Informix\Client-SDK\bin>esql
IBM Informix CSDK Version 2.80, IBM Informix-ESQL Version 9.52.TC1

Not sure what IDS is... the Informix Server version is: 9.3 FC3,
according to the DBA guy.

Thanks much.

Aug 1 '06 #5

Another thing...
Output is:
description is <('msg_tx', 'lvarchar', 0, 0, None, None, 1)>
The 0's worried me, as I could see where they could be used as parms to
allocate/trim things as necessary... just a thought.

Aug 1 '06 #6
On Tue, 2006-08-01 at 11:41, fh*****@gmail.com wrote:
Carsten Haese wrote:
Could you possibly send me a minimal test script that shows the problem?
Also, in case it matters, I'd like to know which versions of IDS and
CSDK or Informix Connect you're using.


Here's a sample script:

sql = '''select msg_tx from dev_log'''
import informixdb
conn = informixdb.connect('mydb')
cursor = conn.cursor()
cursor.execute(sql)
print 'description is <%s>' % cursor.description
print cursor.fetchall()
Thanks, but I can't use this to reproduce the problem. I'll need the
create table statement for dev_log.
Output is:
description is <('msg_tx', 'lvarchar', 0, 0, None, None, 1)>
[('',), ('',), ('',), ('',), ('',), ('',)]

But one of them should be:
'''Something:SomethingElse - going for 221 possibilities [User:
HOST-NAME\XYZZY]:
Id OtherData
5878 C
5968 X
6732 V
[many more lines like this]
'''

Some hunting around, and I found this:

C:\Program Files\Informix\Client-SDK\bin>esql
IBM Informix CSDK Version 2.80, IBM Informix-ESQL Version 9.52.TC1

Not sure what IDS is... the Informix Server version is: 9.3 FC3,
according to the DBA guy.
IDS = Informix Dynamic Server. The version numbers you gave me are what
I was looking for.

For what it's worth, I've tried a simple test script on my Linux server
that creates a temp table with an lvarchar column, inserts into it, and
reads from it, all without a problem. However, there are many
differences between my test environment and yours, and I'll need to know
your specific circumstances to isolate which difference is causing the
problem.

Thanks,

Carsten.
Aug 1 '06 #7
On Tue, 2006-08-01 at 11:47, fh*****@gmail.com wrote:
Another thing...
Output is:
description is <('msg_tx', 'lvarchar', 0, 0, None, None, 1)>

The 0's worried me, as I could see where they could be used as parms to
allocate/trim things as necessary... just a thought.
That is indeed a problem. For some as of yet undetermined reason, the
client thinks that msg_tx is a column of length zero, so it's no big
surprise that all you get back is empty strings. Once again, I'll need
the create table statement for the table you're selecting from in order
to investigate what's happening.

-Carsten
Aug 1 '06 #8

Carsten Haese wrote:
Once again, I'll need
the create table statement for the table you're selecting from in order
to investigate what's happening.
Here it is:

CREATE TABLE DEV_LOG(
LOG_ID SERIAL,
LEVEL VARCHAR (10),
POI_NM VARCHAR (255),
MSG_TX LVARCHAR(2000),
MSG2_TX LVARCHAR(5000)
) LOCK MODE ROW;

Thanks.

Aug 1 '06 #9
On Tue, 2006-08-01 at 14:05, fh*****@gmail.com wrote:
Carsten Haese wrote:
Once again, I'll need
the create table statement for the table you're selecting from in order
to investigate what's happening.

Here it is:

CREATE TABLE DEV_LOG(
LOG_ID SERIAL,
LEVEL VARCHAR (10),
POI_NM VARCHAR (255),
MSG_TX LVARCHAR(2000),
MSG2_TX LVARCHAR(5000)
) LOCK MODE ROW;
The following test script works fine for me:

---------------------------------------------------------
import informixdb

conn = informixdb.connect("mydb")
cur = conn.cursor()
cur.execute("""
CREATE temp TABLE DEV_LOG(
LOG_ID SERIAL,
LEVEL VARCHAR (10),
POI_NM VARCHAR (255),
MSG_TX LVARCHAR(2000),
MSG2_TX LVARCHAR(5000))""")
str1 = "ABCDEFGHIJ"*200
str2 = "ABCDEFGHIJ"*500
cur.execute("insert into dev_log values(?,?,?,?,?)",
(0,'MEDIUM','TESTMAN',str1,str2) )
cur.execute("select * from dev_log")
row = cur.fetchone()
assert row[3]==str1
assert row[4]==str2
print cur.description
---------------------------------------------------------

I have tested this two ways, once directly on the server on Linux, once
with a client-server connection from Windows to Linux. In both cases,
both lvarchars are being read back correctly. One notable difference
between your environment and mine is that I'm using CSDK version
2.90.TC3, which is more recent than the version of CSDK that you're
using.

I'd suggest upgrading to the newest version of CSDK. Please let me know
what happens after the upgrade.

-Carsten
Aug 1 '06 #10

Carsten Haese wrote:
I'd suggest upgrading to the newest version of CSDK. Please let me know
what happens after the upgrade.
That did the trick.... thanks very much.

Aug 5 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: farzad | last post by:
Hi I try to install php_ming.so in my php . I am using Redhat 8.0 php 4.2.2 apache 2.0.4. I am doing as the howto install file want me to do. as follow....
7
by: Adams-Blake Co. | last post by:
This may be OT a bit, so maybe someone can point me in the right direction. I want to test a script that sends out an e-mail. I want to test it locally on my Mandrake Linux 8.2 box. It runs OK...
3
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
6
by: Michel | last post by:
Hi, I like to build a small simple dinamic website: Point-of-sale (detail-shop), So entering stock, logging all sales, print out invoices and download the logs to be imported into Excel. I...
3
by: nadia | last post by:
Is it possible to do the following in php: I want to have a main form open. In the form I want a button that will open a popup window so the user can search for something. The user can then select...
6
by: lawrence | last post by:
How dangerous or stupid is it for an object to have a reference to the object which contains it? If I have a class called $controllerForAll which has an arrray of all the objects that exist, what...
0
by: Carsten Haese | last post by:
Hi Everybody: Since the current maintainer of the informixdb module appears to have gone missing, I have decided to take over the project. The new home of the informixdb module is...
0
by: Carsten Haese | last post by:
Hi Everybody: I have released a new version, version 1.5, of InformixDB, the DB-API module for connecting to IBM Informix database engines. Download at...
28
by: Stef Mientki | last post by:
hello, I'm trying to build a simple functional simulator for JAL (a Pascal-like language for PICs). My first action is to translate the JAL code into Python code. The reason for this approach is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.