Alpha Video Training
Results 1 to 12 of 12

Thread: Field and expression-type must match error

  1. #1
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Field and expression-type must match error

    I get Field and expression-type must match error when appending a table.
    Do the expressions inside the source table has to be identical to the posting/receiving table?
    Or just the name, type and size?

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Field and expression-type must match error

    The master fields must be of the same type and sized at least as large as the source data.

  3. #3
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Re: Field and expression-type must match error

    IN other wordsThe expression of the receiving table, does not matter?
    So why the error says expression do not match?
    The reason for asking is that I have 2 tables 120 of 209 fields are matched, in size, type and name.
    Yet it will not append.
    The difference is that the sending table does not have any expressions, the receiving table has many.
    Any suggestions?

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Field and expression-type must match error

    When you design any operation you are using a genie that Alpha supplies to generate the underlying xbasic code. For each field appended to Alpha create a pair of lines of code like

    append.m_field1 = "STORE"
    append.m_exp1 = "alltrim(str(@NEWIMPT->STORE))"
    the first line specifies the field in the master table being appended to
    the second line is the expression to put in the master table field

    In my example note that the expression to be appended to "STORE" converts the store field in the source table (newimpt) from numeric to character and trims any spaces.

    When the m_field1 data type and the m_exp1 data type don't match you get the error..........

    Field and expression-type must match error

  5. #5
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Re: Field and expression-type must match error

    Ok, I have got a few ways to find the difference in tables and Dbs.
    I have a few ways to compare tables, yet when comparing tables of large amount of fields, is in simple terms, Hell.
    The problem is that comparing tables, the utilities compare the code inside each field and different names.
    The need I have is to match the field type and the size. In other words the comparison, shows fields that are not equal, when in reality, they are, for my objective.

    In small or medium size tables, these compare utilities are great and for other reasons, they are great too.
    The explanation above confirm the results I am getting. It does not matter the code inside the fields, just of course the name, the field type and the size.

    I have 3 possibilities:

    1 Is there a way to trap the error with the field that is not matching as we run the operation of appending and tell me the field mismatching?
    (I try the trace error, but either I did not know how to use it, or it does not work in this case.)
    2 A comparison utility to only compare fields with the same name in both tables that have different field type and size.
    3 Quit this work.

    I think 3 will be a disaster, So I would like to stick with 1 and 2

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Field and expression-type must match error

    My guess is that you have numeric fields in the source table that should be character fields in the master table? Why not just restructure the source table before appending.

    TABLE_RESTRUCTURE()


    You can get the information needed for the restructure command with <TBL>.FIELD_INFO_DUMP() .

  7. #7
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Re: Field and expression-type must match error

    I just tried <TBL>.FIELD_INFO_DUMP() . this way:

    using it at the interactive window
    Step A:

    dim tbl as P
    tbl = table.open("customer")

    then this

    ? tbl.Field_Info_Dump("n,t,W,D") ( if I had the need of the field rules, just add ,R to the line, I did not need it now)

    It gave me the list that I needed.
    So in order to able to use this list, I copy the basic structure of the field list to excel.
    Did a data sort.

    Steb B
    Then I did repeat Step A with second table.
    Did the same to another excel sheet.
    sort it, place them side by side and slide them.

    The chances of seen the difference, were easier and more reliable, making it simpler and faster to find the different fields sizes and types.
    Still work, but 4 notches below hell.

    Thanks Stan.

    Table structure at this time will not help me as numbers may be with different decimals.

    I did peek at another section of tables in the wikiweb and found this link, a list of table commands. Great find.

    http://wiki.alphasoftware.com/Table+...ns+and+Methods

  8. #8
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,432

    Default Re: Field and expression-type must match error

    Just a case of slogging it out now Mike.
    BTW I use A5Doc to check the Table Contents.
    Worth getting a copy for the amount of work it does.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  9. #9
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Re: Field and expression-type must match error

    Excellent tool. A must get.

    Thanks

  10. #10
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,432

    Default Re: Field and expression-type must match error

    At last. It works!

    Wrong post but I have 9 versions of the problem to play with now.
    I'll put it in the correct place Mike.
    Attached Files Attached Files
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  11. #11
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    923

    Default Re: Field and expression-type must match error

    Very good....!!!!

    I see the data displayed very well. I have to implemented it in the system. I will let you know how good I am this.

    Specially if I gain the speed. I will do that Wednesday, as I have to travel to Washington, today and tomorrow.



    Thanks

  12. #12
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,432

    Default Re: Field and expression-type must match error

    Have a good and safe trip.
    Make a millon $!
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Error "Extra characters at end of expression" when LINK field is type "K"
    By RichCPT in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 10-29-2011, 01:11 AM
  2. Active-link tables MYSQL Error "Field types dont match"
    By slamdunk in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 04-02-2008, 12:40 PM
  3. Replies: 1
    Last Post: 03-01-2007, 11:25 PM
  4. inexact match error
    By William Perry in forum Alpha Five Version 4
    Replies: 3
    Last Post: 04-18-2001, 09:43 AM
  5. Error: Invalid Summary Field type
    By Mike Becker in forum Alpha Five Version 4
    Replies: 2
    Last Post: 09-22-2000, 06:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •