ORA-00942: table or view does not exist

985 views
Skip to first unread message

jeffreyequizuvero

unread,
Nov 9, 2016, 8:25:49 PM11/9/16
to Django users
Hi everyone.

I am new in Django Development and I encountered this problem, please help

TIA

Jeffrey E. Uvero 


DatabaseError at /login/

ORA-00942: table or view does not exist

Request Method:POST
Request URL:http://127.0.0.1:8000/login/
Django Version:1.10.1
Exception Type:DatabaseError
Exception Value:
ORA-00942: table or view does not exist


(This is ny model)
class TblUser(models.Model):
    id = models.IntegerField(primary_key=True)  # AutoField?
    user_code = models.CharField(max_length=50, default=user_code_key)
    full_name = models.CharField(max_length=50, blank=True, null=True)
    firstname = models.CharField(max_length=50, blank=True, null=True)
    middlename = models.CharField(max_length=50, blank=True, null=True)
    lastname = models.CharField(max_length=50, blank=True, null=True)
    username = models.CharField(max_length=50, blank=True, null=True)
    password = models.CharField(max_length=150, blank=True, null=True)
    user_level = models.CharField(max_length=50, default='user')
    designation = models.CharField(max_length=50, blank=True, null=True)
    email_address = models.CharField(max_length=50, blank=True, null=True)
    date_registered = models.CharField(max_length=50, default=datetime.now())
    last_logged = models.CharField(max_length=50, blank=True, null=True)
    account_status = models.CharField(max_length=50, default='ACTIVE')
    verification = models.CharField(max_length=50, default='1')
    sys_code = models.CharField(max_length=50, default=sys_code_key)

    class Meta:
        managed = False
        db_table = '"TBLUSER"'

Charly Román

unread,
Nov 9, 2016, 8:27:05 PM11/9/16
to django...@googlegroups.com
Do you applied your migrations?

Charly Román
Software Developer
http://croman.mx

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/107cce9c-9795-40b9-ba74-194eb440b2bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeffrey Uvero

unread,
Nov 9, 2016, 8:45:23 PM11/9/16
to django...@googlegroups.com
Thank you for your response ,,

Yes. I applied migration, when I applying for that, another error comes out 

 return self.cursor.execute(query, self._param_generator(params))
django.db.utils.DatabaseError: ORA-00955: name is already used by an existing object


For more options, visit https://groups.google.com/d/optout.



--

Jeffrey E. Uvero

Amellar Solution

3rd Floor, LGI Building, Ortigas Avenue

Greenhills, San Juan City, 

Philippines 1500

Tel: (+63) 9776824461

SkypeID: jeffrey.uvero

Email: jeffreyeq...@gmail.com / jeffe...@gmail.com


Jani Tiainen

unread,
Nov 10, 2016, 3:16:37 AM11/10/16
to django...@googlegroups.com

Oracle migrations are problematic due that fact that Oracle DDL is not transactioned. So if something goes wrong you can't rollback to previous state, your database ends up in broken state (in theory django could clean it up).

Also try to avoid double quotes around table and column names. You only need them if you're working with legacy database where table names are written in lower case. Better yet, let Django to take care of table names all together.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com. To post to this group, send email to django...@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEtSeGvm-qos2qReYNrffLStbRiwiKFHU%3DP73A9%2BCtea14epSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
-- 
Jani Tiainen

Jeffrey Uvero

unread,
Nov 10, 2016, 7:04:24 PM11/10/16
to django...@googlegroups.com
Jani Tiainen, Thank you for your response .

Yes, I am using legacy database , that's why I can't control the naming of columns and tables

-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com. To post to this group, send email to django...@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEtSeGvm-qos2qReYNrffLStbRiwiKFHU%3DP73A9%2BCtea14epSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
-- 
Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.

Jani Tiainen

unread,
Nov 11, 2016, 2:54:03 AM11/11/16
to django...@googlegroups.com

Ok, since your model is not managed it doesn't create migrations either.

If table name is written in uppercase, you can remove double quotes, Oracle is by default uppercase and quoted format is only required for tables or fields that are written in mixed or lowercase.

Are you sure that problem is really your model?
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com. To post to this group, send email to django...@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEtSeGtzf24X66vrJF%2BQp-%2Bu4YYb5CfiiuOCi5A6whU%2B1Omk6w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
-- 
Jani Tiainen

Jeffrey Uvero

unread,
Nov 13, 2016, 7:32:41 PM11/13/16
to django...@googlegroups.com
I removed double quotes in table name but I still got the same error. 

-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com. To post to this group, send email to django...@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEtSeGtzf24X66vrJF%2BQp-%2Bu4YYb5CfiiuOCi5A6whU%2B1Omk6w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
-- 
Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.

Jani Tiainen

unread,
Nov 14, 2016, 1:13:12 AM11/14/16
to django...@googlegroups.com

Are you sure that Django is complaing about that particula model? Have you tried to debug what model table is actually missing?

You could also popup in Django IRC channel on Freenode to get more realtime debugging help and feedback.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com. To post to this group, send email to django...@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEtSeGtzu9_BLEcLb5EzV22YDwfbmUtjiHv0gNU9ocTRufx_Jw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
-- 
Jani Tiainen
Reply all
Reply to author
Forward
0 new messages