1. Paweł Kasperek
  2. PowerBuilder
  3. Saturday, 2 March 2024 13:23 PM UTC

Hi,

I have a few years of experience with PostgreSQL. I tried to retrieve data from Postres table with array-type columns. I created a simple test table in Postgres with array columns as in the below image:

After link this table to Datawindow in PB I've got follow DW with all char()

The type is char. How I can (if possible) get true types described in DW ex. integer array? I now that Postgres backend always retrieves arrays as string type with "{,}" format.

 

 

 

 

 

Bruce Armstrong Accepted Answer Pending Moderation
  1. Sunday, 3 March 2024 16:30 PM UTC
  2. PowerBuilder
  3. # 1

You can't.  Not directly into the DataWindow.  The DataWindow only understands an array of simple datatypes.  For something more complex you would need to call the stored procedure from PowerScript, parse the results and then put them into into DataWindow in some form that looks like an array of simple datatypes.  Or create the stored procedure so that it puts the nested data into a simple data type.

Comment
  1. Miguel Leeuwe
  2. Monday, 4 March 2024 10:18 AM UTC
(not really helpful fir what the OP wants though).
  1. Helpful
  1. Paweł Kasperek
  2. Monday, 4 March 2024 13:06 PM UTC
Hi,



Currently, is not possible to update/insert data to array-type columns in Postgres via DW/DS?



How I can print the Update/Insert SQL statement generated by datastore/datawindow object (on call Update() method) ?



Regards,

Pawel

  1. Helpful
  1. Bruce Armstrong
  2. Monday, 4 March 2024 17:33 PM UTC
You can use the SQLPreview event to see what SQL statements the DataWindow is generating and modify them.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.