Professional Web Applications Themes

TABLE and VIEW same identifier: Please help - MySQL

I have some views whose identifier is same as that of table. I am unable to import the data with the command mysql -uuser -ppassword dbname < mydump.sql Can anyone suggest a fix without having to rename each view? Thanks ps: why did the mysql allow view and table to have the same identifier...

  1. #1

    Default TABLE and VIEW same identifier: Please help

    I have some views whose identifier is same as that of table. I am
    unable to import the data with
    the command

    mysql -uuser -ppassword dbname < mydump.sql

    Can anyone suggest a fix without having to rename each view?

    Thanks

    ps: why did the mysql allow view and table to have the same identifier

    soup_or_power@yahoo.com Guest

  2. #2

    Default Re: TABLE and VIEW same identifier: Please help

    [email]soup_or_power[/email] (soup_or_power) wrote:
    : I have some views whose identifier is same as that of table. I am
    : unable to import the data with
    : the command

    : mysql -uuser -ppassword dbname < mydump.sql

    : Can anyone suggest a fix without having to rename each view?

    : Thanks

    : ps: why did the mysql allow view and table to have the same identifier

    huh?

    According to the MySQL 5.0 Reference Manual :

    "...a database cannot contain a base table and a view that have
    the same name."

    How did you get a view and a table with the same name?

    Malcolm Dew-Jones Guest

  3. #3

    Default Re: TABLE and VIEW same identifier: Please help


    Malcolm Dew-Jones wrote:
    > [email]soup_or_power[/email] (soup_or_power) wrote:
    > : I have some views whose identifier is same as that of table. I am
    > : unable to import the data with
    > : the command
    >
    > : mysql -uuser -ppassword dbname < mydump.sql
    >
    > : Can anyone suggest a fix without having to rename each view?
    >
    > : Thanks
    >
    > : ps: why did the mysql allow view and table to have the same identifier
    >
    > huh?
    >
    > According to the MySQL 5.0 Reference Manual :
    >
    > "...a database cannot contain a base table and a view that have
    > the same name."
    >
    > How did you get a view and a table with the same name?
    Thanks for your reply. I'm not sure if the views already existed or the
    views were created by mysqldump. Is there a way to list the views a la
    "show tables" command?
    Anyway, my objective is to copy the tables from one database to another
    on the same host. Is there a way to do this? I am using mysqldump
    because it is recommended by some web sites.

    Thanks

    soup_or_power@yahoo.com Guest

  4. #4

    Default Re: TABLE and VIEW same identifier: Please help

    [email]soup_or_power[/email] wrote:
    > I have some views whose identifier is same as that of table. I am
    > unable to import the data with
    > the command
    >
    > mysql -uuser -ppassword dbname < mydump.sql
    >
    > Can anyone suggest a fix without having to rename each view?
    >
    > Thanks
    >
    > ps: why did the mysql allow view and table to have the same identifier
    >
    MySQL does not allow you to have one table and a view with the same name.
    There are two ways you may have got into this problem:

    1) You have already a table named 'ABC' in your database and you are trying to
    load from a dump file a view named 'ABC' as well.

    2) You have a table named 'ABC' and a view named 'abc' (note the case difference).
    In Unix systems, table and view names are case sensitive, so, if you
    load the dump into a Unix server, nothing wrong happens, even though I question
    the wiseness of such a name choice.
    However, Windows table names are case insensitive. Thus if you are loading to a
    Windows server a dump produced in a Unix one you could have a conflict.


    Workaround: change the name of one of the offending items.

    ciao
    gmax

    --
    _ _ _ _
    (_|| | |(_|>< The Data Charmer
    _|
    [url]http://datacharmer.org/[/url]
    Giuseppe Maxia Guest

Similar Threads

  1. I cant see most of the table in Dreamweaver Design View
    By cosmicbeach in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: October 22nd, 12:14 PM
  2. change table to view problem
    By Sim Zacks in forum PostgreSQL / PGSQL
    Replies: 1
    Last Post: February 1st, 09:13 AM
  3. sorted table or view
    By sam in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: September 15th, 03:27 PM
  4. Scroll Row in Table into View?
    By Saravana in forum ASP.NET General
    Replies: 1
    Last Post: July 28th, 06:19 PM
  5. Pivot Table View Problem
    By Milan in forum Microsoft Access
    Replies: 1
    Last Post: July 28th, 03:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139