Datastore identity column problem

Hi, I have a datastore that contains a datawindow that has
an
identity column and after I update the datastore I want to
get
the value of that column to assign it to the detail table. I
have tried directly and with the getitemnumber function and
it returns
null. I checked the update function return value and is 1
(Ok)

Do we have a problem with the datastore or maybe this doesnt
work with datastore.

Your comments are welcome to help me in this situation

Angel
0
AngelI
12/17/2010 9:37:09 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

11 Replies
966 Views

Similar Articles

[PageSpeed] 7

Hi Angel;

    Can you tell us ...

1) Version of PB
2) Your DBMS & version
3) How are you connecting to the DBMS
4) Is this an Insert operation?
5) Does the table have a Trigger on it?
6) Is the identity column marked as AutoSeq or AutoIncrement?
7) Have you tried using a ReSelectRow ( ) function after the update?

Regards ... Chris
President: OSUG / STD Inc.
Blog: http://chrispollach.blogspot.com
PBDJ: http://chrispollach.sys-con.com
SourceForge: http://sourceforge.net/projects/stdfndclass

"AngelI" wrote in message news:4d0bd805.14f.1681692777@sybase.com... 

Hi, I have a datastore that contains a datawindow that has
an
identity column and after I update the datastore I want to
get
the value of that column to assign it to the detail table. I
have tried directly and with the getitemnumber function and
it returns
null. I checked the update function return value and is 1
(Ok)

Do we have a problem with the datastore or maybe this doesnt
work with datastore.

Your comments are welcome to help me in this situation

Angel
0
Chris
12/17/2010 11:24:42 PM
> Hi Angel;
>
>     Can you tell us ...
>
> 1) Version of PB
I am using PB 11.5.1
> 2) Your DBMS & version
I am using SQL Server 2005 SP1
> 3) How are you connecting to the DBMS
SNC
> 4) Is this an Insert operation?
Yes is an Insert
> 5) Does the table have a Trigger on it?
No Trigger
> 6) Is the identity column marked as AutoSeq or
> AutoIncrement?
Autoincrement
7) Have you tried using a ReSelectRow ( )
> function after the update?
Not possible with PB11.5.1
>
> Regards ... Chris
> President: OSUG / STD Inc.
> Blog: http://chrispollach.blogspot.com
> PBDJ: http://chrispollach.sys-con.com
> SourceForge: http://sourceforge.net/projects/stdfndclass
>
> "AngelI" wrote in message
> news:4d0bd805.14f.1681692777@sybase.com...
>
> Hi, I have a datastore that contains a datawindow that has
> an
> identity column and after I update the datastore I want to
> get
> the value of that column to assign it to the detail table.
> I have tried directly and with the getitemnumber function
> and it returns
> null. I checked the update function return value and is 1
> (Ok)
>
> Do we have a problem with the datastore or maybe this
> doesnt work with datastore.
>
> Your comments are welcome to help me in this situation
>
> Angel
0
AngelI
12/20/2010 4:19:23 PM
The table obviously has the identity property set on the column. Does 
the datawindow also have the column marked as an identity column? 
(Bottom of the Update Properties screen.)

You could try tracing your database connection to make sure that PB is 
actually trying to get the value back from the db. Add "TRACE " to the 
beginning of your SQLCA.DBMS setting, like "TRACE ODBC" or "TRACE OLEDB" 
or "TRACE whatever".




On 12/20/2010 10:19 AM, AngelI wrote:
>> Hi Angel;
>>
>>      Can you tell us ...
>>
>> 1) Version of PB
> I am using PB 11.5.1
>> 2) Your DBMS&  version
> I am using SQL Server 2005 SP1
>> 3) How are you connecting to the DBMS
> SNC
>> 4) Is this an Insert operation?
> Yes is an Insert
>> 5) Does the table have a Trigger on it?
> No Trigger
>> 6) Is the identity column marked as AutoSeq or
>> AutoIncrement?
> Autoincrement
> 7) Have you tried using a ReSelectRow ( )
>> function after the update?
> Not possible with PB11.5.1
>>
>> Regards ... Chris
>> President: OSUG / STD Inc.
>> Blog: http://chrispollach.blogspot.com
>> PBDJ: http://chrispollach.sys-con.com
>> SourceForge: http://sourceforge.net/projects/stdfndclass
>>
>> "AngelI" wrote in message
>> news:4d0bd805.14f.1681692777@sybase.com...
>>
>> Hi, I have a datastore that contains a datawindow that has
>> an
>> identity column and after I update the datastore I want to
>> get
>> the value of that column to assign it to the detail table.
>> I have tried directly and with the getitemnumber function
>> and it returns
>> null. I checked the update function return value and is 1
>> (Ok)
>>
>> Do we have a problem with the datastore or maybe this
>> doesnt work with datastore.
>>
>> Your comments are welcome to help me in this situation
>>
>> Angel
0
Jason
12/20/2010 4:39:24 PM
The column is marked as identity in the Update properties.

I did made the trace and it is not trying to get the value
from the database.

