1. Sivaprakash BKR
  2. PowerBuilder
  3. Wednesday, 26 October 2022 07:34 AM UTC

Hello,

Using PB 2019 R3, PostgreSQL 11.11, compiled by Visual C++ build 1914, 64-bit, PgAdmin 4.27

When I run the below query in PgAdmin, it works correct

SELECT x::time FROM generate_series(timestamp '2000-01-01', timestamp '2000-01-01 23:59', interval '30 min') t(x);

It generates half-hour time interval slot.   

The same query gives the below error 

 

1.  No argument is there in the query to define.
2.  Even then I tried defining x as an argument, still I get the same error.

How to correct this error?

Happiness Always
BKR Sivaprakash

 

Accepted Answer
Mark Goldsmith Accepted Answer Pending Moderation
  1. Wednesday, 26 October 2022 13:38 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi...maybe this is a bug in that PB always interprets :something as a retrieval argument even though it's right next to another colon. However, that syntax is specific to PostgreSQL...can't you just use Cast(x as Time) instead of the ::?

HTH...regards,


Mark

Comment
  1. Sivaprakash BKR
  2. Wednesday, 26 October 2022 14:40 PM UTC
Thanks Mark. It works!
  1. Helpful
  1. Mark Goldsmith
  2. Wednesday, 26 October 2022 15:29 PM UTC
Thanks for the update and glad to hear that worked for you!
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Wednesday, 26 October 2022 11:04 AM UTC
  2. PowerBuilder
  3. # 1

Something you can try is to quote x::time. Don't know what are valid quote characters in postgreSQL. I would try "x::time"...

Andreas.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 26 October 2022 07:41 AM UTC
  2. PowerBuilder
  3. # 2

Hi,

This sounds like a bug to me. Maybe it's better to create a ticket for it.

What's not being interpreted correctly is the "::" in x::time. Powerbuilder thinks it's an argument.

As a workaround you might call a stored procedure and use that in your datawindow?

regards,

MiguelL

Comment
  1. Miguel Leeuwe
  2. Wednesday, 26 October 2022 08:31 AM UTC
Yw, yes, the only thing with using stored procedures in a datawindow (when using Postgresql), is that I read you cannot use any parameters for the stored procedures.So if you have any need for arguments, you'd have to insert them in a temporary table or something to then retrieve and use those in your stored procedure. I find this very limiting and hope that Appeon will fix that, since they claim to support Postgresql.

regards,

MiguelL
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 26 October 2022 08:35 AM UTC
If it's true that Appeon is going to re-introduce JDBC connextions in 2022 R2, then you might be better of using JDBC instead of ODBC. (at least I think you can JDBC for Postgresql?). Probably you could declare your stored procedures using "RPCFUNC" external declarations and most likely you'd be able to use arguments for stored procedures attached to datawindows, but of course, I'm not sure, just guessing and not an expert.

We use Oracle and Tibero databases. For Tibero, ODBC is very limited and lacking (not supported by Appeon), but the JDBC works perfectly fine!

  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 26 October 2022 08:35 AM UTC
(*connextions = connections)
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.