PDA

View Full Version : Error 22018 with Ms SQL database



Jose M. Soler
28-Mar-2006, 05:20 AM
the error is for the name of the fields, the native names was in spanish with accent ( ej. camión) this cause the error every time Dataflex read the file.

any idea for solve this problem ( it is not posible to change the name of the filed in native database)

it is possible to change the names in FD or DD, what is the functionfor CCH and INT files

Thanks in advance.
Jose M. Soler

Ben Weijers
28-Mar-2006, 08:53 AM
Are you getting a DataFlex error 22018 or a SQL Server error?

You can change column names on the DataFlex side by using the Field_name intermedaite file keyword.

Regards,

Ben Weijers
Data Access Worldwide

Jose M. Soler
28-Mar-2006, 10:04 AM
The 22018 is an SQL error number, the Dataflex erro number was 12289 and the line is in DD_OperationChecker.pkg

I think is a conectivity error, because the same error is reported for the Dataflex Explorer aplication. See the screenshots

Ben Weijers
28-Mar-2006, 02:55 PM
Can you send me the definition of this table as an sql script s I can do some testing?

Regards,

Ben Weijers
Data Access Worldwide

Michael Mullan
1-Apr-2013, 02:01 PM
did this get resolved? I'm getting the same error here today, in code that used to work...

Martin Moleman
2-Apr-2013, 02:04 AM
Wow, really old thread.

Are you also using accented characters in field names? Did you try Field_Name in the INT file?

Michael Mullan
2-Apr-2013, 07:48 AM
Martin.

I was saving a record with a datetime in it, there was something "iffy" about the internal date conversion. I cast the value explicitly to a date before moving to the file buffer, and the error went away.

On another note, the conversion from date -> datetime when migrating from embedded to MSSQL is a huge pain. after the migration, all the date math performed directly on fields fails. what should have been a code free upgrade, cost me two days of unpaid work. Grrr.



MM.

Bob Worsley
2-Apr-2013, 08:29 AM
If in SQL Server you simply set a datetime column to a date, SQL Server automatically converts it to a datetime. DAW shouldn't insist on the up front conversion to a datetime. This is similar to my thread on date separators where the CK is insisting on "-" separators instead of simply allowing the "/".

UPDATE AFF_CLMAUDIT_ATTACHMENTS set CREATED = '04/01/2013' where ID = 3

6308

Martin Moleman
2-Apr-2013, 08:43 AM
Can you elaborate on that?
When converting from embedded to SQL Server, DF_Date fields will stay DF_Date fields. Even if the underlying SQL Server type is datetime, from the DataFlex side it will still be a Date. I don't see where a date -> datetime conversion comes in play?

chuckatkinson
2-Apr-2013, 08:57 AM
Just a quick note that DATE is now a SQL Server data type. IMHO the conversion should use that when possible instead of DATETIME.

Garret Mott
2-Apr-2013, 09:23 AM
Unless you are still using CRXI - it does not know about the Date type & needs DateTime

Bob Worsley
2-Apr-2013, 09:28 AM
Can you elaborate on that?
When converting from embedded to SQL Server, DF_Date fields will stay DF_Date fields. Even if the underlying SQL Server type is datetime, from the DataFlex side it will still be a Date. I don't see where a date -> datetime conversion comes in play?I haven't tried this, I was simply supporting Michael's contention that if an explicit up front conversion from date to datetime is required then it's not really necessary because SQL Server will do it for you. If the CK indeed does not do this then there's something else at play.

ivansc
2-Apr-2013, 10:30 AM
Can you elaborate on that?
When converting from embedded to SQL Server, DF_Date fields will stay DF_Date fields. Even if the underlying SQL Server type is datetime, from the DataFlex side it will still be a Date. I don't see where a date -> datetime conversion comes in play?

I think Michael refers to math operations with dates.
My application has to do with scheduling and it makes operations with date fields (add days, days between dates, etc.)
When the data was transfered from dataflex to Oracle the ck converted the date fields to datetime fields and all the maths operations didn´t work anymore.
I had to use an intermediate date variable or use (Date(file.field)) to get the same results.


"from the DataFlex side it will still be a Date"

It didn't work... or maybe was missing a line in the Int file ?

best regards

Ivan

Michael Mullan
2-Apr-2013, 10:33 AM
I had in the embedded DB:

Move propdtl.Trade_Date to sValue

and sValue was "05/23/2013"

then I converted to MSSQL, using the studio, (17.0) and SValue is now

"05/23/2013 12:00:00.000 AM"

and things like

Move (trades.SellDate + 3) to trades.SettleDate now just fail. If inside a BPO it fails silently. (hide errors and all that)

also Winprint reports started adding the mysterious timestamp.

Michael Mullan
2-Apr-2013, 10:35 AM
Yes. This.

Martin Moleman
3-Apr-2013, 02:01 AM
So i expect the column has changed from DF_Date in embedded to DF_Datetime on SQL Server.
That's not what is supposed to happen after a normal conversion from embedded to SQL.

There probably is a Field_type Datetime setting for this column in the table.int file. Remove that and it should turn back to a DF_date.

Bob Cergol
3-Apr-2013, 10:55 AM
Ditto for Dynamic AI. This new MS-SQL "plain" DATE type looks to be a Char type to Dynamic AI -- and then has to be cast back to datetime if you want to use all the automated date functions. Bo at Cintac tells me: "It's a problem with the OLEDB / ADO layer." It's pretty easy to just cast the type back to DateTime either in the report or in the underlying view.

Bob

ivansc
4-Apr-2013, 01:28 PM
There probably is a Field_type Datetime setting for this column in the table.int file. Remove that and it should turn back to a DF_date.

HI Martin,

You are right, all my date fields have that setting. After Removing the line and refresh the table, the math operations work again. At least I did it with one field. Is a bit late to change all fields and the program again.

Thanks and best regards.

Ivan