Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 8 Jahren, 3 Monaten
Letzter Beitrag:
vor 8 Jahren, 3 Monaten
Beteiligte Autoren:
jem, Fabrice Harari, ICI

Hadd(), unexpect system error

Startbeitrag von jem am 30.04.2010 19:30

I try to test adding data to postgresql through "odbc access via oledb" option

on postgresql server
test table
test1 serial
test2 character varying(100)


after import into project analysis become
test table
test1 numeric
test2 text(200)

in code
for m_cnt =1 to 10
test.test2 = m_cnt
hadd()

end


I get error duplicate on the second loop .

when I check the table data , I see 1 record added but test1 value is zero(0) . the autonumber not working.


I make change on analysis become
test table
test1 automatic id
test2 text(200)


the record is added and the autonumber is working but I get exception (unexpected system error ) every time hadd() is called


how do i solve this problem?

Antworten:

Before you write into table you need.

Hreset(Test)
Test.MyField1=test1
Test.MyField2=Test2
Hadd(Test)


HReset() //See Help or tutorial

Next, your char field is 200 probably your field for text is Unicode.

Any finally, "odbc access via oledb" is pretty slower then Native access
or just ODBC.

Regards !

von ICI - am 30.04.2010 21:43
I think you miss understood my question.


the test1 field is automatic ID . the unexpect system exception happen when calling hadd() is because of this.

I not sure whether I doing correct way to do or this exception occur because of bug in windev.




von jem - am 01.05.2010 05:15
never mind I solved it by changing from postgres odbc unicode to postgres odbc ansi



von jem - am 01.05.2010 05:53
I discover another limitation of hadd() on autoincrement id field .

when I try to 2 instance of the program , the second program hit duplicate error on the auto increment field.

when I try to use sqlexec . no problem

I try to count the speed.
using odbc oledb
hadd() 100000 records it took 5 minute

using odbc
sqlexec() 100000 records it took 1 minute 12 second


von jem - am 01.05.2010 07:53
Hi Jem

If I remember correctly, the hxxxx functions are 'supported' only with native access (which is free for postgres sql)

Best regards

von Fabrice Harari - am 01.05.2010 08:50
Quote
jem
I discover another limitation of hadd() on autoincrement id field .

when I try to 2 instance of the program , the second program hit duplicate error on the auto increment field.

when I try to use sqlexec . no problem

I try to count the speed.
using odbc oledb
hadd() 100000 records it took 5 minute

using odbc
sqlexec() 100000 records it took 1 minute 12 second


i know , but minimun version is windev 14
http://doc.pcsoft.fr/en-US/?5518001&name=native-postgresql-access-for-windev-and-webdev

von jem - am 01.05.2010 10:32
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.