Unsupported Screen Size: The viewport size is too small for the theme to render properly.

printing results and updating non-primary key dbs

forums forums SQLyog Using SQLyog printing results and updating non-primary key dbs

  • This topic is empty.
Viewing 5 reply threads
  • Author
    Posts
    • #7909
      chill
      Member

      Hi there

      I am doing a module in my university course which involves the use of Apache, PHP and MySQL. I am totally new to these programs and still trying to finding my way. I read about MySQL GUI programs in a textbook and came across SQLyog while doing an online search. Hmmm ABSOLUTELY WONDERFUL PROGRAM!!! – surely beats working from the dull and uninspiring command line :D. However, I have been experiencing a problem. I tried the 'export resultset' (using the HTML option) to a file on the desktop but failed to see or find the file anywhere. That action failed on all of my three attempts. I would be grateful for some help there (maybe export result set is not what I think it is). Please explain

      I tried to update a single table database (which had no primary key) from one of my practical sessions an learnt that this was not permitted. Such databases are read-only and cannot be altered. Is there any way around this??

      Additionally, I noticed that when query results are changed to text (using control l), they can be selected but cannot be copied/cut and pasted to the clipboard. Is this normal? Please assist.

      Finally when I did get to copy and paste, the query results (not using text view) to a textfile, I noticed that the columns in the first line did not line up with the rest of the data. Is this normal?

      Forgive the seeming cluelessness :D, for like I said I am new to these programs and still trying to find my way. I would be grateful for any help with the points I have raised.

      Once again thanks for a wonderful program!!!!

      Peter

    • #14228
      CalEvans
      Member

      Greetings peter and welcome to the wonderful world of SQL!

      Quote:
      surely beats working from the dull and uninspiring command line

      BACK OFF! cli's rule. 😀 but if you must use a gui, SQLyog is head and shoulders above anything else on the market.

      Quote:
      I tried to update a single table database (which had no primary key) from one of my practical sessions an learnt that this was not permitted. Such databases are read-only and cannot be altered. Is there any way around this??

      Your information is incorrect, you can have an updatable table without having a primary key. there is no concept that I know of in SQL for a read-only table. There are tables that you may not have INSERT or UPDATE permissions to but that's on a user-by-user basis. Check your settings or have your admin check them. (check the manual at MySQL for more info on user permissions)

      Quote:
      I tried the 'export resultset' (using the HTML option) to a file on the desktop but failed to see or find the file anywhere.

      What version of SQLyog are you using? I just tried exporting a resultset using 3.11 and other than the fact that it's a bit confusing because the filename is blank AND non-editable (you have to push the button) it works just fine. (Admittedly, I only tried exporting as HTML)

      Quote:
      Finally when I did get to copy and paste, the query results (not using text view) to a textfile, I noticed that the columns in the first line did not line up with the rest of the data. Is this normal?

      I'm really not sure what the problem is here. My guess is the answer to your question is Maybe. The Columns are delimited, not fixed width, unless you specified fixed width. If you specified Fixed Width then they should line up.

      Anyhow, I hope something I've said may have helped. (except for the cli crack, that was just for fun.) Keep posting if you have other questions or I've not been clear on something.

      =C=

    • #14229
      chill
      Member

      Thanks Cal for the prompt and extremely informative response

      I am still at the school so I am not able to verify the SQLyog version number on my PC at home. However, I downloaded and installed the latest available version about two weeks ago.

      I set up MySQL on my PC and I have full privileges. It is true that I can't insert any data or any other form of editing on database tables containg no primary keys in SQLyog (even when these containe foreign keys). There is this message which state that such tables are read only and to support this, clicking on the grids have no effect. Incidentally, I was able to insert new values in tables containg primary keys.

      That problem with the “off” first line obtained from a pasted query result occurred even when the columns were delimeters as fixed width.

      I will definitely keep using SQLyog to become to familiar with the features. Your comments have been of immense help. Armed with the knowledge that the features do work, motivates me to find a way to make them work on my machine 😛 – well I will try my best :P.

      Hey there is nothing wrong with a bit of humour 😀 . Wish that most of the other techno-geeks out there could have some too 😀 😀 😀 😀

      Thanks

      Peter

    • #14230
      Ritesh
      Member
      Quote:
      However, I have been experiencing a problem. I tried the 'export resultset' (using the HTML option) to a file on the desktop but failed to see or find the file anywhere. That action failed on all of my three attempts. I would be grateful for some help there (maybe export result set is not what I think it is). Please explain

      In the export resultset dialog box, select a file using button. When the file with the complete path comes in the read-only text box, press Export.

      Quote:
      I tried to update a single table database (which had no primary key)

      You can not update a table with no Primary Key defined in SQLyog. You have to write your own SQL stmt. to do that.

      Quote:
      Additionally, I noticed that when query results are changed to text (using control l), they can be selected but cannot be copied/cut and pasted to the clipboard.

      Press Ctrl+C to copy the data into clipboard in tab-delimited format

      HTH

    • #14231
      chill
      Member

      Thanks Ritesh for the info

      My query results were not being exported because I was not clicking on the 'export' button – surprise, surprise :roll:. I followed Cal's advice and that export feature worked as expected.

      However, no matter what I do, I still cannot get the tab delimetered data columns to line up as expected when query results exported to a textfile. I have tried t and even tt in both fixed length and variable length formats but still end up with some un-alligned columns. I have noticed that this happens when the text in a particular column exceeds a certain length. I'll try the CTRL + C as u suggested to copy the data in tab delimetered format to see if that would help.

      Quote:
      You can not update a table with no Primary Key defined in SQLyog. You have to write your own SQL stmt. to do that.

      Regarding the above quote, can the SQL stmt be written and executed in SQLyog or must that be done at the console?

      Thanks

      Peter 😀

    • #14232
      Ritesh
      Member

      You can execute any type of SQL using SQLyog 😀

Viewing 5 reply threads
  • You must be logged in to reply to this topic.