Type Variant!!!

Hanen
Member Posts: 281
Hello,
Variant type for field table doesn't exist in navision?
I have a stored procedure that contains some fields and a sum of amounts and I call it from navision and the result is an error message even if I store the sum in field of mytable datatype decimal.
How can I resolve that problem????
I'll be greatful for your help!!!
Variant type for field table doesn't exist in navision?
I have a stored procedure that contains some fields and a sum of amounts and I call it from navision and the result is an error message even if I store the sum in field of mytable datatype decimal.
How can I resolve that problem????
I'll be greatful for your help!!!
Regards
Hanen TALBI
Hanen TALBI
0
Comments
-
Try first to store the variant in a local variable of type decimal. Then put that variable into the field of the table.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
hello
Could you provide a little more information on how you are calling the stored proc?0 -
maybe he must use the CAST() command in his SP.
How looks your SP, how do you call it from NAV (ADO?) and how do you store the result of the SP?Do you make it right, it works too!0 -
That's the code:
//************************************ Open sql connection ******************* ltxtConnectionString:='Provider=SQLNCLI;Server=xxxxx;Database=xxxxxxxxx;Trusted_Connection=yes;'; IF ISCLEAR(lADOConnection) THEN CREATE(lADOConnection); lADOConnection.ConnectionString:=ltxtConnectionString; lADOConnection.Open; //************************************ Execute SP ************************* lvarActiveConnection := lADOConnection; IF ISCLEAR(lADOCommand) THEN CREATE(lADOCommand); lADOCommand.ActiveConnection := lvarActiveConnection; lADOCommand.CommandText := 'repartition'; lADOCommand.CommandType := 4; lADOCommand.CommandTimeout := 0; lADOCommand.Execute; IF ISCLEAR(lADORecordset) THEN CREATE(lADORecordset); lADORecordset.ActiveConnection := lvarActiveConnection; lADORecordset.Open(lADOCommand); repartition007.DELETEALL; WHILE NOT lADORecordset.EOF DO BEGIN repartition007.INIT; repartition007.Code := lADORecordset.Fields.Item('code').Value; repartition007.Designation:= lADORecordset.Fields.Item('designation').Value; repartition007.Nombre := lADORecordset.Fields.Item('nombre').Value; repartition007.Duree := lADORecordset.Fields.Item('duree').Value; repartition007.Montant := lADORecordset.Fields.Item('montant').Value; repartition007.PU := lADORecordset.Fields.Item('pu').Value; repartition007.INSERT; lADORecordset.MoveNext; END; //******************************** Close sql connection ********************** lADOConnection.Close; CLEAR(lADOConnection);
Regards
Hanen TALBI0 -
is one of these fields a decimal field?
So you can add in yous SP select statement something like that (mean the CAST() method:Select cast (TheDecimalField as float)
A good example you can find here: viewtopic.php?f=5&t=23038
RegardsDo you make it right, it works too!0 -
I've tried with cast ( myfield as decimal) but id didn't work the result is too bigRegards
Hanen TALBI0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions