Jump to content


Photo

Query Builder Without Database Name


  • Please log in to reply
9 replies to this topic

#1 Stephan123

Stephan123

    Member

  • Members
  • PipPip
  • 27 posts

Posted 11 March 2011 - 12:40 PM

Hello !

I work for several days with SQLyog.
It's a great program.
In most cases i work with the query builder.
I use the generated questions in my new project.

For example:

select
name.user,
lastname.user
from
group.user, group.role-id
where
...

And here is my problem. In the generated
question is the name of the database.
Is there an way to generat questions without database name's.

Your sincerly

Stephan
(Sorry for my bad english)

#2 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,869 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 11 March 2011 - 01:04 PM

No such option.

However if you want to replcae database name `this` with `that` just copy the query to an editor tab and use 'search and replace'. Also you may replace " `this`. " with " '' " (empty string) if you do not want to use 'fully qualified table names'.


Computers make your grey hair come off ....

Peter Laursen
Webyog

#3 DarkShadowSwE

DarkShadowSwE

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 03 December 2011 - 12:32 PM

i would like to have an option to remove the "database.tablename" from queries made with the builder like the ´ could be removed.

exampel:

SELECT table1.*, table2.*
FROM dbnamehere.table1 LEFT JOIN dbnamehere.table2 ON (table1.t1ID = table2.t2ID)
WHERE ....

=

SELECT table1.*, table2.*
FROM table1 LEFT JOIN table2 ON (table1.t1ID= table2.t2ID)
WHERE ....

with no "dbnamehere."

#4 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,869 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 03 December 2011 - 12:41 PM

Is it a big deal to 'search and replace' (CTRL+H) "`databasename`." with an empty string after copying to editor?


Computers make your grey hair come off ....

Peter Laursen
Webyog

#5 DarkShadowSwE

DarkShadowSwE

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 05 December 2011 - 10:17 AM

Is it a big deal to 'search and replace' (CTRL+H) "`databasename`." with an empty string after copying to editor?


i think os yes , sins im sitting all day working in sqlyog on 1 screen and notpad++ onm the other , would be much better to just have an option to remove it like the remove ´ option.

#6 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,869 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 05 December 2011 - 09:33 PM

OK .. I think you have a point.

1) If the query you generate should be executed from SQLyog the fully qualified table name makes sense, because if you change the databae context the query will fail (at best).

2) But if you generate a query solely with the purpose to use it in an application/script where the database name may be different, a query without the database name would be useful.
Computers make your grey hair come off ....

Peter Laursen
Webyog

#7 sathish

sathish

    Advanced Member

  • Admin
  • PipPipPip
  • 293 posts
  • Gender:Male

Posted 06 December 2011 - 11:58 AM

Hello,

This feature request is already listed in our issue tracker: http://code.google.c.../detail?id=1107 we will schedule this according to priority.

Regards,
Sathish

#8 DarkShadowSwE

DarkShadowSwE

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 07 December 2011 - 08:06 AM

OK .. I think you have a point.

1) If the query you generate should be executed from SQLyog the fully qualified table name makes sense, because if you change the databae context the query will fail (at best).

2) But if you generate a query solely with the purpose to use it in an application/script where the database name may be different, a query without the database name would be useful.


ye, number two describes what i do sins i make the queries in sqlyog and then paste them into PHP scripts, and sins i use 1 development DB and 1 live DB it would be usefull to not have to delete the database name every single time.

Hello,

This feature request is already listed in our issue tracker: http://code.google.c.../detail?id=1107 we will schedule this according to priority.

Regards,
Sathish


ye , true, it was added... , over 2.5 years ago..., and even tho several people have asked for the feature in the last 2 years it still havent been added...

#9 ashwin

ashwin

    Advanced Member

  • Members
  • PipPipPip
  • 275 posts
  • Gender:Male
  • Location:Bangalore, India

Posted 09 February 2012 - 10:49 AM

Is there an way to generat questions without database name's.

Hello,

We have released 9.6 Beta3 with this feature. "It is now optional if Query Builder will create statements with ‘fully qualified tablenames’ or not." Refer: http://www.webyog.co...eta-3-released/

Regards,
Ashwin A

#10 DarkShadowSwE

DarkShadowSwE

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 28 February 2012 - 08:03 AM

fishy place to put the setting, thought it would be under the "Generate queries using backquotes(`)" in preferences, but its still a realy nice feature, cheers.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users