Oracle Number to Navision

PureHeartPureHeart Member Posts: 190
Hi To All!
I need your help! i'm trying to read a number field in an oracle table, the field is defined as number(38,12). I can't really understand why when i try to read this field i get an error from navision of unsupported type!
i've tried to message the value but i got the same error!can someone help me please?

Test_Rs.Open(SqlCmd,Test_Con);

Test_Rs.MoveFirst;

MESSAGE(FORMAT(Test_Rs.Fields.Item('NUM').Value)); <- error!!! but it works with text fields!

](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=1123

Answers

  • PhennoPhenno Member Posts: 630
    PureHeart wrote:
    Hi To All!
    I need your help! i'm trying to read a number field in an oracle table, the field is defined as number(38,12). I can't really understand why when i try to read this field i get an error from navision of unsupported type!
    i've tried to message the value but i got the same error!can someone help me please?

    Test_Rs.Open(SqlCmd,Test_Con);

    Test_Rs.MoveFirst;

    MESSAGE(FORMAT(Test_Rs.Fields.Item('NUM').Value)); <- error!!! but it works with text fields!

    ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)

    Could you post the exact error message, pls?
  • PureHeartPureHeart Member Posts: 190
    Hi Phenno,
    the error is this:
    "This data type is not supported bt C/SIDE. You can access data from any of the following data types: VT_VOID, VT_I2, VT-I4...."
    Can you help me? ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • PhennoPhenno Member Posts: 630
    PureHeart wrote:
    Hi Phenno,
    the error is this:
    "This data type is not supported bt C/SIDE. You can access data from any of the following data types: VT_VOID, VT_I2, VT-I4...."
    Can you help me? ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)


    That field is probably not a varchar type?

    I've made a function that "translates" "integer value from db" to "integer value in navision".


    You could make few functions in that manner that do integers, decimals, etc...

    // This is in RS loop. You call ReadADOFieldInteger function.
    NavisionIntegerVar := ReadADOFieldInteger(RS.Fields.Item('Total'));
    
    // Here is a function that does translation to Navision Integer
    ReadADOFieldInteger(adField : Automation "'Microsoft ActiveX Data Objects 2.7 Library'.Field") IntegerValue : Integer
    
    // Function has local vars 
    adStream	Automation	'Microsoft ActiveX Data Objects 2.7 Library'.Stream	
    // end of local vars
    
    
    CREATE(adStream);
    adStream.Open;
    adStream.WriteText(adField.Value);
    adStream.Position := 0;
    IF EVALUATE(IntegerValue,adStream.ReadText) THEN ;
    
    


    I forgot to mention, this works on MSSQL 2000. I haven't tried it on Oracle.
  • PureHeartPureHeart Member Posts: 190
    THANK YOU Phenno!!!! I've resolve!!!! IT WORKS!!! THANKS A LOT!
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • PhennoPhenno Member Posts: 630
    PureHeart wrote:
    THANK YOU Phenno!!!! I've resolve!!!! IT WORKS!!! THANKS A LOT!


    Please put [Solved] into the thread name.
  • BarfolomeusBarfolomeus Member Posts: 5
    =D> This is an excellent solution. Thanks.
Sign In or Register to comment.