1. damian jimenez
  2. PowerServer
  3. Friday, 11 August 2023 13:35 PM UTC

We have one dinamic Datawindow who works Ok with/without datetime fields in Client/server mode
in Powerserver works ok, only if doesn't have datetime field.

when y click in "Guardar" it execute Update method from datawindow and i get this error
INPUT STRING WAS NOT IN CORRECT FORMAT

i attach image and datawindows with and without datetime field and datawindow syntax 

Question 1: How could this solve?

I have a slight suspicion that the field format date we gave it before with DBPARMS parameters in INI file, but now all those parameters are ignored in Powerserver

Provider = 'msoledbsql19',
Identity = 'scope_identity ()',
Dateformat = 'dd/mm/yyyy'

Question 2: Could  I configure the database from PowerBuilder for Powerserver without configuring the API in Snapdevelop?


thanks so much

 

 

Attachments (1)
damian jimenez Accepted Answer Pending Moderation
  1. Friday, 18 August 2023 11:45 AM UTC
  2. PowerServer
  3. # 1

I found the problem
After the first RETRIEVE, we added  the date of birth, a computed field to the Datawindow that showed the current age.
*********************************************************************************************
compute(name=f_edad band=detail font.charset="0" font.face="Roboto" font.family="2" font.height="-9" font.pitch="2" font.weight="400" font.escapement="?" background.mode="1" background.color="553648127" color="RGB(255)" x="1322" y="198" height="65" width="384" format="[general]" expression="'Edad: '+f_edad_anios(cod,fec_natal,datetime(today(),now()))" alignment="0" border="0" crosstab.repeat=no )
****************************************************************************************************
At the time of doing the RETRIEVE again it does not give problems, but when doing a UPDATE method (only in Powerserver) it generates the error (-1) "input string was not in correct format"
This error is not presented in client/server, only in Powerserver
i Add a conditional, IF IsPowerserverApp() is true , this line  isn´t added, it works perfect 

thanks

Comment
  1. Miguel Leeuwe
  2. Friday, 18 August 2023 18:00 PM UTC
I assume that with "computer" you mean a computed column within the SELECT of your datawindow? Is the column selected in "Rows, update columns" of the datawindow?

regards.
  1. Helpful
  1. damian jimenez
  2. Friday, 18 August 2023 18:57 PM UTC
I edited the answer and completed it to make it clearer. Thanks Miguel
  1. Helpful
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Friday, 11 August 2023 15:28 PM UTC
  2. PowerServer
  3. # 2

Hi Damian,

 

Can you create a more simplified test case that reproduces this issue? Otherwise it would be great if you could provide us with the DDL for the table the DW uses.

BTW, I opened the source code and there was a typo in both the datawindows:

Please verify that this is not happening in your side.

 

Regards,
Francisco

Comment
  1. damian jimenez
  2. Tuesday, 15 August 2023 14:57 PM UTC
I also saw those attached properties, but I restored it since it works both in Powerscript and Powerserver when it has no field date. Extracting a case of tests is extremely difficult, I tried but I would carry a lot of work,it is not so simple to do it



attached script as create from sql server in a text file of the table

USE [A_NOGOYA]

GO



/****** Object: Table [dbo].[t_emp_datos] Script Date: 15/08/2023 11:49:58 ******/

SET ANSI_NULLS OFF

GO



SET QUOTED_IDENTIFIER ON

GO