(7971818): INSERT INTO Movimiento_Almacen_H ( Prefijo,
Fecha, Almacen_Entrada, Razon, Autor, Estatus_Documento )
VALUES ( 2010, '2010-12-20 15:59:14.347', 12, 'Reposici=f3n
Almac=e9n. Salida: 2. Entrada: 12', 208, 'A' ) (6.181 MS /
942.195 MS)
(7971818): EXECUTE: (0.001 MS / 942.196 MS)
(7971818): *** ERROR 2812 ***(rc -1) : SQLSTATE =3d 42000
Microsoft SQL Native Client
Could not find stored procedure 'ib_disableclosequery'.
(7971818): PREPARE:
(7971818):   SELECT  Almacen.Almacen_ID ,          
Almacen.almacen_descripcion     FROM Almacen   ORDER BY
Almacen.almacen_descripcion          ASC   (4.121 MS /
946.317 MS)
(7971818): BIND SELECT OUTPUT BUFFER (DataWindow): (0.009 MS
/ 946.326 MS)
(7971818):
,len=3d80,type=3dLONG,pbt=3d22,dbt=3d0,ct=3d0,prec=3d0,scale=3d0
(7971818):
,len=3d41,type=3dCHAR,pbt=3d1,dbt=3d0,ct=3d0,prec=3d0,scale=3d0
(7971818): EXECUTE: (0.000 MS / 946.326 MS)
(7971818): FETCH NEXT: (0.041 MS / 946.367 MS)
(7971818): 	COLUMN=3d2	COLUMN=3dEspa=f1a #26
(7971818): FETCH NEXT: (0.002 MS / 946.369 MS)
(7971818): 	COLUMN=3d7	COLUMN=3dGurabo #1
(7971818): FETCH NEXT: (0.002 MS / 946.371 MS)
(7971818): 	COLUMN=3d9	COLUMN=3dGurabo #2
(7971818): FETCH NEXT: (0.001 MS / 946.372 MS)
(7971818): 	COLUMN=3d12	COLUMN=3dImbert
(7971818): FETCH NEXT: (0.002 MS / 946.374 MS)
(7971818): 	COLUMN=3d11	COLUMN=3dMakita Sto Dgo
(7971818): FETCH NEXT: (0.002 MS / 946.376 MS)
(7971818): 	COLUMN=3d8	COLUMN=3dMaterial Gastable
(7971818): FETCH NEXT: (0.002 MS / 946.378 MS)
(7971818): 	COLUMN=3d10	COLUMN=3dPontezuela
(7971818): FETCH NEXT: (0.002 MS / 946.380 MS)
(7971818): 	COLUMN=3d1	COLUMN=3dPrincipal
(7971818): FETCH NEXT: (0.002 MS / 946.382 MS)
(7971818): 	COLUMN=3d6	COLUMN=3dRecepcion Mercancias
(7971818): FETCH NEXT: (0.004 MS / 946.386 MS)
(7971818): 	COLUMN=3d5	COLUMN=3dTercera Planta
(7971818): FETCH NEXT: (0.005 MS / 946.391 MS)
(7971818): 	COLUMN=3d99	COLUMN=3dTransito
(7971818): FETCH NEXT: (0.038 MS / 946.429 MS)
(7971818): *** DBI_FETCHEND *** (rc 100)
(7971818): PREPARE:
(7971818): INSERT INTO Movimiento_Almacen_D ( Cantidad,
Articulo_ID, Almacen_Salida, Movido ) VALUES ( 1.0000,
42608, 2, 0 ) (6.399 MS / 952.828 MS)
(7971818): *** ERROR 515 ***(rc -1) : SQLSTATE =3d 23000
Microsoft SQL Native Client
Cannot insert the value NULL into column 'MA_ID', table
'Bellon.dbo.Movimiento_Almacen_D'; column does not allow
nulls. INSERT fails.

> The table obviously has the identity property set on the
> column. Does  the datawindow also have the column marked
> as an identity column?  (Bottom of the Update Properties
> screen.)
>
> You could try tracing your database connection to make
> sure that PB is  actually trying to get the value back
> from the db. Add "TRACE " to the  beginning of your
> SQLCA.DBMS setting, like "TRACE ODBC" or "TRACE OLEDB"  or
> "TRACE whatever".
>
>
>
>
> On 12/20/2010 10:19 AM, AngelI wrote:
> >> Hi Angel;
> >>
> >>      Can you tell us ...
> >>
> >> 1) Version of PB
> > I am using PB 11.5.1
> >> 2) Your DBMS&  version
> > I am using SQL Server 2005 SP1
> >> 3) How are you connecting to the DBMS
> > SNC
> >> 4) Is this an Insert operation?
> > Yes is an Insert
> >> 5) Does the table have a Trigger on it?
> > No Trigger
> >> 6) Is the identity column marked as AutoSeq or
> >> AutoIncrement?
> > Autoincrement
> > 7) Have you tried using a ReSelectRow ( )
> >> function after the update?
> > Not possible with PB11.5.1
> >>
> >> Regards ... Chris
> >> President: OSUG / STD Inc.
> >> Blog: http://chrispollach.blogspot.com
> >> PBDJ: http://chrispollach.sys-con.com
> >> SourceForge:
> http://sourceforge.net/projects/stdfndclass >>
> >> "AngelI" wrote in message
> >> news:4d0bd805.14f.1681692777@sybase.com...
> >>
> >> Hi, I have a datastore that contains a datawindow that
> has >> an
> >> identity column and after I update the datastore I want
> to >> get
> >> the value of that column to assign it to the detail
> table. >> I have tried directly and with the getitemnumber
> function >> and it returns
> >> null. I checked the update function return value and is
> 1 >> (Ok)
> >>
> >> Do we have a problem with the datastore or maybe this
> >> doesnt work with datastore.
> >>
> >> Your comments are welcome to help me in this situation
> >>
> >> Angel
0
AngelI
12/20/2010 8:10:37 PM
I see two INSERT statements in your trace file. Both statements show 
that they failed. If the row didn't get inserted, then no identity value 
would have been generated.

