Telman Yusupov | 29 Nov 2008 08:48

[web2py:12622] Calling Oracle stored procedures


Hi everyone,

I'm developing a web2py application on top of a legacy Oracle database
and need to call some existing stored procedures that mplement some
complex transactional computations that would be impractical to
perform in application layer.

I have cx-oracle driver installed and properly working - DAL works
fine for straightforward web2py ORM activities.

cx-oracle implements callproc function for these purposes.
Unfortunately, I'm new to Python and wasn't able to modify sql.py in
gluon package to add it to DAL.

So, instead, I'm trying to use executesql method  in my controller
trying to pass an anonymous PL/SQL block, as in this example:

db.executesql('begin my_proc_name(arg1, arg2); end;')

Unfortunately, I keep getting errors like the one below. I think I've
tried every possible combination but none of them work.

DatabaseError: ORA-06550: line 1, column 26:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of
the following:

   ; <an identifier> <a double-quoted delimited-identifier>
The symbol ";" was substituted for "end-of-file" to continue

(Continue reading)

mdipierro | 29 Nov 2008 09:16
Picon
Gravatar

[web2py:12623] Re: Calling Oracle stored procedures


You can use

   db._connection # the raw cx_oracle connection

or

   db._cursor # the raw cx_oracle cursor

as in

    db._cursor.execute("your raw sql")

Mind that I believe cx_oracle does not like the terminating ";". You
need to try with and without that.

Massimo

On Nov 29, 1:48 am, Telman Yusupov <c...@...> wrote:
> Hi everyone,
>
> I'm developing a web2py application on top of a legacy Oracle database
> and need to call some existing stored procedures that mplement some
> complex transactional computations that would be impractical to
> perform in application layer.
>
> I have cx-oracle driver installed and properly working - DAL works
> fine for straightforward web2py ORM activities.
>
> cx-oracle implements callproc function for these purposes.
(Continue reading)

Iceberg | 29 Nov 2008 10:02
Favicon

[web2py:12624] Is there a best way to do doctest for models?


Hi everyone,

Is there a best way to do doctest for models? Currently "web2py.py -T
app" only runs doctests in controllers, but not doctests in model. You
might say that generally a model should not contain logic at all. I
understand that but sometimes you just feel convenient to define
several wrapper-functions to share between different controllers.
Besides, my wrapper-functions (as well as their doctests) have close
relationship with model definitions so that I don't want to put them
in another module file or using separate tests/some_script.py

Any suggestion? Thanks in advance.

Regards,
Iceberg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Baron | 29 Nov 2008 13:40
Picon
Gravatar

[web2py:12625] web2py slashdotted


...almost...

This slashdot page (http://developers.slashdot.org/developers/
08/11/28/1335248.shtml) discusses an article (http://advogato.org/
article/993.html) about integrating Pyjamas (Python GWT) with web2py.
Is that a sensible idea? My understanding of GWT is that it is a
complete client/server solution, so I don't see how they could be
integrated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

SergeyPo | 29 Nov 2008 14:59

[web2py:12626] Search by date bug?


Hi guys!

My code:
db(db.data_storage.ca_date==a_date).select(limitby=(limit, offset))

If I use a_date='2007-01-01' I get a result set (that I actually have
in database)
but if a_date='2007-1-1'    or  a_date='2007-01-1'    or etc. - it can
not find the records dated 1st January 2007.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

pmate | 29 Nov 2008 15:34
Picon

[web2py:12627] Re: one to many relations


yes Denesi, that's the point.
Usually indexes in a table can be more than one. And they are useful
for the speed of queries and for foreign relationship, i think
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Jonathan Benn | 29 Nov 2008 15:51
Picon

[web2py:12628] Re: non-ascii chars URL


Here's a quote from section 1.5 of RFC 2396:

"The URI syntax was designed with global transcribability as one of
its main concerns. A URI is a sequence of characters from a very
limited set, i.e. the letters of the basic Latin alphabet, digits, and
a few special characters."

Here are the relevant RFCs:

http://www.faqs.org/rfcs/rfc2396.html
http://www.faqs.org/rfcs/rfc2616.html

I hope that helps,

--Jonathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

mdipierro | 29 Nov 2008 17:29
Picon
Gravatar

[web2py:12629] Re: web2py slashdotted


I think it is an interesting idea. Need to study it carefully next
week.

Massimo

On Nov 29, 6:40 am, Baron <richar...@...> wrote:
> ...almost...
>
> This slashdot page (http://developers.slashdot.org/developers/
> 08/11/28/1335248.shtml) discusses an article (http://advogato.org/
> article/993.html) about integrating Pyjamas (Python GWT) with web2py.
> Is that a sensible idea? My understanding of GWT is that it is a
> complete client/server solution, so I don't see how they could be
> integrated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

mdipierro | 29 Nov 2008 17:30
Picon
Gravatar

[web2py:12630] Re: Search by date bug?


actually a_date should be datetime.date(2007,1,1). it will also accept
the ISO string.

On Nov 29, 7:59 am, SergeyPo <ser...@...> wrote:
> Hi guys!
>
> My code:
> db(db.data_storage.ca_date==a_date).select(limitby=(limit, offset))
>
> If I use a_date='2007-01-01' I get a result set (that I actually have
> in database)
> but if a_date='2007-1-1'    or  a_date='2007-01-1'    or etc. - it can
> not find the records dated 1st January 2007.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Telman Yusupov | 29 Nov 2008 17:48

[web2py:12631] Re: Calling Oracle stored procedures


Thank you very much, Massimo! It worked with this syntax:

db._cursor.execute("begin my_proc_name('arg1', 'arg2'); end;")

- it did require a trailing semicolon.

Thanks again,

Telman

On Nov 29, 3:16 am, mdipierro <mdipie...@...> wrote:
> You can use
>
>    db._connection # the raw cx_oracle connection
>
> or
>
>    db._cursor # the raw cx_oracle cursor
>
> as in
>
>     db._cursor.execute("your raw sql")
>
> Mind that I believe cx_oracle does not like the terminating ";". You
> need to try with and without that.
>
> Massimo
>
> On Nov 29, 1:48 am, Telman Yusupov <c...@...> wrote:
(Continue reading)


Gmane