Ddt (cast field numeric to int )


Author
Message
Olivier
Olivier
StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 806
Yes, I want to force DDT cast my field numeric to int, so i put in BigInt and after in Int
but i getting a error cause it doesn't want truncated.

And if i run a script : Alter table [Imhotep].[dbo].[affaires] alter column [etage] [int] not null
SqlServer can truncated

Can we insert a script in DDT (tsql) ?


DDT is very useful, and maybe the other developer use it, like as add or rename column,
but may be not to change the data type.
Cause may upsizing from foxpro get a bad datatype,we use DDT to make a beautiful and good database
for my application.

I hope , i was clear in my text.

thanks
Olivier


==============================================
Asp.net C# - Strataframe - telerik
==============================================
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
When are you getting the error?  A BIGINT can't fit into an INT and would in fact be truncated.  I am just trying to understand where you are getting the error.
Olivier
Olivier
StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 806
Trent,

Just a last test, to force the update column, i test the field int to BIGint ,
and i run a deployment => it's ok.

But i change the type from bigint to Int , i have a error : "String or binary data would be truncated"

If i run in TSQL : Alter table [Imhotep].[dbo].[affaires] alter column [etage] [int] not null => it's OK

Do you think ? we could be have a parameters to force the alter column in DDT without stop the process ?

thanks
Olivier

==============================================
Asp.net C# - Strataframe - telerik
==============================================
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Oliver, thanks.  That makes the setup a lot easier.  I will give that a go.
Olivier
Olivier
StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 806
Trent ,

Excuse me for my poor english.

If you want to reproduce this, you haven't to use Foxpro.

You put in sqlserver a field in numeric 20,0 or numeric 10,0 and you import your database
in DDT to see that.



thanks
Olivier,

==============================================
Asp.net C# - Strataframe - telerik
==============================================
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I will take a look at that.  Thanks for the heads up.  It has been a very long time since I have personally imported a VFP table.  So it is possible that there is something going on there.
Michel Levy
Michel Levy
Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi Olivier,

I confirm your last post!

Having still Decimal(N,0) as datatype in SQL Server, I may see on my dev machine that BO mapper map it as decimal (fine, but will trigger an error on runtime), but that DDT on the same data map these columns as Int (I have NOT ask for any modification, just imported the data structure)
Edited 13 Years Ago by Michel Levy
Olivier
Olivier
StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 806
Hello Trent,

thanks for your reply,

In fact, when i import in DDT from SqlServer (reverse engineering),
the data type numeric 20,0 was translate in DDT INT (13).

Also since that, we don't cast the FIELD numeric to INT.

I hope to understand me,

ps : i attach pictures ,

thanks
Olivier,

==============================================
Asp.net C# - Strataframe - telerik
==============================================
Attachments
import_field.png (105 views, 168.00 KB)
Olivier
Olivier
StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)StrataFrame User (430 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 806
Hello Michel,

We have find why the bomapper get int32 cause we have modify in DDT an numeric 10,0 to INT and
the boMapper get Int32 it's correct.

But DDT doesnt alter the column numeric to INT in Sqlserver.


Olivier

==============================================
Asp.net C# - Strataframe - telerik
==============================================
Edited 13 Years Ago by Olivier Hamou
Michel Levy
Michel Levy
Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)Advanced StrataFrame User (607 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi Trent,

the problem I've seen on Olivier's computer is a weird mapping, that I'm not able to reproduce on any one of mine...

for some historic reasons (VFP background, but that is really old ages), in its SQL server, he handles integer through Decimal (N,0) columns. And in the BO mapper, directly on the tables (no DDT at this step), all these Decimal columns are mapped to Int32!
Of course, when running the app, there is an invalid cast error bubbling from the ODBC layer. Crazy

Having the same database on my local SQL Server, the same SF version, I'm unable to reproduce this error. Going on its development machine, I see this error in BO mapper. I'm going here and there with this error for a couple of days, still not understanding the origin.Ermm

I can't find which part of the SF source code could set this incorrect mapping, and I suspect a bad SQL Native Client. What piece of code would help you to help us?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search