Re: Decouple SQL queries from class in OOP design



Daniel Parker wrote:
> An update operation may
> involve updates to several tables, "if exists then update else insert"
> logic, checks on other tables, etc. and this logic can be conveniently
> collected in the stored procedure.

Merge operation? (Often called upsert).

As for complex insert operation, why there might be more than one place
in the program where I store the shopping cart? OK, suppose there is,
then the arguments to the storeCart stored procedure have to be rather
complex -- array of items.

The point of creating a function is to abstract some nontrivial
behaviour in it. Inserting a master record and a set of child records
is simple. For me it would take the same amount of time learning how to
invoke the function properly, versus calling the DML statements
directly. I have to be familiar with database schema, of course. The
idea that database application programminng can be schema agnostic is
nonsence.

> Not so silly, but the problem here is that the ANSII standard dosesn't
> support returning arbitrary numbers of rows through SELECT statements.
> SYBASE does support that, and with SYBASE you have a lot of room to
> play with how the query is implemented without affecting the client
> application, assuming, of course, some simple database accessor layer
> in the middle. For example, you can implement the stored procedure
> with one select statement, then change to two select statements, then
> add some new attributes, change an attribute name in a table but alias
> it to the old name, use some secret Sybase techniques to force an index
> if the query takes forever - you can do all of these things without
> having to recompile your C, C++ or Java client app. But ANSII and
> Oracle don't support this, and SYBASE has almost disappeared off the
> database landscape, so I don't do this anymore.

If that feature mattered, the big three would give no second thought
implementing it. There is not a lot of new development in the database
landscape happening nowadays.

.



Relevant Pages

  • Re: Decouple SQL queries from class in OOP design
    ... > to the database are morons who are clueless about data fundamentals. ... match the parameter names of an update stored procedure, ... support returning arbitrary numbers of rows through SELECT statements. ... SYBASE does support that, and with SYBASE you have a lot of room to ...
    (comp.object)
  • Re: Sybase to Access
    ... would be willing to accept SQL 2005 _CRAP_ that is built into VB 2005. ... supported on TRANSMETA, ... I've had apps with an Access database that was 500MB, ... Access could use link tables to link to Sybase perhaps and ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Check whether a table is used in a stored procedure
    ... I'am stuck with a tricky task in sybase. ... If table tab1 is being used in stored procedure sp1(in database ...
    (comp.databases.sybase)
  • Re: Check whether a table is used in a stored procedure
    ... I'am stuck with a tricky task in sybase. ... If table tab1 is being used in stored procedure sp1(in database ...
    (comp.databases.sybase)
  • How to store 2^128 value in oracle
    ... I need to store a value equal to 2^128 in an oracle or sybase ... database. ... looks like neither of them support that big of a number. ...
    (comp.databases.oracle.misc)