Query string doesn't include database name when use mysql

Posts   
 
    
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 19-Sep-2016 12:25:02   

Database:mysql 5.x LLBLGen: v4.2

when execute a query, then query string doesn't include database name, see below: Query: SELECT role_group.Code, role_group.Name FROM role_group

I know I can specify database name in connection string, but I need operate tables from multi database, for example: Table1 from databaseA and Table2 from databaseB, they are in single LLBL project, and Table1Entity and Table2Entity in same project, How to resolve this?

In SQL Server the query string should be: SELECT xxxxxxxxxxxxxxxxx from [databaseA].[Table1]; SELECT xxxxxxxxxxxxxxxxx from [databaseB].[Table2]; It include database name in query string.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 19-Sep-2016 19:12:53   

Please check the application configuration file and see if there is a sqlServerCatalogNameOverwrites section defined. If so, then check the new names set, it can be that someone has set them to an empty string.

More details on Catalog name overwriting

xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 20-Sep-2016 04:40:35   

Walaa wrote:

Please check the application configuration file and see if there is a sqlServerCatalogNameOverwrites section defined. If so, then check the new names set, it can be that someone has set them to an empty string.

More details on Catalog name overwriting

Maybe I described not very clear. What I mean is I want operate tables from multi databases my Schema is:

Database1 |__Table1 Database2 |__Table2

The query sql statement not contains database name, so the catalog name overwriting no work. The query will be executed on database 'mysql' which specified in connectionstring. When use sql server, I need not specify the database name in connectionstring, because the query sql statement contains database name even entities from different database. This is SQL Server statement: Select xxxxxxxxxxxxx from [databasename].[tablename] This is MySql statement: Select xxxxxxxxxxxxx from [tablename]

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Sep-2016 08:26:12   

You need to specify that you want to include the catalog name in the queries. Please check Catalog name inclusion (MySql only). It's a setting in you <appSettings> in the .config file. Something like:

<add key="mySqlIncludeCatalogNameInObjectNames" value="true" />

If you still experience problems, please tell us more info, like your LLBLGen runtime library version ( http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725 ).

David Elizondo | LLBLGen Support Team
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 21-Sep-2016 10:08:55   

daelmo wrote:

You need to specify that you want to include the catalog name in the queries. Please check Catalog name inclusion (MySql only). It's a setting in you <appSettings> in the .config file. Something like:

<add key="mySqlIncludeCatalogNameInObjectNames" value="true" />

If you still experience problems, please tell us more info, like your LLBLGen runtime library version ( http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725 ).

It's worked, thank you.