Announcement

Collapse
No announcement yet.

Bug since SC5, still not fixed:

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug since SC5, still not fixed:

    SQL in Grid:
    Code:
    SELECT 
        AllocStatusID,
        AllocStatusCode,
        AllocStatusDescription
    FROM 
        ALLOCSTATUS
    Code generated:

    Code:
     General Settings: ocStatusID 	
    Attribute 	  	Value 	  	Description
    Note how it drops the "All" from the field name, ie "AllocStatusID" becomes "ocStatusID"?

    Obviouslly at run time this results in a severe error

    Code:
    Warning: include_once(grid_ALLOCSTATUS_nmutf8.php): failed to open stream: N
    Fixing this would be really useful, guys!
    The GuiGuy
    ... from Down Under

  • #2
    Did you try:

    Code:
    SELECT 
        `AllocStatusiD`,
        `AllocStatusCode`,
        `AllocStatusDescription`
    FROM 
         `ALLOCSTATUS`
    jsb

    Comment


    • #3
      [QUOTE=jsbinca;36898]Did you try:

      ... yes, of course. Makes no difference.

      The problem seems to appear with longer table and field names.

      It only appears in grids. In forms and editable grids it seems OK.

      But as I said, it's been there since day one...
      The GuiGuy
      ... from Down Under

      Comment


      • #4
        I was just curios and tried the statement above.
        If you use it as it is, SC cuts off the 'ALL'.
        If you encapsulate the field with left tick marks ( `AllocStatusID` ) the statement works fine.

        I don't think it is the length (I have names much longer), it is the 'All' part of the names.
        it seems to me SC interprets it as the ALL keyword from MySQL.

        Nevertheless, it's a bug. :-)

        jsb
        Last edited by jsbinca; 05-24-2015, 07:20 AM.

        Comment


        • #5
          Hi,

          What is your database?
          Do you use last scriptcase release (8.00.0047)?

          I created in the MySql a table based in your table name and work fine, see image below:
          table.png img_1.png img_2.png



          please, send me your table and application for we test directly in your application.


          --
          Best regard
          Netmake team

          Comment


          • #6
            Originally posted by Artur Oliveira View Post
            Hi,
            please, send me your table and application for we test directly in your application.
            --
            Best regard
            Netmake team
            Thanks for your feed back.

            I have sent you applications with (mysql) database a couple of times about this in recent years. You never replied.

            I now have to report the problem is even worse.
            Now I find that when I enter the lookup SQL in a SELECT field

            Code:
            SELECT DISTINCT AllocSectionIndex.ID, AllocRows.Name
            FROM AllocSectionIndex INNER JOIN AllocRows ON AllocSectionIndex.ROW = AllocRows.ID  
            WHERE  AllocSectionIndex.AREA = {AreaID}  
            AND  AllocSectionIndex.PORTION = {PortionID} 
            ORDER BY AllocRows.Name
            The above works in SC's SQL Builder, provided I change the field variable to a literal. It fails at runtime.

            I get a compile warning and runtime error. Examining the SQL in the runtime error dialog I see it has been corrupted:

            Code:
            SELECT DISTINCT AllocSectionIndex.ID, AllocRows.NameFROM AllocSectionIndex INNER JOIN AllocRows ON AllocSectionIndex.ROW = AllocRows.ID WHERE (AllocSectionIndex.AREA = ) AND .portion = {portionid ORDER BY AllocRows.Name
            Note how the field name "AllocSectionIndex.PORTION" has been changed to .portioni and {PortionID} has been conformed to lower case? Now, that may be SC trying to normalize names, but it generates errors.

            Using field delimiters `fieldname` in mysql does not help.

            Aliasing field names works sometimes, but not always.

            Changing field & table names in the database can help, especially when names are made shorter and DO NOT start with 'ALL' - So, generally I come up against this problem when dealing with table names like `Allocations` or `AllocAreas`. Please note that aliasing the table names does not help. For example "`Allocations` AS `temptbl`" usually is corrupted by SC as "`ocations` AS `temptbl`"

            Sadly in this case I am working with an established database (mysql) designed & owned by another organisation. I am not allowed to change the table names and, again. trying to alias my way out of trouble does not work.
            Last edited by GuiGuy; 06-01-2015, 01:18 AM.
            The GuiGuy
            ... from Down Under

            Comment

            Working...
            X