Bug since SC5, still not fixed:

SQL in Grid:

SELECT 
    AllocStatusID,
    AllocStatusCode,
    AllocStatusDescription
FROM 
    ALLOCSTATUS

Code generated:

 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


Warning: include_once(grid_ALLOCSTATUS_nmutf8.php): failed to open stream: N

Fixing this would be really useful, guys!

Did you try:


SELECT 
    `AllocStatusiD`,
    `AllocStatusCode`,
    `AllocStatusDescription`
FROM 
     `ALLOCSTATUS`

jsb

[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…

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. :slight_smile:

jsb

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:

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


Best regard
Netmake team

img_1.png

table.png

img_2.png

[QUOTE=Artur Oliveira;36935]Hi,
please, send me your table and application for we test directly in your application.

Best regard
Netmake team[/QUOTE]

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

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:

SELECT DISTINCT AllocSectionIndex.ID, AllocRows.NameFROM AllocSectionIndex INNER JOIN AllocRows ON AllocSectionIndex.ROW = AllocRows.ID WHERE (AllocSectionIndex.AREA = ) AND [B].portion[/B] = {[B]portioni[/B]d 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.