For your insert into Movimiento_Almacen_H, you need to see why it's 
trying to access a stored procedure called 'ib_disableclosequery'. That 
looks like a PB variable name. Did you forget a colon(:)?

For your insert into Movimiento_Almacen_D, it's complaining about a NULL 
value for MA_ID. Is that supposed to be the identity value from the 
first insert? If not, then that's a second thing you might need to look 
into. (I don't even see that column listed in the insert statement.)



On 12/20/2010 2:10 PM, AngelI wrote:
> The column is marked as identity in the Update properties.
>
> I did made the trace and it is not trying to get the value
> from the database.
>
> (7971818): INSERT INTO Movimiento_Almacen_H ( Prefijo,
> Fecha, Almacen_Entrada, Razon, Autor, Estatus_Documento )
> VALUES ( 2010, '2010-12-20 15:59:14.347', 12, 'Reposici�n
> Almac�n. Salida: 2. Entrada: 12', 208, 'A' ) (6.181 MS /
> 942.195 MS)
> (7971818): EXECUTE: (0.001 MS / 942.196 MS)
> (7971818): *** ERROR 2812 ***(rc -1) : SQLSTATE = 42000
> Microsoft SQL Native Client
> Could not find stored procedure 'ib_disableclosequery'.
> (7971818): PREPARE:
> (7971818):   SELECT  Almacen.Almacen_ID ,
> Almacen.almacen_descripcion     FROM Almacen   ORDER BY
> Almacen.almacen_descripcion          ASC   (4.121 MS /
> 946.317 MS)
> (7971818): BIND SELECT OUTPUT BUFFER (DataWindow): (0.009 MS
> / 946.326 MS)
> (7971818):
> ,len=80,type=LONG,pbt=22,dbt=0,ct=0,prec=0,scale=0
> (7971818):
> ,len=41,type=CHAR,pbt=1,dbt=0,ct=0,prec=0,scale=0
> (7971818): EXECUTE: (0.000 MS / 946.326 MS)
> (7971818): FETCH NEXT: (0.041 MS / 946.367 MS)
> (7971818): 	COLUMN=2	COLUMN=Espa�a #26
> (7971818): FETCH NEXT: (0.002 MS / 946.369 MS)
> (7971818): 	COLUMN=7	COLUMN=Gurabo #1
> (7971818): FETCH NEXT: (0.002 MS / 946.371 MS)
> (7971818): 	COLUMN=9	COLUMN=Gurabo #2
> (7971818): FETCH NEXT: (0.001 MS / 946.372 MS)
> (7971818): 	COLUMN=12	COLUMN=Imbert
> (7971818): FETCH NEXT: (0.002 MS / 946.374 MS)
> (7971818): 	COLUMN=11	COLUMN=Makita Sto Dgo
> (7971818): FETCH NEXT: (0.002 MS / 946.376 MS)
> (7971818): 	COLUMN=8	COLUMN=Material Gastable
> (7971818): FETCH NEXT: (0.002 MS / 946.378 MS)
> (7971818): 	COLUMN=10	COLUMN=Pontezuela
> (7971818): FETCH NEXT: (0.002 MS / 946.380 MS)
> (7971818): 	COLUMN=1	COLUMN=Principal
> (7971818): FETCH NEXT: (0.002 MS / 946.382 MS)
> (7971818): 	COLUMN=6	COLUMN=Recepcion Mercancias
> (7971818): FETCH NEXT: (0.004 MS / 946.386 MS)
> (7971818): 	COLUMN=5	COLUMN=Tercera Planta
> (7971818): FETCH NEXT: (0.005 MS / 946.391 MS)
> (7971818): 	COLUMN=99	COLUMN=Transito
> (7971818): FETCH NEXT: (0.038 MS / 946.429 MS)
> (7971818): *** DBI_FETCHEND *** (rc 100)
> (7971818): PREPARE:
> (7971818): INSERT INTO Movimiento_Almacen_D ( Cantidad,
> Articulo_ID, Almacen_Salida, Movido ) VALUES ( 1.0000,
> 42608, 2, 0 ) (6.399 MS / 952.828 MS)
> (7971818): *** ERROR 515 ***(rc -1) : SQLSTATE = 23000
> Microsoft SQL Native Client
> Cannot insert the value NULL into column 'MA_ID', table
> 'Bellon.dbo.Movimiento_Almacen_D'; column does not allow
> nulls. INSERT fails.
>
>> The table obviously has the identity property set on the
>> column. Does  the datawindow also have the column marked
>> as an identity column?  (Bottom of the Update Properties
>> screen.)
>>
>> You could try tracing your database connection to make
>> sure that PB is  actually trying to get the value back
>> from the db. Add "TRACE " to the  beginning of your
>> SQLCA.DBMS setting, like "TRACE ODBC" or "TRACE OLEDB"  or
>> "TRACE whatever".
>>
>>
>>
>>
>> On 12/20/2010 10:19 AM, AngelI wrote:
>>>> Hi Angel;
>>>>
>>>>       Can you tell us ...
>>>>
>>>> 1) Version of PB
>>> I am using PB 11.5.1
>>>> 2) Your DBMS&   version
>>> I am using SQL Server 2005 SP1
>>>> 3) How are you connecting to the DBMS
>>> SNC
>>>> 4) Is this an Insert operation?
>>> Yes is an Insert
>>>> 5) Does the table have a Trigger on it?
>>> No Trigger
>>>> 6) Is the identity column marked as AutoSeq or
>>>> AutoIncrement?
>>> Autoincrement
>>> 7) Have you tried using a ReSelectRow ( )
>>>> function after the update?
>>> Not possible with PB11.5.1
>>>>
>>>> Regards ... Chris
>>>> President: OSUG / STD Inc.
>>>> Blog: http://chrispollach.blogspot.com
>>>> PBDJ: http://chrispollach.sys-con.com
>>>> SourceForge:
>> http://sourceforge.net/projects/stdfndclass>>
>>>> "AngelI" wrote in message
>>>> news:4d0bd805.14f.1681692777@sybase.com...
>>>>
>>>> Hi, I have a datastore that contains a datawindow that
>> has>>  an
>>>> identity column and after I update the datastore I want
>> to>>  get
>>>> the value of that column to assign it to the detail
>> table.>>  I have tried directly and with the getitemnumber
>> function>>  and it returns
>>>> null. I checked the update function return value and is
>> 1>>  (Ok)
>>>>
>>>> Do we have a problem with the datastore or maybe this
>>>> doesnt work with datastore.
>>>>
>>>> Your comments are welcome to help me in this situation
>>>>
>>>> Angel
0
Jason
12/20/2010 8:26:52 PM
To add to Jason's response.

