The lecture you told me didn't solve my problem with clob fields.
the code I use to get the data I need for my application is the following:
...
from mod_python import apache, Session, psp, util
from string import Template
...
_result = req.session['cnn'].prepare('CALL
"GestionePratiche"."spIncassiPosizione" (%s)' % req.session['CL']).execute()
if _result.first() is None:
tmpl = psp.PSP(req, filename='C:/Programmi/Apache
Group/Apache2/htdocs/GestionePratiche/templates/NoData.html')
tmpl.run(vars)
return
_columndata = [col[0] for col in _result.getDescription()]
_columnformat = [col[1] for col in _result.getDescription()]
_formats = {}
i=0
for el in _columnformat:
if el == 'Fixed':
_formats[i]= "locale.format('%.2f',float(el[i]), 1)"
elif el == 'Date':
_formats[i]= "el[i][-2:] + '.' + el[i][4:6] + '.' + el[i][:4]"
elif el == 'Long':
_formats[i]='el[i].read(20)'
else:
_formats[i]='el[i]'
i+=1
tmp_Incassi=Template("""
<tr>
<td class="RigoSXTabella">$DataContabile</td>
<td class="RigoCXTabella">$Importo</td>
<td class="RigoCXTabella"><A
onmouseover="this.T_SHADOWWIDTH=5;this.T_WIDTH=200;this.T_PADDING=2;return
escape('$DescrizioneCausale');"
href="javascript:void(0);">$Causale</A></td>
<td class="RigoCXTabella">$DataValuta</td>
<td class="RigoDXTabella">$Note</td>
</tr>""")
tmp_Incassi_body=Template("""
<div >
<table width="100%" cellpadding="2" cellspacing="0" >
<tr>
<th class="RigoSXTabella">Data Contabile </th>
<th class="RigoCXTabella">Importo</th>
<th class="RigoCXTabella">Causale</th>
<th class="RigoCXTabella">Data Valuta</th>
<th class="RigoDXTabella">Note</th>
</tr>
$Repeatable
</table>
</div>
""")
#carica i dati nell' array
data_vars={}
rep={}
rep['Repeatable']=''
for el in _result:
_result.next()
i=0
for col in _columndata:
data_vars[col]= eval(_formats[i])
req.write(col + ' : ' + str(eval(_formats[i])) + '\n' )
i+=1
rep['Repeatable'] += tmp_Incassi.safe_substitute(data_vars)
vars['IncassiPosizione_Body'] = tmp_Incassi_body.safe_substitute(rep)
return
The value present in field caled Note (column datatype= LONG) should be
"Versamento a deconto della posizione", but
the output i receive is :
DataContabile : 12.01.2005
Importo : 10.000,00
Causale : C50
DescrizioneCausale : INCASSO DA CONTRIBUTI
DataValuta : 13.01.2005
Note : della posizione
DataContabile : 12.02.2005
Importo : 10.000,00
Causale : C50
DescrizioneCausale : INCASSO DA CONTRIBUTI
DataValuta : 13.02.2005
Note : della posizione
DataContabile : 12.03.2005
Importo : 2.000,00
Causale : C50
DescrizioneCausale : INCASSO DA CONTRIBUTI
DataValuta : 13.03.2005
Note : della posizione
DataContabile : 12.04.2005
Importo : 2.000,00
Causale : C50
DescrizioneCausale : INCASSO DA CONTRIBUTI
DataValuta : 13.04.2005
Note : della posizione
DataContabile : 12.03.2005
Importo : 2.000,00
Causale : C50
DescrizioneCausale : INCASSO DA CONTRIBUTI
DataValuta : 13.03.2005
Note : della posizione
DataContabile : 12.04.2005
Importo : 2.000,00
Causale : C50
DescrizioneCausale : INCASSO DA CONTRIBUTI
DataValuta : 13.04.2005
Note : della posizione
please help me !
----- Original Message -----
From: "Dittmar, Daniel" <[EMAIL PROTECTED]>
To: "Luca Calderano" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Tuesday, June 20, 2006 11:25 AM
Subject: RE: python interface and clob column
>
> >Can someone tell me how to read data from clob columns via the
> >maxdb python interface ?
>
> The Python interfaces (sdb.sql and sql.dbapi) use SapDB_LongReader
> objects,
> see
> http://dev.mysql.com/doc/maxdb/en/59/0369eb4b5bff4781935cbecd7f248a/fram
> eset.htm.
>
> For INSERTs und UPDATEs of lobs, you can use either strings or the read
> method of file objects.
>
> Daniel Dittmar
>
> --
> Daniel Dittmar
> SAP Labs Berlin
> [EMAIL PROTECTED]
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>
>
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]