Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PowerBuilder 11.x datastore retrieval issues.

186 views
Skip to first unread message

j.gloster

unread,
Nov 20, 2008, 1:13:28 PM11/20/08
to
Greetings,

I have been using PowerBuilder 8.02 with the PFC's for
several years. I just upgraded to PB 11.5 for an integration
project and am having issues with datastore retrievals. In
PB 8.02 I would declare datastores using "n_ds" but in PB
11.5 I have to use "datastore".

I have code that reads an XML file, using PBDOM, into an
external datawindow. The XML file contains table data from
an external system. As I loop through the populated external
datawindow, I check to see if a particular element on each
row matches an entry in a table in the local database. The
first retrieval of the datastore functions properly. All
subsequent retrieval calls result in a -1 return code. I
have some (partial)example code below:

*******************************************
long ll_ds_rows, ll_dw_rows, ll_dw_loop
string ls_dw_element

//Create the local datastore
datastore lds_table_lookup
lds_table_lookup = Create datastore

lds_table_lookup.DataObject = "d_table_name_lookup"
lds_table_lookup.SetTransObject(SQLCA)

//Loop through the rows in the external datawindow
//dw_xml_raw.
ll_dw_rows = dw_xml_raw.RowCount()

For ll_dw_loop = 1 to ll_dw_rows
GarbageCollect()

ls_dw_element =
dw_xml_raw.Object.xml_tablename[ll_dw_loop]

If trim(ls_dw_element) <> "" Then
ll_ds_rows = lds_table_lookup.Retrieve(ls_dw_element)

//Do some additional code here ....

End If
Next

********************************************

On the first pass, using "Party" as the arguement, it
retrieves fine. On the second pass, using "TelephoneNumber"
as the arguement, it returns -1. If I modify the code not to
retrieve using the first value, "Party", it will retrieve
successfully using "TelephoneNumber". It then fails again
trying to retrieve using the next value in the list.

I had a copy of PB 11.2, and recreated the code in that
version and it fails in the same manner. I've used this
technique in PB 8.02 using the PFC's without any problems.
Unfortunately, PB 8.02 doesn't support PBDOM. Can anyone
give me any deas of what the problem might be?

Thank you in advance.

John

Chris Pollach

unread,
Nov 20, 2008, 2:00:10 PM11/20/08
to
Hi John;

You should always use "n_ds"!

What were your issues with n_ds that you experienced?


--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com


<J. Gloster> wrote in message news:4925a8c8.571...@sybase.com...

j.gloster

unread,
Nov 20, 2008, 2:21:11 PM11/20/08
to
Hi Chris,

When I try to declare an object of type n_ds it gives me
"Error C0001:Illegal data type n_ds"

Thanks,

John

Jason 'Bug' Fenter [TeamSybase]

unread,
Nov 20, 2008, 3:25:40 PM11/20/08
to
Were your PFC libraries successfully migrated to PB11.5?

j.gloster

unread,
Nov 20, 2008, 3:58:36 PM11/20/08
to
Hello Jason,

I had created the application with straight PowerBuilder, no
PFC's. I just finished downloading the PB 11 PFC files from
CodeXchange and migrated them to PB 11.5. I switched my
object declaration from "datastore" to "n_ds". I still
recieved an error, but the PFC's returned a more useful
error message. It turned out to be a database connection
issue. I was losing my connection after the first retrieval.
I have corrected this problem and it's working fine now.

Thanks to all for your help.

John

0 new messages