It appears that the two errors have escaped your attention - which indicates 
that you are using a standard datastore which has no code in the dberror 
event.  This means that all errors are escaping your application without 
detection.  You will need to add your own error-checking/handling code for 
this to be successful. 


0
Scott
12/20/2010 8:51:20 PM
I just put the code of the header table to update. It
updates correct and it saves it to the DB, but even after
the commit I get a null value when I try to get the identity
column.

This has never happened to me

> The column is marked as identity in the Update properties.
>
> I did made the trace and it is not trying to get the value
> from the database.
>
> (7971818): INSERT INTO Movimiento_Almacen_H ( Prefijo,
> Fecha, Almacen_Entrada, Razon, Autor, Estatus_Documento )
> VALUES ( 2010, '2010-12-20 15:59:14.347', 12,
'Reposici=f3n
> Almac=e9n. Salida: 2. Entrada: 12', 208, 'A' ) (6.181 MS /
> 942.195 MS)
> (7971818): EXECUTE: (0.001 MS / 942.196 MS)
> (7971818): *** ERROR 2812 ***(rc -1) : SQLSTATE =3d 42000
> Microsoft SQL Native Client
> Could not find stored procedure 'ib_disableclosequery'.
> (7971818): PREPARE:
> (7971818):   SELECT  Almacen.Almacen_ID ,
> Almacen.almacen_descripcion     FROM Almacen   ORDER BY
> Almacen.almacen_descripcion          ASC   (4.121 MS /
> 946.317 MS)
> (7971818): BIND SELECT OUTPUT BUFFER (DataWindow): (0.009
> MS / 946.326 MS)
> (7971818):
>
,len=3d80,type=3dLONG,pbt=3d22,dbt=3d0,ct=3d0,prec=3d0,scale=3d0
> (7971818):
>
,len=3d41,type=3dCHAR,pbt=3d1,dbt=3d0,ct=3d0,prec=3d0,scale=3d0
> (7971818): EXECUTE: (0.000 MS / 946.326 MS)
> (7971818): FETCH NEXT: (0.041 MS / 946.367 MS)
> (7971818):     COLUMN=3d2    COLUMN=3dEspa=f1a #26
> (7971818): FETCH NEXT: (0.002 MS / 946.369 MS)
> (7971818):     COLUMN=3d7    COLUMN=3dGurabo #1
> (7971818): FETCH NEXT: (0.002 MS / 946.371 MS)
> (7971818):     COLUMN=3d9    COLUMN=3dGurabo #2
> (7971818): FETCH NEXT: (0.001 MS / 946.372 MS)
> (7971818):     COLUMN=3d12    COLUMN=3dImbert
> (7971818): FETCH NEXT: (0.002 MS / 946.374 MS)
> (7971818):     COLUMN=3d11    COLUMN=3dMakita Sto Dgo
> (7971818): FETCH NEXT: (0.002 MS / 946.376 MS)
> (7971818):     COLUMN=3d8    COLUMN=3dMaterial Gastable
> (7971818): FETCH NEXT: (0.002 MS / 946.378 MS)
> (7971818):     COLUMN=3d10    COLUMN=3dPontezuela
> (7971818): FETCH NEXT: (0.002 MS / 946.380 MS)
> (7971818):     COLUMN=3d1    COLUMN=3dPrincipal
> (7971818): FETCH NEXT: (0.002 MS / 946.382 MS)
> (7971818):     COLUMN=3d6    COLUMN=3dRecepcion Mercancias
> (7971818): FETCH NEXT: (0.004 MS / 946.386 MS)
> (7971818):     COLUMN=3d5    COLUMN=3dTercera Planta
> (7971818): FETCH NEXT: (0.005 MS / 946.391 MS)
> (7971818):     COLUMN=3d99    COLUMN=3dTransito
> (7971818): FETCH NEXT: (0.038 MS / 946.429 MS)
> (7971818): *** DBI_FETCHEND *** (rc 100)
> (7971818): PREPARE:
> (7971818): INSERT INTO Movimiento_Almacen_D ( Cantidad,
> Articulo_ID, Almacen_Salida, Movido ) VALUES ( 1.0000,
> 42608, 2, 0 ) (6.399 MS / 952.828 MS)
> (7971818): *** ERROR 515 ***(rc -1) : SQLSTATE =3d 23000
> Microsoft SQL Native Client
> Cannot insert the value NULL into column 'MA_ID', table
> 'Bellon.dbo.Movimiento_Almacen_D'; column does not allow
> nulls. INSERT fails.
>
> > The table obviously has the identity property set on the
> > column. Does  the datawindow also have the column marked
> > as an identity column?  (Bottom of the Update Properties
> > screen.)
> >
> > You could try tracing your database connection to make
> > sure that PB is  actually trying to get the value back
> > from the db. Add "TRACE " to the  beginning of your
> > SQLCA.DBMS setting, like "TRACE ODBC" or "TRACE OLEDB"
> > or "TRACE whatever".
> >
> >
> >
> >
> > On 12/20/2010 10:19 AM, AngelI wrote:
> > >> Hi Angel;
> > >>
> > >>      Can you tell us ...
> > >>
> > >> 1) Version of PB
> > > I am using PB 11.5.1
> > >> 2) Your DBMS&  version
> > > I am using SQL Server 2005 SP1
> > >> 3) How are you connecting to the DBMS
> > > SNC
> > >> 4) Is this an Insert operation?
> > > Yes is an Insert
> > >> 5) Does the table have a Trigger on it?
> > > No Trigger
> > >> 6) Is the identity column marked as AutoSeq or
> > >> AutoIncrement?
> > > Autoincrement
> > > 7) Have you tried using a ReSelectRow ( )
> > >> function after the update?
> > > Not possible with PB11.5.1
> > >>
> > >> Regards ... Chris
> > >> President: OSUG / STD Inc.
> > >> Blog: http://chrispollach.blogspot.com
> > >> PBDJ: http://chrispollach.sys-con.com
> > >> SourceForge:
> > http://sourceforge.net/projects/stdfndclass >>
> > >> "AngelI" wrote in message
> > >> news:4d0bd805.14f.1681692777@sybase.com...
> > >>
> > >> Hi, I have a datastore that contains a datawindow
> > that has >> an
> > >> identity column and after I update the datastore I
> > want to >> get
> > >> the value of that column to assign it to the detail
> > table. >> I have tried directly and with the
> > getitemnumber function >> and it returns
> > >> null. I checked the update function return value and
> > is 1 >> (Ok)
> > >>
> > >> Do we have a problem with the datastore or maybe this
> > >> doesnt work with datastore.
> > >>
> > >> Your comments are welcome to help me in this
> > situation >>
> > >> Angel
0
AngelI
12/21/2010 10:18:05 PM
<AngelI> wrote in message news:4d11279d.30f.1681692777@sybase.com...
>I just put the code of the header table to update. It
>updates correct and it saves it to the DB, but even after
>the commit I get a null value when I try to get the identity
>column.
>
>This has never happened to me

