Postgres query into Omnis question

Alex Clay aclay at mac.com
Tue Mar 28 16:04:25 EDT 2017


Hi Steve,

You might try casting the NULL to a 2000-length varchar:

select order_number, order_comments
from order_forecast
UNION
select order_number, null::varchar(2000) as order_comments
from orders

Alex

> On Mar 28, 2017, at 15:52, Steve Finger <steve at srptech.com> wrote:
> 
> Hi,
> 
> I’m using Studio 6.1.3 to do a query to Postgres. To simplify, here is an example of what I’m trying to do:
> 
> select order_number, order_comments
> from order_forecast
> UNION
> select order_number, null as order_comments
> from orders
> 
> 
> Then I fetch the result into an undefined Omnis list. Currently only the orders table has values.
> 
> The problem is what Omnis brings back into the list. The order_comments column doesn’t have a length. So in an Omnis window which has a complex grid to display and enter values into the order_comments field, nothing can be typed in.
> 
> If I change null to ‘ ‘ (1 space) in the query then the column is defined with a length of 1.
> 
> The database table is set to 2000 characters.
> 
> How can I modify the query so Omnis knows that the length of the column that is returned from the query should allow 2000 characters? Or am I going to have to redefine the list in Omnis?
> 
> Thanks,
> Steve Finger
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com





More information about the omnisdev-en mailing list