Postgres query into Omnis question
Dan Ridinger
dlr at futurechalk.com
Tue Mar 28 16:21:02 EDT 2017
Hello Steve,
Try
select order_number, cast (order_comments as varchar(2000))
from order_forecast
UNION
select order_number, cast(null as varchar(2000)) as order_comments from orders
Dan Ridinger
Managing Director
FutureChalk Software Inc.
20521 92A Avenue
Langley, BC V1M 1B7
Phone No: 604.723.6837
EMail: dlr at futurechalk.com
www: www.futurechalk.com
> On Mar 28, 2017, at 12:52 PM, 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