Trying to make a django test application which will use stored oracle's 
procedures to insert/get data.

Using jython with zxJDBC but same error applies with python and cx_oracle 
too.

here is some code snipets:

models.py

> from django.db import models
> from django.db import connection
>
> class ALEX_TEST_PKG():
>     def get_data(self, inparam1):
>         cursor = connection.cursor()
>         ret = cursor.callproc("ALEX_TEST_PKG.test0", inparam1)
>         cursor.close
>         return ret
>
> views.py

> class TestForm(forms.Form):
>     inparam1 = forms.IntegerField()
>
>
> def message(request):
>     if request.method == 'POST':
>         form = TestForm(request.POST)
>     else:
>         form = TestForm()
>     if form.is_valid():
>         my_util = ALEX_TEST_PKG()
>         ret = my_util.get_data(request.POST['inparam1'])
>         return HttpResponse(ret)
>     return render_to_response('form.html', {'form':form}, 
> context_instance=RequestContext(request))
>
>
oracle's procedures:

> CREATE OR REPLACE PACKAGE BODY ALEX.alex_test_pkg
> IS
>    PROCEDURE test0 (inparam1 IN integer)
>    IS
>    BEGIN
>       insert into alex_debug(col1) values(inparam1); 
>    END test0;
> END alex_test_pkg;
> /
>
>
Django error log:

> Environment:
>
>
> Request Method: POST
> Request URL: http://localhost:8000/form/
>
> Django Version: 1.3.1
> Python Version: 2.7.0
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'django.contrib.admin',
>  'dbtest']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware')
>
>
> Traceback:
> File 
> "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\handlers\base.py"
>  in get_response
>   111.                         response = callback(request, *callback_args, 
> **callback_kwargs)
> File "E:\WatchTower\workspace3\erwtwe\erwtwe\dbtest\views.py" in message
>   19.         ret = my_util.get_data(request.POST['inparam1'])
> }File "E:\WatchTower\workspace3\erwtwe\erwtwe\dbtest\models.py" in get_data
>   7.         ret = cursor.callproc("ALEX_TEST_PKG.test0", inparam1)
>
> Exception Type: DatabaseError at /form/
> Exception Value: ORA-06550: line 1, column 7:
> PLS-00306: wrong number or types of arguments in call to 'TEST0'
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignore
>
>
 

Any help is appriciated. breaking my head with this for 4 days already.

{stackoverflow xposted}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mc_0lbAI4yEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to