At this point, there isn't enough useful information to make any further 
suggestions.  I did notice an error in the trace you posted ("(7971818): *** 
ERROR 2812 ***(rc -1) : SQLSTATE = 42000 Microsoft SQL Native Client Could 
not find stored procedure 'ib_disableclosequery'.") that seems to indicate 
some issues with the values you have set for your transaction object (or 
perhaps some code that is attempting to override standard PB update 
behavior).

If you are new to the SNC interface or the version of PB that you are using, 
it would be helpful to know that and as well as the version/interface you 
previously used.  It would also help to see the actual values you use to 
populate your transaction object before connecting to the database.

Lastly, you might find it helpful to the the MS Profiler tool that comes 
with SQL Server. 


0
Scott
12/22/2010 2:00:17 PM
I did a test compiling the project and running the app and
for
my surprise it worked correctly.

I think the problem is in runtime mode and I have the latest
EBF.

At last I figured out what happened.

Thanks for all your help

> I just put the code of the header table to update. It
> updates correct and it saves it to the DB, but even after
> the commit I get a null value when I try to get the
> identity column.
>
> This has never happened to me
>
> > The column is marked as identity in the Update
> properties. >
> > I did made the trace and it is not trying to get the
> > value from the database.
> >
> > (7971818): INSERT INTO Movimiento_Almacen_H ( Prefijo,
> > Fecha, Almacen_Entrada, Razon, Autor, Estatus_Documento
> > ) VALUES ( 2010, '2010-12-20 15:59:14.347', 12,
> 'Reposici=f3n
> > Almac=e9n. Salida: 2. Entrada: 12', 208, 'A' ) (6.181 MS
/
> > 942.195 MS)
> > (7971818): EXECUTE: (0.001 MS / 942.196 MS)
> > (7971818): *** ERROR 2812 ***(rc -1) : SQLSTATE =3d
42000
> > Microsoft SQL Native Client
> > Could not find stored procedure 'ib_disableclosequery'.
> > (7971818): PREPARE:
> > (7971818):   SELECT  Almacen.Almacen_ID ,
> > Almacen.almacen_descripcion     FROM Almacen   ORDER BY
> > Almacen.almacen_descripcion          ASC   (4.121 MS /
> > 946.317 MS)
> > (7971818): BIND SELECT OUTPUT BUFFER (DataWindow):
> > (0.009 MS / 946.326 MS)
> > (7971818):
> >
>
,len=3d80,type=3dLONG,pbt=3d22,dbt=3d0,ct=3d0,prec=3d0,scale=3d0
> > (7971818):
> >
>
,len=3d41,type=3dCHAR,pbt=3d1,dbt=3d0,ct=3d0,prec=3d0,scale=3d0
> > (7971818): EXECUTE: (0.000 MS / 946.326 MS)
> > (7971818): FETCH NEXT: (0.041 MS / 946.367 MS)
> > (7971818):     COLUMN=3d2    COLUMN=3dEspa=f1a #26
> > (7971818): FETCH NEXT: (0.002 MS / 946.369 MS)
> > (7971818):     COLUMN=3d7    COLUMN=3dGurabo #1
> > (7971818): FETCH NEXT: (0.002 MS / 946.371 MS)
> > (7971818):     COLUMN=3d9    COLUMN=3dGurabo #2
> > (7971818): FETCH NEXT: (0.001 MS / 946.372 MS)
> > (7971818):     COLUMN=3d12    COLUMN=3dImbert
> > (7971818): FETCH NEXT: (0.002 MS / 946.374 MS)
> > (7971818):     COLUMN=3d11    COLUMN=3dMakita Sto Dgo
> > (7971818): FETCH NEXT: (0.002 MS / 946.376 MS)
> > (7971818):     COLUMN=3d8    COLUMN=3dMaterial Gastable
> > (7971818): FETCH NEXT: (0.002 MS / 946.378 MS)
> > (7971818):     COLUMN=3d10    COLUMN=3dPontezuela
> > (7971818): FETCH NEXT: (0.002 MS / 946.380 MS)
> > (7971818):     COLUMN=3d1    COLUMN=3dPrincipal
> > (7971818): FETCH NEXT: (0.002 MS / 946.382 MS)
> > (7971818):     COLUMN=3d6    COLUMN=3dRecepcion
Mercancias
> > (7971818): FETCH NEXT: (0.004 MS / 946.386 MS)
> > (7971818):     COLUMN=3d5    COLUMN=3dTercera Planta
> > (7971818): FETCH NEXT: (0.005 MS / 946.391 MS)
> > (7971818):     COLUMN=3d99    COLUMN=3dTransito
> > (7971818): FETCH NEXT: (0.038 MS / 946.429 MS)
> > (7971818): *** DBI_FETCHEND *** (rc 100)
> > (7971818): PREPARE:
> > (7971818): INSERT INTO Movimiento_Almacen_D ( Cantidad,
> > Articulo_ID, Almacen_Salida, Movido ) VALUES ( 1.0000,
> > 42608, 2, 0 ) (6.399 MS / 952.828 MS)
> > (7971818): *** ERROR 515 ***(rc -1) : SQLSTATE =3d 23000
> > Microsoft SQL Native Client
> > Cannot insert the value NULL into column 'MA_ID', table
> > 'Bellon.dbo.Movimiento_Almacen_D'; column does not allow
> > nulls. INSERT fails.
> >
> > > The table obviously has the identity property set on
> > > the column. Does  the datawindow also have the column
> > > marked as an identity column?  (Bottom of the Update
> > > Properties screen.)
> > >
> > > You could try tracing your database connection to make
> > > sure that PB is  actually trying to get the value back
> > > from the db. Add "TRACE " to the  beginning of your
> > > SQLCA.DBMS setting, like "TRACE ODBC" or "TRACE OLEDB"
> > > or "TRACE whatever".
> > >
> > >
> > >
> > >
> > > On 12/20/2010 10:19 AM, AngelI wrote:
> > > >> Hi Angel;
> > > >>
> > > >>      Can you tell us ...
> > > >>
> > > >> 1) Version of PB
> > > > I am using PB 11.5.1
> > > >> 2) Your DBMS&  version
> > > > I am using SQL Server 2005 SP1
> > > >> 3) How are you connecting to the DBMS
> > > > SNC
> > > >> 4) Is this an Insert operation?
> > > > Yes is an Insert
> > > >> 5) Does the table have a Trigger on it?
> > > > No Trigger
> > > >> 6) Is the identity column marked as AutoSeq or
> > > >> AutoIncrement?
> > > > Autoincrement
> > > > 7) Have you tried using a ReSelectRow ( )
> > > >> function after the update?
> > > > Not possible with PB11.5.1
> > > >>
> > > >> Regards ... Chris
> > > >> President: OSUG / STD Inc.
> > > >> Blog: http://chrispollach.blogspot.com
> > > >> PBDJ: http://chrispollach.sys-con.com
> > > >> SourceForge:
> > > http://sourceforge.net/projects/stdfndclass >>
> > > >> "AngelI" wrote in message
> > > >> news:4d0bd805.14f.1681692777@sybase.com...
> > > >>
> > > >> Hi, I have a datastore that contains a datawindow
> > > that has >> an
> > > >> identity column and after I update the datastore I
> > > want to >> get
> > > >> the value of that column to assign it to the detail
> > > table. >> I have tried directly and with the
> > > getitemnumber function >> and it returns
> > > >> null. I checked the update function return value
> > > and is 1 >> (Ok)
> > > >>
> > > >> Do we have a problem with the datastore or maybe
> > > this >> doesnt work with datastore.
> > > >>
> > > >> Your comments are welcome to help me in this
> > > situation >>
> > > >> Angel
0
AngelI
12/23/2010 3:55:00 PM
On 18/12/2010 8:37 AM, AngelI wrote:
> Hi, I have a datastore that contains a datawindow that has
> an
> identity column and after I update the datastore I want to
> get
> the value of that column to assign it to the detail table. I
> have tried directly and with the getitemnumber function and
> it returns
> null. I checked the update function return value and is 1
> (Ok)
>
> Do we have a problem with the datastore or maybe this doesnt
> work with datastore.
>
> Your comments are welcome to help me in this situation
>
> Angel

