1. Roland Smith
  2. PowerBuilder
  3. Tuesday, 29 August 2023 13:58 PM UTC

PowerBuilder 2019 Build 2170

We have a utility app that copies default data from a reference database (SQL Anywhere 12) to the users SQL Server database. The end user runs this utility when upgrading to a new version of the main application.

The problem we are having is with an internal app that populates the SQL Anywhere database from a SQL Server database maintained by our DBA.

For each table, it creates a pipeline on the fly and assigns it to the Syntax property of a pipeline object. It then makes a call like this:

li_return = pipe_obj.Start ( tr_source, tr_target, dw_result )

It recently started failing with -7 (Column mismatch) on just one table. We have 2,385 tables being processed.

Here is the table definition:

CREATE TABLE [dbo].[ManagedTaskSetDefinition](
	[AppID] [int] NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Code] [varchar](15) NOT NULL,
	[IsQueuingSet] [bit] NOT NULL,
	[HasBeenProcessed] [bit] NOT NULL,
	[CreatedDateTimeOffset] [datetimeoffset](7) NOT NULL,
	[ManagedTaskTargetListDefinitionAppID] [int] NULL,
	[ManagedTaskScheduleDefinitionAppId] [int] NULL,
	[IsInitiatedBySystemEvent] [bit] NOT NULL,
	[ManagedTaskSystemEventDefinitionAppID] [int] NULL,
	[IsActive] [bit] NOT NULL,
	[QueuedDateTimeOffset] [datetimeoffset](7) NULL,
	[ReRunNumberOfDays] [int] NULL,
	[CreatedByApplicationUserAppId] [int] NULL,
	[InitiatedBy] [char](1) NOT NULL,
	[LastRunDateTimeOffset] [datetimeoffset](7) NULL,
	[CutOffDaysAfterStart] [int] NULL,
	[CutOffTime] [time](7) NULL,
	[RunTimeParameters] [varchar](max) NULL,
	[AppRowVersion] [timestamp] NOT NULL,
	[ChangeUser] [varchar](513) NOT NULL,
	[ChangeJob] [varchar](63) NOT NULL,
	[ChangeTime] [datetime] NOT NULL,
 CONSTRAINT [PKManagedTaskSetDefinition] PRIMARY KEY CLUSTERED 
(
	[AppID] ASC
)

If anyone has any suggestions, it would be appreciated.

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 30 August 2023 06:04 AM UTC
  2. PowerBuilder
  3. # 1

you said it's like time(7), but on https://help.sap.com/docs/SAP_SQL_Anywhere/93079d4ba8e44920ae63ffb4def91f5b/81fe28146ce21014ba0ba3f8fb5628b3.html it says sqlanywhere time data type is 8 bytes.

maybe there's something on that page that could help you out, like when connecting using ODBC?

Comment
  1. Roland Smith
  2. Friday, 1 September 2023 12:54 PM UTC
We are already skipping datetimeoffset columns and adding them through sql script. We are going to do the same for time columns.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2023 21:36 PM UTC
  2. PowerBuilder
  3. # 2

Hi Roland;

  Any recent changes to SA or SS (client, DBMS, patches, schema, etc)?

Regards ... Chris

Comment
  1. Roland Smith
  2. Wednesday, 30 August 2023 14:42 PM UTC
The offending column was added on the same day it started failing back in April.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2023 15:34 PM UTC
  2. PowerBuilder
  3. # 3

I ran a trace and didn't get anything useful.

I limited the query that returns the column list and found that it didn't like CutoffTime.

In SQL Server it is defined as:  

[CutOffTime] [time](7) NULL,

The pipeline syntax is the same for source and target:

COLUMN( type=time, name="CutOffTime", dbtype="time(16)", nulls_allowed=yes )

In Sybase Central it says the table is type 'time'.

Precision = 16 is coming from sp_columns_90. Maybe time shouldn't have precision in the pipeline?

What is really strange is that if I save the syntax to a pipeline object, it runs without issue from the pipeline painter.

Comment
  1. Miguel Leeuwe
  2. Tuesday, 29 August 2023 15:38 PM UTC
hmm, so ... is there maybe a different dbparm for your IDE connection and app's connection?
  1. Helpful
  1. Roland Smith
  2. Tuesday, 29 August 2023 15:47 PM UTC
I had the same idea. I added code to make the DBParm just like my IDE and no change.
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 29 August 2023 16:05 PM UTC
Almost sounds like a valid candidate for a support ticket.

Regards
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2023 15:18 PM UTC
  2. PowerBuilder
  3. # 4

i think that timestamp in sql anywhere is a datetime

 

in sql server it is a value unrelated to actual dates/times

Comment
  1. mike S
  2. Tuesday, 29 August 2023 15:21 PM UTC
Also, i don't think PB/datawindows know what to do with datetimeoffset?
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2023 14:15 PM UTC
  2. PowerBuilder
  3. # 5

Hi Roland,

First find out on which column it is failing by using TRACE maybe (using that word in your SQLCA.DBMS)?

regards

Comment
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.