CREATE TABLE [dbo].[t_emp_datos](

[cod] [bigint] IDENTITY(1,1) NOT NULL,

[cod_entidad] [varchar](20) NULL,

[nombre] [varchar](50) NOT NULL,

[condicion_iva] [varchar](3) NULL,

[cod_tip_documento] [varchar](4) NULL,

[nro_documento] [bigint] NULL,

[cod_ciudad] [int] NULL,

[telefono] [varchar](255) NULL,

[direccion] [varchar](50) NULL,

[fec_natal] [datetime] NULL,

[sexo] [char](1) NULL,

[e_mail] [varchar](200) NULL,

[direccion_cobro] [varchar](250) NULL,

[cod_estado_civil] [smallint] NULL,

[cuit] [bigint] NULL,

[cod_tip_instruccion] [smallint] NULL,

[tip_sangre] [int] NULL,

[fec_modificacion] [datetime] NULL,

[cod_expediente] [int] NULL,

[finalizado] [varchar](1) NOT NULL,

[es_nueva_entidad] [varchar](1) NOT NULL,

[cod_tip_entidad] [varchar](3) NULL,

[fax] [varchar](255) NULL,

[contacto] [varchar](100) NULL,

[cod_ciudad_cobro] [int] NULL,

[nro_ingresos_brutos] [varchar](15) NULL,

[cod_tip_ganancias] [smallint] NULL,

[cod_tip_ingresos_brutos] [smallint] NULL,

[cod_os_ext] [varchar](20) NULL,

CONSTRAINT [pk_t_emp_datos] PRIMARY KEY CLUSTERED

(

[cod] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO



ALTER TABLE [dbo].[t_emp_datos] ADD DEFAULT ('N') FOR [finalizado]

GO



ALTER TABLE [dbo].[t_emp_datos] ADD DEFAULT ('N') FOR [es_nueva_entidad]

GO



ALTER TABLE [dbo].[t_emp_datos] WITH CHECK ADD CONSTRAINT [fk_t_emp_datos_cod_os_ext] FOREIGN KEY([cod_os_ext])

REFERENCES [dbo].[t_ent_datos] ([cod])

GO



ALTER TABLE [dbo].[t_emp_datos] CHECK CONSTRAINT [fk_t_emp_datos_cod_os_ext]

GO



ALTER TABLE [dbo].[t_emp_datos] WITH CHECK ADD CONSTRAINT [fk_t_emp_datos_t_ent_datos] FOREIGN KEY([cod_entidad])

REFERENCES [dbo].[t_ent_datos] ([cod])

ON DELETE CASCADE

GO



ALTER TABLE [dbo].[t_emp_datos] CHECK CONSTRAINT [fk_t_emp_datos_t_ent_datos]

GO



ALTER TABLE [dbo].[t_emp_datos] WITH CHECK ADD CONSTRAINT [fk_t_emp_datos_t_ent_datos_2] FOREIGN KEY([cod_os_ext])

REFERENCES [dbo].[t_ent_datos] ([cod])

GO



ALTER TABLE [dbo].[t_emp_datos] CHECK CONSTRAINT [fk_t_emp_datos_t_ent_datos_2]

GO



ALTER TABLE [dbo].[t_emp_datos] WITH CHECK ADD CONSTRAINT [fk_t_emp_datos_t_ent_tip_ganancias] FOREIGN KEY([cod_tip_ganancias])

REFERENCES [dbo].[t_ent_tip_ganancias] ([cod])

GO



ALTER TABLE [dbo].[t_emp_datos] CHECK CONSTRAINT [fk_t_emp_datos_t_ent_tip_ganancias]

GO



ALTER TABLE [dbo].[t_emp_datos] WITH CHECK ADD CONSTRAINT [fk_t_emp_datos_t_ent_tip_ingresos_brutos] FOREIGN KEY([cod_tip_ingresos_brutos])

REFERENCES [dbo].[t_ent_tip_ingresos_brutos] ([cod])

GO



ALTER TABLE [dbo].[t_emp_datos] CHECK CONSTRAINT [fk_t_emp_datos_t_ent_tip_ingresos_brutos]

GO



ALTER TABLE [dbo].[t_emp_datos] WITH CHECK ADD CONSTRAINT [fk_t_emp_datos_t_exp] FOREIGN KEY([cod_expediente])

REFERENCES [dbo].[t_exp_expedientes] ([cod])

ON UPDATE CASCADE

ON DELETE SET NULL

GO



ALTER TABLE [dbo].[t_emp_datos] CHECK CONSTRAINT [fk_t_emp_datos_t_exp]

GO



  1. Helpful
  1. Francisco Martinez @Appeon
  2. Tuesday, 15 August 2023 16:08 PM UTC
Hi Damian,

DDL for table t_ent_datos is missing
  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.