May not be the issue but in the past I have had to put this in the 
dbparm connection property for identity column values to return 
correctly (using SQL Server).

Identity='SCOPE_IDENTITY()'





0
Adam
12/29/2010 3:39:42 AM
On 29/12/2010 2:39 PM, Adam Simmonds wrote:
> On 18/12/2010 8:37 AM, AngelI wrote:
>> Hi, I have a datastore that contains a datawindow that has
>> an
>> identity column and after I update the datastore I want to
>> get
>> the value of that column to assign it to the detail table. I
>> have tried directly and with the getitemnumber function and
>> it returns
>> null. I checked the update function return value and is 1
>> (Ok)
>>
>> Do we have a problem with the datastore or maybe this doesnt
>> work with datastore.
>>
>> Your comments are welcome to help me in this situation
>>
>> Angel
>
> May not be the issue but in the past I have had to put this in the
> dbparm connection property for identity column values to return
> correctly (using SQL Server).
>
> Identity='SCOPE_IDENTITY()'

I just had a play with this and if I exclude the DbParm option the 
identity value is not returned after an update.

When I include it the identity value is returned correctly immediately 
after the update and does not require a re-retrieve or reselectrow.



0
Adam
12/29/2010 3:50:03 AM
Reply:

Similar Artilces:

Identity columns with ASA 6 and PowerBuilder datawindows
It seems that as of SQL Anywhere 6 the identity column feature does not work properly in the PB datawindow any more. As in version 5 it would automatically retrieve the newly created ID, you have to do it manually in ASA 6. The ASA 6 documentation explicitly mentions this. Has this been fixed in a later build of ASA 6? Why did it stop working? Thanks, Jacek Did you update your PBODB60.INI to accomodate ASA6? See the ASA help section "Upgrade notes for Powerbuilder and Infomaker users" >It seems that as of SQL Anywhere 6 the identity column feature does...

Deleting Rows with Identity Columns through Powerbuilder Datawindow
Perhaps I should be posting this in a Powerbuilder newsgroup, but I am having the following problem: I have a Powerbuilder 6.5 application which is using an ASE 12.5 database with Enhanced Full Text Search. Because of the EFTS, many of the tables make use of identity columns. Whenever users attempt to delete a row from one of these tables through a datawindow, they receive a "Rows Changed Between Retrieve and Update Error"! I have tried changing the "ON DELETE" settings of the datawindow, but to no avail. However, I can delete records from the table th...

Problem in using sqlbulkcopy to insert data from datatable(no identity column) into sql server table having identity column
Hi, I am having problem in bulk update of a sql server table haning identity column from a datatable( has no identity column) using sqlbulkcopy. I tried several approaches, but it does not show any error nor is the table getting updated. But the identity value seems to getting increased every time. thanks. varun Hmmmm...that means it is inserting something...I wonder if your datatable has data in it. Can you check that?Thanks,MaxLet Me Google That For You! The first thing i did was checked it. The datatable is getting populated fine. What could possibly be wrong si...

PB 10.5 + MsSQL Server 2005: Problem with identity column, wrong value shown in the datawindow
Hi there, I'm using PB 10.5 and my app connects to a Microsoft SQL Server 2005 database. I have two tables, like customers and adresses. I wrote a AFTER INSERT - Trigger that inserts a row into the adresses-table, when a new customer is inserted. The customer will be references by a identity column-id. This identity column is a foreign key in the adresses table. To register a new customer, this is my code: row = dw.insertrow (0); dw.update (); new_id = dw.getitemnumber (ll_row, "cust_id"); Now it happens: the ID I take out of the datawindow is not the...

Problem with Identity Column
Hi all, hope someone can help me. I use a 'auto identity' column. When I delete all values in the table and then insert some new values, I want the identity value starting with 1. How can I do that ? regards, Michael mscheffler@l-net.net wrote... > Hi all, > > hope someone can help me. > I use a 'auto identity' column. When I delete all values in the table > and then insert some new values, I want the identity value starting with > 1. How can I do that ? > > regards, > > Michael > > It sounds like you're ...

Problem with identity column
I've got a problem using an auto-update identity column. I use a datapipe in PB to pipe a Dbase table to a ASE table. The problem is that, when I add an identity column to the ASE table, the datapipe is complaining when started. The error reported is: "The number of columns in the Insert statement doesn't match the number of values in the Values clause". This is not true, because this is an extra column (the identity column and some more) in the destination table en this column does not exist in the DBASE (source) table. What can I do about it. I want to pipe this...

Problems with Identity column
Got this error:"An explicit value for the identity column in table 'sdk_appsettings' can only be specified when a column list is used and IDENTITY_INSER is on"Any idea? Also what is MAX in nvarchar(max)?Rafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct If you have Identity column in your table and you supply a value when you are inserting a record, then above error will be thrown.  Identity column has its own rules - they are normally incremented each time by a specific value for example 1.  When inserting identity column value should not be ...

Problems with identity columns
Hi All, I am running Sybase Adaptive Server 11.5 on NT 4.0. I have a table that is keyed by an identity column. I have BCP-ed data into this table and used the "-E" switch so as to retain the identity column values in the data file. Everything seems to work fine for the first 1000 or so inserts, and after that the values of the identity column suddenly jump by increments of 50,000,000 for no apparent reason. Does anyone know why this is happening? Did the use of the "E" in the BCP command have something to do with it? Is there some setting that I need to chang...

Problems with Identity Column
I'm making extensive use of AUTOINCREMENT in a SQL Anywhere database. However, I need the value of the autoincremented column immediately after an Update. According to the PS documentation, there's a nice, clean way of handling this -- telling the DW painter that the autoincremented column is an "Identity" column. My problem is that this does not seem to work. After an Update, the value in the column still displays as 0. (This in itself seems bizzare to me -- shouldn't it be blank?) Am I missing something painfullly obvious here? -Matt Matt Leo wro...

problem with the datawindow Rows-Update Properties
i am trying to set up a datawindow for a table with a compound primary key where one of the columns is a datetime column (ASE 11.5) : xpkactivity_action_note clustered, unique activity_num, action_datetime, resource_id, activity_action_id The action_datetime column doesn't appear in the Unique Key Columns() list box in the Specify Update Properties which results in the update not working properly because the where clause is incorrect... (the column is in the Updateable Columns list). when i press the Primary Key button, it selects the other 3 columns. i can't find a...

Identity column problem
I have a PB 6.5 app hitting a SQL Anywhere 5.5.0.4 database and it works great. I updated the database to Adaptive Anywhere 6.0.3, and suddenly the datawindow identity columns aren't returning their autoincremented primary key values to the client when a new record is inserted. Have any of you PB developers out there using Adaptive Anywhere experienced this? I am pretty sure the problem is the database and not PB; just wondering if anyone has seen this. Thanks, Rick Powell >I have a PB 6.5 app hitting a SQL Anywhere 5.5.0.4 database and it works >great. I updated...

Identity column problem.
Just ran into this and thought I would share it. I needed to make a duplicate copy of a row on a table with a Identity column Primary Key. Used RowsMove to move the row in question to a different datastore. RowsMove sets the Row Status to NewModified! just as I want. Update the new row to the database - a new identity is established - update works. Problem: Using GetItemNumber to retrieve the newly assigned identity gives me the original row identity value. If I set the Identity colum to NULL before the Update - then I get the NEW value. This happens in PB6 and PB7. I...

Identity column problem
Hi, We are investigating why a replicated table is out of sync problem in ASE 12.0 & Replication Server 11.5 environment. A table contains an identity column. If a record is being updated in primary site, is there a situation that the value of identity column be modified when it gets to the replicated site? Thanks & best regards, Kelvin ...

Identity Column Problem
<< Sorry for Cross Posting, I originally posted this in ase.NT >> I have a sporadic problem with Identity Column. It works fine mostly, but all of a suddent it comes with large numbers and works accurately from that point. To fix it I was just pipeline the data to a backup table then drop the main table, create a new table and retrieve the backup table data. Then I have to give permissions to different roles for that table. Why is it happening? Something wrong with my ASE 11.9.2 parameter? or something wrong with my PB code? I have tested with 8.0.4 and 9.0.1 versions....

Web resources about - Datastore identity column problem - sybase.powerbuilder.datawindow

Fortune Datastore - Home
The Ultimate Resource for marketing, mailings, sales, and research!

F8: No Internet Connection? Parse Local Datastore Has Your Apps Covered
Applications that work offline? Why not? Parse announced the launch of Parse Local Datastore — a new feature in its software-development kit ...

Parse Roundup: Introducing Crash Reporting, Local Datastore for iOS, and Much More
Parse Roundup: Introducing Crash Reporting, Local Datastore for iOS, and Much More

Twitter Engineering: Introducing Gizzard, a framework for creating distributed datastores
Tuesday, April 6, 2010 Introducing Gizzard, a framework for creating distributed datastores An introduction to sharding Many modern web sites ...

Flickr: The Guardian Datastore Pool
... Photos The Commons Getty Collection Galleries World Map App Garden Camera Finder The Weekly Flickr FlickrBlog Upload Sign In Guardian Datastore ...

Datastore Automotive News
$120 - 2008 Top 125 Dealership Groups in the U.S. ranked by revenue for all departments (includes sales by department, makes sold, and top sales ...

Google Cloud Platform enhances Compute Engine, App Engine and Cloud Datastore
... additions: layer 3 load balancing capability for Google Compute Engine new features and productivity improvements for Google Cloud Datastore ...

Google deprecates old App Engine datastore in favor of High-Replication version
Google is deprecating the Master/Slave Datastore used by its cloud platform App Engine in favor of the High-Replication Datastore (HRD), which ...

Welcoming Dropbox Datastore
... I need to stop telling people that Zumero is "like Dropbox, except for data instead of files". :-) This week, Dropbox announced their Datastore ...

Google cuts prices on week-old datastore
Let the cloud price chopping continue. A week after Google announced its Cloud Datastore managed NoSQL database, it’s cutting its price, according ...

Resources last updated: 12/15/2015 4:53:51 PM