Assistance needed with creating tables in oracle.

Assistance needed with creating tables in oracle.

Post by KPK » Mon, 13 May 2002 01:31:39



Hello all:

We are building support into our Powerbuilder 7.0 application to allow our
customers to utilize their Oracle databases (we are testing against 8i).

Right now our application has support for Microsoft SQL Server 7.0 and 2000
as well as Sybase SQL AnyWhere 5.5 as well as Adaptive Server 7.  Oracle
(later DB/2 as well) support is being added now.

In our application, we make use of temporary tables quite a bit.  Consider
the following example:

Set SQLCA.AutoCommit = TRUE

Create Table #TempVols(ObjID int, StartOil float, EndOil float)

Insert Into #TempVols(ObjID, StartOil, EndOil)
Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
Sum(EndingOilVol)
From CompletionDaily, TankDaily
Where CompletionDaily.ObjectID = TankDaily.ObjectID and RecordDate =
'02-02-2002'
           and UserID = 400

Update TankCompletionDaily
Set BeginningOil = StartOil,
      EndingOil = EndOil
From #TempVols
Where ObjID = TankCompID and RecordDate = '02-02-2002' //or whatever date we
want

Just ignore the "set sqlca.autocommit = true" line because that is unique to
Powerbuilder.

I don't want to use a nested SELECT for each column being updated because
it's too slow.  The #Temp Table method is much faster as I have already
tested it.

What's nice about this, is that I can create it in a stored procedure or
within Powerbuilder using Dynamic SQL and Powerbuilder's Transaction Object.
The stored procedure is a bit faster than doing it in PB, however.

How can I accomplish this same task within 8i using a temp table?  The
reason for the temp table is that both Sybase and SQL Server handle the temp
table a bit differently from a normal table.

In what ways you ask?

Well first, when the temp table is created, both databases generate a unique
value and append it to the temp table so that if any other users run this
code simultaneously, they too will have their own temp table with different
values assigned to their current transaction/connection session therefore
eliminating the possibility of table name conflicts.  Once the code above is
complete, both databases (after the commit) will delete the temp table.
Another reason for using a temp table is that we have some stored procedures
that are quite long.  We create the temp table at the beginning of the
stored procedure and populate it with ONLY those records that meet our
selection criteria and the rest of the stored procedure's queries and sql
transactions can make use and even join against that temp table.

Any suggestions?

 
 
 

Assistance needed with creating tables in oracle.

Post by Sybrand Bakke » Mon, 13 May 2002 00:12:27



Quote:> Hello all:

> We are building support into our Powerbuilder 7.0 application to allow our
> customers to utilize their Oracle databases (we are testing against 8i).

> Right now our application has support for Microsoft SQL Server 7.0 and
2000
> as well as Sybase SQL AnyWhere 5.5 as well as Adaptive Server 7.  Oracle
> (later DB/2 as well) support is being added now.

> In our application, we make use of temporary tables quite a bit.  Consider
> the following example:

> Set SQLCA.AutoCommit = TRUE

> Create Table #TempVols(ObjID int, StartOil float, EndOil float)

> Insert Into #TempVols(ObjID, StartOil, EndOil)
> Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
> Sum(EndingOilVol)
> From CompletionDaily, TankDaily
> Where CompletionDaily.ObjectID = TankDaily.ObjectID and RecordDate =
> '02-02-2002'
>            and UserID = 400

> Update TankCompletionDaily
> Set BeginningOil = StartOil,
>       EndingOil = EndOil
> From #TempVols
> Where ObjID = TankCompID and RecordDate = '02-02-2002' //or whatever date
we
> want

> Just ignore the "set sqlca.autocommit = true" line because that is unique
to
> Powerbuilder.

> I don't want to use a nested SELECT for each column being updated because
> it's too slow.  The #Temp Table method is much faster as I have already
> tested it.

> What's nice about this, is that I can create it in a stored procedure or
> within Powerbuilder using Dynamic SQL and Powerbuilder's Transaction
Object.
> The stored procedure is a bit faster than doing it in PB, however.

> How can I accomplish this same task within 8i using a temp table?  The
> reason for the temp table is that both Sybase and SQL Server handle the
temp
> table a bit differently from a normal table.

> In what ways you ask?

> Well first, when the temp table is created, both databases generate a
unique
> value and append it to the temp table so that if any other users run this
> code simultaneously, they too will have their own temp table with
different
> values assigned to their current transaction/connection session therefore
> eliminating the possibility of table name conflicts.  Once the code above
is
> complete, both databases (after the commit) will delete the temp table.
> Another reason for using a temp table is that we have some stored
procedures
> that are quite long.  We create the temp table at the beginning of the
> stored procedure and populate it with ONLY those records that meet our
> selection criteria and the rest of the stored procedure's queries and sql
> transactions can make use and even join against that temp table.

> Any suggestions?

1 Try to learn Oracle, or better still try to learn SQL.
Sucessful one on one ports from Sqlserver to Oracle don't exist, because
Oracle is not sqlserver sold by a different vendor. If I have to investigate
performance problems on a database which is used for an application which
has been ported from Sqlserver to Oracle, that is ALWAYS the root cause: the
developers involved simply didn't know anything about Oracle. Read the
initial chapters of Tom Kyte's book and you will see this demonstrated into
more detail

2 If you *really* think you can't do without temp tables (and the above
example shows you resort to temp tables for simply *everything*)
, check out the Oracle manuals on GLOBAL TEMP tables.

Regards

--
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address

 
 
 

Assistance needed with creating tables in oracle.

Post by KPK » Mon, 13 May 2002 13:21:16


Thanks for the reply.

I'll have you know that I've been writing SQL now since the WatCOM SQL days
(late 80s-early 90s).  I've been writing software since 1981 and started out
with DBase and moved into Sybase on Unix and then SQL Server and Sybase on
Windows.  I've written scalable sybase and sql server-based applications
that are being used by 3 of the top 10 independent Oil and Gas producers in
the United States.  I have also designed and written SQL Server and Sybase
applications used in plant Safety Systems that are now responsible for
saving the lives of many oilfield and hydrocarbon plant workers in the Gulf
of Mexico region.  These apps are not only scalable, but are very fast (at
the database level) in those areas where timing is critical for setting
Alarm conditions.  Our intentions for this application is not to merely
*TACK ON* support for Oracle, but investigate those areas where Oracle and
(later DB/2) provide the best performance.  It just so happens that our
tests have shown that both Sybase and SQL Server perform well utilizing the
*temp table* technique I illustrated.  My intentions are not to try and
stabb at Oracle, but to acquire valuable technical information from folks (I
figured) knew more about the product than I currently do.  Over the past
several months, I've been periodically visiting a few of these Oracle
newsgroups and it seems that everytime a developer who previously utilized a
competing database asks a simple (How To using Oracle) question, they are
branded as SQL idiots!  As if PL/SQL is the ONLY SQL there is.  As I recall
Transact SQL has been around for quite sometime as well and is also very
successful and well accepted.  I happen to like PL/SQL as I've done some ADA
programming back in the day.  We are merely trying to better understand the
syntax and the best techniques to use within the Oracle database.  That's
why at the end of my posting, I asked "Any Suggestions?"  If indeed the temp
table method is not the best approach, then suggest something that is or
don't.  This application is our company's livelihood and we only hurt our
company by not optimizing performance on all of the major DB platforms in
the industry which we serve.  Pardon me and all of us non-Oracle developers
trying to better understand and embrace Oracle for using newsgroups in the
manner which they were meant to be used.  I do indeed apologize and I do
intend to purchase one of the many great Oracle PL/SQL titles out there.  I
just thought I could reach out to my fellow developers without being
chastized for not first reading some book.  By providing support for Oracle
in our application only helps those smaller independents who have not yet
standardized or even utilize any SQL database consider using Oracle within
their organization.  Larry Ellison would be proud.  Up until about 3 years
ago, there was virtually NO presence of Oracle in the offshore environment.
Now that companies like ours and oilfield consultant firms like the last one
I worked for suggest Oracle, it is beginning to replace Sybase and SQL
Server out there.

With regard to your comment:

Quote:> 2 If you *really* think you can't do without temp tables (and the above
> example shows you resort to temp tables for simply *everything*)
> , check out the Oracle manuals on GLOBAL TEMP tables.

I only cited one example of where the temp table (for those platforms)
offers the greatest benefit and talked about how we've used them in stored
procedures (for those platforms).  Don't have a cow!
I have written more than a thousand stored procedures and triggers and made
use of temp tables in perhaps 10% to 12% of them.  I don't know where you
get these *assumptions*!




> > Hello all:

> > We are building support into our Powerbuilder 7.0 application to allow
our
> > customers to utilize their Oracle databases (we are testing against 8i).

> > Right now our application has support for Microsoft SQL Server 7.0 and
> 2000
> > as well as Sybase SQL AnyWhere 5.5 as well as Adaptive Server 7.  Oracle
> > (later DB/2 as well) support is being added now.

> > In our application, we make use of temporary tables quite a bit.
Consider
> > the following example:

> > Set SQLCA.AutoCommit = TRUE

> > Create Table #TempVols(ObjID int, StartOil float, EndOil float)

> > Insert Into #TempVols(ObjID, StartOil, EndOil)
> > Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
> > Sum(EndingOilVol)
> > From CompletionDaily, TankDaily
> > Where CompletionDaily.ObjectID = TankDaily.ObjectID and RecordDate =
> > '02-02-2002'
> >            and UserID = 400

> > Update TankCompletionDaily
> > Set BeginningOil = StartOil,
> >       EndingOil = EndOil
> > From #TempVols
> > Where ObjID = TankCompID and RecordDate = '02-02-2002' //or whatever
date
> we
> > want

> > Just ignore the "set sqlca.autocommit = true" line because that is
unique
> to
> > Powerbuilder.

> > I don't want to use a nested SELECT for each column being updated
because
> > it's too slow.  The #Temp Table method is much faster as I have already
> > tested it.

> > What's nice about this, is that I can create it in a stored procedure or
> > within Powerbuilder using Dynamic SQL and Powerbuilder's Transaction
> Object.
> > The stored procedure is a bit faster than doing it in PB, however.

> > How can I accomplish this same task within 8i using a temp table?  The
> > reason for the temp table is that both Sybase and SQL Server handle the
> temp
> > table a bit differently from a normal table.

> > In what ways you ask?

> > Well first, when the temp table is created, both databases generate a
> unique
> > value and append it to the temp table so that if any other users run
this
> > code simultaneously, they too will have their own temp table with
> different
> > values assigned to their current transaction/connection session
therefore
> > eliminating the possibility of table name conflicts.  Once the code
above
> is
> > complete, both databases (after the commit) will delete the temp table.
> > Another reason for using a temp table is that we have some stored
> procedures
> > that are quite long.  We create the temp table at the beginning of the
> > stored procedure and populate it with ONLY those records that meet our
> > selection criteria and the rest of the stored procedure's queries and
sql
> > transactions can make use and even join against that temp table.

> > Any suggestions?

> 1 Try to learn Oracle, or better still try to learn SQL.
> Sucessful one on one ports from Sqlserver to Oracle don't exist, because
> Oracle is not sqlserver sold by a different vendor. If I have to
investigate
> performance problems on a database which is used for an application which
> has been ported from Sqlserver to Oracle, that is ALWAYS the root cause:
the
> developers involved simply didn't know anything about Oracle. Read the
> initial chapters of Tom Kyte's book and you will see this demonstrated
into
> more detail

> 2 If you *really* think you can't do without temp tables (and the above
> example shows you resort to temp tables for simply *everything*)
> , check out the Oracle manuals on GLOBAL TEMP tables.

> Regards

> --
> Sybrand Bakker
> Senior Oracle DBA

> to reply remove '-verwijderdit' from my e-mail address

 
 
 

Assistance needed with creating tables in oracle.

Post by Jim Kenned » Mon, 13 May 2002 14:15:26


Unlike Sqlserver and Sybase you don't need (or very very rarely) need temp
tables in Oracle.  Yes, in Sybase and Sqlserver you need them and I am sure
you are correct that using them in those environments gives you the fastest
performance in those environments - no arguement.  In Oracle however, you
don't have to go through all those gyrations. (Good approuch possibly for
SQLServer and Sybase - not a good approuch in Oracle. I am not saying you
are stupid; I am saying things work differently.)  You can use SQL (not
pl/sql or transact, just sql).  If you still feel you just gotta have temp
tables use global temporary tables otherwise performance will suffer
greatly.  In Oracle readers don't block writers and writers don't block
readers.  It will save you a lot of pain and anguish to try some simple
experiements in Oracle and see that the differences are great and use those
differences to your advantage.  Again, this has nothing to do with your
intelligence; it is just the products are different and assumptions in one
are not valid in the other.

Tom Kyte's book is excellent and well worth the money.  His site is at:
http://asktom.oracle.com/pls/ask/f?p=4950:1:

Some useful links:
http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:48812348054,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:1423204060137,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:1164655862293,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:734225532321,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:1886476148373,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:1502605216980,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:1136552219291,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:61012348055,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
4950_P8_CRITERIA:1390203651798,%7Bsybase%7D%20and%20%7Boracle%7D

That should help.

Jim

"KPK" <kpkel...@alltel.net> wrote in message

news:abkjht$e0b$1@iac5.navix.net...
> Thanks for the reply.

> I'll have you know that I've been writing SQL now since the WatCOM SQL
days
> (late 80s-early 90s).  I've been writing software since 1981 and started
out
> with DBase and moved into Sybase on Unix and then SQL Server and Sybase on
> Windows.  I've written scalable sybase and sql server-based applications
> that are being used by 3 of the top 10 independent Oil and Gas producers
in
> the United States.  I have also designed and written SQL Server and Sybase
> applications used in plant Safety Systems that are now responsible for
> saving the lives of many oilfield and hydrocarbon plant workers in the
Gulf
> of Mexico region.  These apps are not only scalable, but are very fast (at
> the database level) in those areas where timing is critical for setting
> Alarm conditions.  Our intentions for this application is not to merely
> *TACK ON* support for Oracle, but investigate those areas where Oracle and
> (later DB/2) provide the best performance.  It just so happens that our
> tests have shown that both Sybase and SQL Server perform well utilizing
the
> *temp table* technique I illustrated.  My intentions are not to try and
> stabb at Oracle, but to acquire valuable technical information from folks
(I
> figured) knew more about the product than I currently do.  Over the past
> several months, I've been periodically visiting a few of these Oracle
> newsgroups and it seems that everytime a developer who previously utilized
a
> competing database asks a simple (How To using Oracle) question, they are
> branded as SQL idiots!  As if PL/SQL is the ONLY SQL there is.  As I
recall
> Transact SQL has been around for quite sometime as well and is also very
> successful and well accepted.  I happen to like PL/SQL as I've done some
ADA
> programming back in the day.  We are merely trying to better understand
the
> syntax and the best techniques to use within the Oracle database.  That's
> why at the end of my posting, I asked "Any Suggestions?"  If indeed the
temp
> table method is not the best approach, then suggest something that is or
> don't.  This application is our company's livelihood and we only hurt our
> company by not optimizing performance on all of the major DB platforms in
> the industry which we serve.  Pardon me and all of us non-Oracle
developers
> trying to better understand and embrace Oracle for using newsgroups in the
> manner which they were meant to be used.  I do indeed apologize and I do
> intend to purchase one of the many great Oracle PL/SQL titles out there.
I
> just thought I could reach out to my fellow developers without being
> chastized for not first reading some book.  By providing support for
Oracle
> in our application only helps those smaller independents who have not yet
> standardized or even utilize any SQL database consider using Oracle within
> their organization.  Larry Ellison would be proud.  Up until about 3 years
> ago, there was virtually NO presence of Oracle in the offshore
environment.
> Now that companies like ours and oilfield consultant firms like the last
one
> I worked for suggest Oracle, it is beginning to replace Sybase and SQL
> Server out there.

> With regard to your comment:
> > 2 If you *really* think you can't do without temp tables (and the above
> > example shows you resort to temp tables for simply *everything*)
> > , check out the Oracle manuals on GLOBAL TEMP tables.

> I only cited one example of where the temp table (for those platforms)
> offers the greatest benefit and talked about how we've used them in stored
> procedures (for those platforms).  Don't have a cow!
> I have written more than a thousand stored procedures and triggers and
made
> use of temp tables in perhaps 10% to 12% of them.  I don't know where you
> get these *assumptions*!

> "Sybrand Bakker" <post...@sybrandb.demon.nl> wrote in message
> news:udqdq1p88dk5dd@corp.supernews.com...

> > "KPK" <kpkel...@alltel.net> wrote in message
> > news:abj9vb$lqd$1@iac5.navix.net...
> > > Hello all:

> > > We are building support into our Powerbuilder 7.0 application to allow
> our
> > > customers to utilize their Oracle databases (we are testing against
8i).

> > > Right now our application has support for Microsoft SQL Server 7.0 and
> > 2000
> > > as well as Sybase SQL AnyWhere 5.5 as well as Adaptive Server 7.
Oracle
> > > (later DB/2 as well) support is being added now.

> > > In our application, we make use of temporary tables quite a bit.
> Consider
> > > the following example:

> > > Set SQLCA.AutoCommit = TRUE

> > > Create Table #TempVols(ObjID int, StartOil float, EndOil float)

> > > Insert Into #TempVols(ObjID, StartOil, EndOil)
> > > Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
> > > Sum(EndingOilVol)
> > > From CompletionDaily, TankDaily
> > > Where CompletionDaily.ObjectID = TankDaily.ObjectID and RecordDate =
> > > '02-02-2002'
> > >            and UserID = 400

> > > Update TankCompletionDaily
> > > Set BeginningOil = StartOil,
> > >       EndingOil = EndOil
> > > From #TempVols
> > > Where ObjID = TankCompID and RecordDate = '02-02-2002' //or whatever
> date
> > we
> > > want

> > > Just ignore the "set sqlca.autocommit = true" line because that is
> unique
> > to
> > > Powerbuilder.

> > > I don't want to use a nested SELECT for each column being updated
> because
> > > it's too slow.  The #Temp Table method is much faster as I have
already
> > > tested it.

> > > What's nice about this, is that I can create it in a stored procedure
or
> > > within Powerbuilder using Dynamic SQL and Powerbuilder's Transaction
> > Object.
> > > The stored procedure is a bit faster than doing it in PB, however.

> > > How can I accomplish this same task within 8i using a temp table?  The
> > > reason for the temp table is that both Sybase and SQL Server handle
the
> > temp
> > > table a bit differently from a normal table.

> > > In what ways you ask?

> > > Well first, when the temp table is created, both databases generate a
> > unique
> > > value and append it to the temp table so that if any other users run
> this
> > > code simultaneously, they too will have their own temp table with
> > different
> > > values assigned to their current transaction/connection session
> therefore
> > > eliminating the possibility of table name conflicts.  Once the code
> above
> > is
> > > complete, both databases (after the commit) will delete the temp
table.
> > > Another reason for using a temp table is that we have some stored
> > procedures
> > > that are quite long.  We create the temp table at the beginning of the
> > > stored procedure and populate it with ONLY those records that meet our
> > > selection criteria and the rest of the stored procedure's queries and
> sql
> > > transactions can make use and even join against that temp table.

> > > Any suggestions?

> > 1 Try to learn Oracle, or better still try to learn SQL.
> > Sucessful one on one ports from Sqlserver to Oracle don't exist, because
> > Oracle is not sqlserver sold by a different vendor. If I have to
> investigate
> > performance problems on a database which is used for an application
which
> > has been ported from Sqlserver to Oracle, that is ALWAYS the root cause:
> the
> > developers involved simply didn't know anything about Oracle. Read the
> > initial

...

read more »

 
 
 

Assistance needed with creating tables in oracle.

Post by KPK » Mon, 13 May 2002 22:56:05


And indeed this is the type of response I was looking for.  An educated one.
Yes. These products are different and Yes we want to use the method(s) that
provide the best performance on each.  I am not a temp table advocate for if
there were a better way of doing this rather than using temp tables in
sybase and sql server, then we would have pursued them.  The dev team and I
do plan on doing some experimentation, but we are under a time constraint on
the project for one of our customers and really need to get a compiled beta
version out to them for testing.  Once they are busy testing, they will be
off our backs for a few weeks giving us enough time to further explore what
Oracle best practices are.  We must to the same for DB/2 as well.

Regarding "If you still feel you just gotta have temp

> tables use global temporary tables otherwise performance will suffer
> greatly", I "feel" that we have to use what works best in each respective

environment.  It is the functionality of our application that customers want
and it made sense to us to provide good and fast Oracle support in there as
well.

I just don't feel that the Personal Attacks on my software development
skills were warranted.  We are all developers and/or DBA folks.  Our jobs
are already somewhat thankless.  The last thing we need is to attack one
another (not saying you did).  Bottom line (and apparently Mr. Bakker fails
to understand this) is that we "developers" typically don't get the time to
do things the correct way because upper management unfortunately and often
times make the decisions.

Although they (mostly) have no experience in Software Engineering or
development processes, they look at "time" and "cost".  That's it.  How much
time will it take to get "something" out to the customer and how much will
it cost them before they go out and look for another vendor that can do it
for less.  When things bogg down and bugs begin to surface (usually do to
the lack of adequate testing time), then it's our (developers) fault.  I
just don't need or want the extra headache from folks like Mr. Bakker.

Thank You Jim for your suggestion.

"Jim Kennedy" <kennedy-fam...@attbi.com> wrote in message

news:OTmD8.19791$Po6.8045@rwcrnsc52.ops.asp.att.net...
> Unlike Sqlserver and Sybase you don't need (or very very rarely) need temp
> tables in Oracle.  Yes, in Sybase and Sqlserver you need them and I am
sure
> you are correct that using them in those environments gives you the
fastest
> performance in those environments - no arguement.  In Oracle however, you
> don't have to go through all those gyrations. (Good approuch possibly for
> SQLServer and Sybase - not a good approuch in Oracle. I am not saying you
> are stupid; I am saying things work differently.)  You can use SQL (not
> pl/sql or transact, just sql).  If you still feel you just gotta have temp
> tables use global temporary tables otherwise performance will suffer
> greatly.  In Oracle readers don't block writers and writers don't block
> readers.  It will save you a lot of pain and anguish to try some simple
> experiements in Oracle and see that the differences are great and use
those
> differences to your advantage.  Again, this has nothing to do with your
> intelligence; it is just the products are different and assumptions in one
> are not valid in the other.

> Tom Kyte's book is excellent and well worth the money.  His site is at:
> http://asktom.oracle.com/pls/ask/f?p=4950:1:

> Some useful links:

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:48812348054,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:1423204060137,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:1164655862293,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:734225532321,%7Bsybase%7D%20and%20%7Btemp%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:1886476148373,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:1502605216980,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:1136552219291,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...
> 4950_P8_CRITERIA:61012348055,%7Bsybase%7D%20and%20%7Boracle%7D

http://asktom.oracle.com/pls/ask/f?p=4950:8:802762::NO::F4950_P8_DISP...

- Show quoted text -

> 4950_P8_CRITERIA:1390203651798,%7Bsybase%7D%20and%20%7Boracle%7D

> That should help.

> Jim

> "KPK" <kpkel...@alltel.net> wrote in message
> news:abkjht$e0b$1@iac5.navix.net...
> > Thanks for the reply.

> > I'll have you know that I've been writing SQL now since the WatCOM SQL
> days
> > (late 80s-early 90s).  I've been writing software since 1981 and started
> out
> > with DBase and moved into Sybase on Unix and then SQL Server and Sybase
on
> > Windows.  I've written scalable sybase and sql server-based applications
> > that are being used by 3 of the top 10 independent Oil and Gas producers
> in
> > the United States.  I have also designed and written SQL Server and
Sybase
> > applications used in plant Safety Systems that are now responsible for
> > saving the lives of many oilfield and hydrocarbon plant workers in the
> Gulf
> > of Mexico region.  These apps are not only scalable, but are very fast
(at
> > the database level) in those areas where timing is critical for setting
> > Alarm conditions.  Our intentions for this application is not to merely
> > *TACK ON* support for Oracle, but investigate those areas where Oracle
and
> > (later DB/2) provide the best performance.  It just so happens that our
> > tests have shown that both Sybase and SQL Server perform well utilizing
> the
> > *temp table* technique I illustrated.  My intentions are not to try and
> > stabb at Oracle, but to acquire valuable technical information from
folks
> (I
> > figured) knew more about the product than I currently do.  Over the past
> > several months, I've been periodically visiting a few of these Oracle
> > newsgroups and it seems that everytime a developer who previously
utilized
> a
> > competing database asks a simple (How To using Oracle) question, they
are
> > branded as SQL idiots!  As if PL/SQL is the ONLY SQL there is.  As I
> recall
> > Transact SQL has been around for quite sometime as well and is also very
> > successful and well accepted.  I happen to like PL/SQL as I've done some
> ADA
> > programming back in the day.  We are merely trying to better understand
> the
> > syntax and the best techniques to use within the Oracle database.
That's
> > why at the end of my posting, I asked "Any Suggestions?"  If indeed the
> temp
> > table method is not the best approach, then suggest something that is or
> > don't.  This application is our company's livelihood and we only hurt
our
> > company by not optimizing performance on all of the major DB platforms
in
> > the industry which we serve.  Pardon me and all of us non-Oracle
> developers
> > trying to better understand and embrace Oracle for using newsgroups in
the
> > manner which they were meant to be used.  I do indeed apologize and I do
> > intend to purchase one of the many great Oracle PL/SQL titles out there.
> I
> > just thought I could reach out to my fellow developers without being
> > chastized for not first reading some book.  By providing support for
> Oracle
> > in our application only helps those smaller independents who have not
yet
> > standardized or even utilize any SQL database consider using Oracle
within
> > their organization.  Larry Ellison would be proud.  Up until about 3
years
> > ago, there was virtually NO presence of Oracle in the offshore
> environment.
> > Now that companies like ours and oilfield consultant firms like the last
> one
> > I worked for suggest Oracle, it is beginning to replace Sybase and SQL
> > Server out there.

> > With regard to your comment:
> > > 2 If you *really* think you can't do without temp tables (and the
above
> > > example shows you resort to temp tables for simply *everything*)
> > > , check out the Oracle manuals on GLOBAL TEMP tables.

> > I only cited one example of where the temp table (for those platforms)
> > offers the greatest benefit and talked about how we've used them in
stored
> > procedures (for those platforms).  Don't have a cow!
> > I have written more than a thousand stored procedures and triggers and
> made
> > use of temp tables in perhaps 10% to 12% of them.  I don't know where
you
> > get these *assumptions*!

> > "Sybrand Bakker" <post...@sybrandb.demon.nl> wrote in message
> > news:udqdq1p88dk5dd@corp.supernews.com...

> > > "KPK" <kpkel...@alltel.net> wrote in message
> > > news:abj9vb$lqd$1@iac5.navix.net...
> > > > Hello all:

> > > > We are building support into our Powerbuilder 7.0 application to
allow
> > our
> > > > customers to utilize their Oracle databases (we are testing against
> 8i).

> > > > Right now our application has support for Microsoft SQL Server 7.0
and
> > > 2000
> > > > as well as Sybase SQL AnyWhere 5.5 as well as Adaptive Server 7.
> Oracle
> > > > (later DB/2 as well) support is being added now.

> > > > In our application, we make use of temporary tables quite a bit.
> > Consider
> > > > the following example:

> > > > Set SQLCA.AutoCommit = TRUE

> > > > Create Table #TempVols(ObjID int, StartOil float, EndOil float)

> > > > Insert Into #TempVols(ObjID, StartOil, EndOil)
> > > > Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
> > > > Sum(EndingOilVol)
> > > > From CompletionDaily, TankDaily
> > > > Where

...

read more »

 
 
 

Assistance needed with creating tables in oracle.

Post by Sybrand Bakke » Mon, 13 May 2002 21:58:49



> Bottom line (and apparently Mr. Bakker fails
>to understand this) is that we "developers" typically don't get the time to
>do things the correct way because upper management unfortunately and often
>times make the decisions.

>Although they (mostly) have no experience in Software Engineering or
>development processes, they look at "time" and "cost".  That's it.  How much
>time will it take to get "something" out to the customer and how much will
>it cost them before they go out and look for another vendor that can do it
>for less.  When things bogg down and bugs begin to surface (usually do to
>the lack of adequate testing time), then it's our (developers) fault.  I
>just don't need or want the extra headache from folks like Mr. Bakker.

Unfortunately Mr. Bakker belongs to the folks that have to clean out
the mess and are
*always blamed by developers*
 for bad database performance, while it is perfectly clear developer's
crappy code is causing the problem. Happens in 99.9 percent of all the
sqlserver - oracle migration projects, as most sqlserver developers
think Oracle is sqlserver sold by a different vendor.

Regards

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

 
 
 

Assistance needed with creating tables in oracle.

Post by Jim Kenned » Mon, 13 May 2002 22:46:42


Yes, but I think the additional point is that management (as KPK points out)
is:

 "Although they (mostly) have no experience in Software Engineering or
development processes, they look at "time" and "cost".  That's it.  How much
time will it take to get "something" out to the customer and how much will
it cost them before they go out and look for another vendor that can do it
for less"

(the they is upper management)  Clearly they aren't focused on quality -
again the they is upper management.  Since they don't have experience with
software development this causes a problem; likely lower down the food chain
management thinks that a database is a database - like a car is a car.
Hence Sybrand is correct and why you felt you may have gotten some shouting
as to "don't do it that way".  Lots of people are tired of having to clean
up habits due to differences in database architecture's and being victims of
a management that usually is technically incompetent and unappreciative of
nuances - well maybe nuance is too subtle - of tools.

Jim



> > Bottom line (and apparently Mr. Bakker fails
> >to understand this) is that we "developers" typically don't get the time
to
> >do things the correct way because upper management unfortunately and
often
> >times make the decisions.

> >Although they (mostly) have no experience in Software Engineering or
> >development processes, they look at "time" and "cost".  That's it.  How
much
> >time will it take to get "something" out to the customer and how much
will
> >it cost them before they go out and look for another vendor that can do
it
> >for less.  When things bogg down and bugs begin to surface (usually do to
> >the lack of adequate testing time), then it's our (developers) fault.  I
> >just don't need or want the extra headache from folks like Mr. Bakker.

> Unfortunately Mr. Bakker belongs to the folks that have to clean out
> the mess and are
> *always blamed by developers*
>  for bad database performance, while it is perfectly clear developer's
> crappy code is causing the problem. Happens in 99.9 percent of all the
> sqlserver - oracle migration projects, as most sqlserver developers
> think Oracle is sqlserver sold by a different vendor.

> Regards

> Sybrand Bakker, Senior Oracle DBA

> To reply remove -verwijderdit from my e-mail address

 
 
 

Assistance needed with creating tables in oracle.

Post by John Russel » Tue, 14 May 2002 03:17:06



>> > In our application, we make use of temporary tables quite a bit.
>> > How can I accomplish this same task within 8i using a temp table?

I usually declare a temporary table to match the structure of an
existing table by doing:

create global temporary table temp_rows as select * from docset where
1 = 0;

(i.e. don't put any data into the temp table).

The rest that you described sounds like the behaviour of Oracle
temporary tables.  There is a clause ON COMMIT DELETE ROWS you might
need to add depending on how long your sessions last.  (I have very
brief sessions to handle web requests, so I let the system clear out
the table when the session ends.)

John
--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/

The opinions expressed above are mine and do not
necessarily reflect those of Oracle Corporation.

 
 
 

Assistance needed with creating tables in oracle.

Post by KPK » Tue, 14 May 2002 12:21:11


Well then put me in that .1%.  I worked as a Sybase DBA for 4 years prior to
moving into application development.  I fully understand how it works on
BOTH sides (DBA and developer) and neither of our jobs receive the proper
respect and thanks they should.  I do agree that there are developers out
there who should not be allowed to touch a keyboard as well.  Unfortunately,
many colleges are now teaching students how to properly model their
applications and leve the database as an afterthought.  I was taught to
concentrate on good database design based on business requirements and then
model the application accordingly.  What I've found over the years is that
the heads of IT usually bring the DBA in on meetings with consultants early
on to get their thoughts on the consultant's design suggestions, but rarely
do they permit the DBA to work closely with the developer to ensure that the
application performs well on the database side and reduces the headaches the
DBA often has to clean up the mess.  Talk about thankless jobs.  I believe
the CDW commercials sum it up best when they ask  "What other impossible
task can we assign to IT?".  For the record, I have NEVER once blamed a DBA
for an application*up.  I always put the blame squarely where it
belongs.  On Management who made the*up decisions in the first place
to reduce cost by reducing design and testing time on the project.  It has
never failed in the last 10+ years I've been involved with Enterprise
Application Integration projects.  Everytime cost becomes the ONLY issue,
the design suffers and bugs abound!!!  Then the customer comes out screaming
at the consulting firm's IDIOT manager who made the messed up decision in
the first place.  He then turns around and expects the developer to "patch"
the problem instead of allow them to do it correctly.

Patches are another BIG problem as well because they simply DON'T WORK!
They introduce MORE BUGS and the problem gets worse and worse and that's
when the DBA is looked upon as the scape goat by IT Management.

Sybrand, I must apologize to you in part because thinking back to my Sybase
DBA days, I do remember how hard it is on you guys.  I don't apologize,
however for the remainder of my initial reply.  We are the last two groups
of people who should be hammering one another.  BTW.  This is NOT a SQL
Server to Oracle migration.  We are adding support for Oracle in addition to
our current support for Sybase and SQL Server and YES, we have not been
allocated enough time to adequately (in my opinion) test what we've done so
far. Unfortunately, "Doing it Right the First Time" is just not enough to
justify the additional resources and cost.  Come to think of it!  It never
has been!

Management Thoughts:  "Write it now.  Fix it later."
Developers Thoughts: "Design it Now, Test It and then Deploy to get
feedback."



> > Bottom line (and apparently Mr. Bakker fails
> >to understand this) is that we "developers" typically don't get the time
to
> >do things the correct way because upper management unfortunately and
often
> >times make the decisions.

> >Although they (mostly) have no experience in Software Engineering or
> >development processes, they look at "time" and "cost".  That's it.  How
much
> >time will it take to get "something" out to the customer and how much
will
> >it cost them before they go out and look for another vendor that can do
it
> >for less.  When things bogg down and bugs begin to surface (usually do to
> >the lack of adequate testing time), then it's our (developers) fault.  I
> >just don't need or want the extra headache from folks like Mr. Bakker.

> Unfortunately Mr. Bakker belongs to the folks that have to clean out
> the mess and are
> *always blamed by developers*
>  for bad database performance, while it is perfectly clear developer's
> crappy code is causing the problem. Happens in 99.9 percent of all the
> sqlserver - oracle migration projects, as most sqlserver developers
> think Oracle is sqlserver sold by a different vendor.

> Regards

> Sybrand Bakker, Senior Oracle DBA

> To reply remove -verwijderdit from my e-mail address

 
 
 

Assistance needed with creating tables in oracle.

Post by Daniel A. Morga » Tue, 14 May 2002 02:33:22



> Well then put me in that .1%.  I worked as a Sybase DBA for 4 years prior to
> moving into application development.  I fully understand how it works on
> BOTH sides (DBA and developer) and neither of our jobs receive the proper
> respect and thanks they should.  I do agree that there are developers out
> there who should not be allowed to touch a keyboard as well.  Unfortunately,
> many colleges are now teaching students how to properly model their
> applications and leve the database as an afterthought.  I was taught to
> concentrate on good database design based on business requirements and then
> model the application accordingly.  What I've found over the years is that
> the heads of IT usually bring the DBA in on meetings with consultants early
> on to get their thoughts on the consultant's design suggestions, but rarely
> do they permit the DBA to work closely with the developer to ensure that the
> application performs well on the database side and reduces the headaches the
> DBA often has to clean up the mess.  Talk about thankless jobs.  I believe
> the CDW commercials sum it up best when they ask  "What other impossible
> task can we assign to IT?".  For the record, I have NEVER once blamed a DBA
> for an application*up.  I always put the blame squarely where it
> belongs.  On Management who made the*up decisions in the first place
> to reduce cost by reducing design and testing time on the project.  It has
> never failed in the last 10+ years I've been involved with Enterprise
> Application Integration projects.  Everytime cost becomes the ONLY issue,
> the design suffers and bugs abound!!!  Then the customer comes out screaming
> at the consulting firm's IDIOT manager who made the messed up decision in
> the first place.  He then turns around and expects the developer to "patch"
> the problem instead of allow them to do it correctly.

> Patches are another BIG problem as well because they simply DON'T WORK!
> They introduce MORE BUGS and the problem gets worse and worse and that's
> when the DBA is looked upon as the scape goat by IT Management.

> Sybrand, I must apologize to you in part because thinking back to my Sybase
> DBA days, I do remember how hard it is on you guys.  I don't apologize,
> however for the remainder of my initial reply.  We are the last two groups
> of people who should be hammering one another.  BTW.  This is NOT a SQL
> Server to Oracle migration.  We are adding support for Oracle in addition to
> our current support for Sybase and SQL Server and YES, we have not been
> allocated enough time to adequately (in my opinion) test what we've done so
> far. Unfortunately, "Doing it Right the First Time" is just not enough to
> justify the additional resources and cost.  Come to think of it!  It never
> has been!

> Management Thoughts:  "Write it now.  Fix it later."
> Developers Thoughts: "Design it Now, Test It and then Deploy to get
> feedback."




> > > Bottom line (and apparently Mr. Bakker fails
> > >to understand this) is that we "developers" typically don't get the time
> to
> > >do things the correct way because upper management unfortunately and
> often
> > >times make the decisions.

> > >Although they (mostly) have no experience in Software Engineering or
> > >development processes, they look at "time" and "cost".  That's it.  How
> much
> > >time will it take to get "something" out to the customer and how much
> will
> > >it cost them before they go out and look for another vendor that can do
> it
> > >for less.  When things bogg down and bugs begin to surface (usually do to
> > >the lack of adequate testing time), then it's our (developers) fault.  I
> > >just don't need or want the extra headache from folks like Mr. Bakker.

> > Unfortunately Mr. Bakker belongs to the folks that have to clean out
> > the mess and are
> > *always blamed by developers*
> >  for bad database performance, while it is perfectly clear developer's
> > crappy code is causing the problem. Happens in 99.9 percent of all the
> > sqlserver - oracle migration projects, as most sqlserver developers
> > think Oracle is sqlserver sold by a different vendor.

> > Regards

> > Sybrand Bakker, Senior Oracle DBA

> > To reply remove -verwijderdit from my e-mail address

Perhaps you will all be pleased to know that the University of Washington,
Winter Quarter 2003, has agreed to a course for mid-level managers, on how to
manage technology projects.

I plan to pull no punches.

So if you, or anyone else here on the board, have examples you think might be
instructive on how managers who don't understand technology can set up a project
for failure I would be interested in receiving them.

Thanks in advance.

Daniel Morgan

 
 
 

Assistance needed with creating tables in oracle.

Post by Pablo Sanche » Tue, 14 May 2002 12:18:29




Quote:

> So if you, or anyone else here on the board, have examples you think
might be
> instructive on how managers who don't understand technology can set
up a project
> for failure I would be interested in receiving them.

The Mythical Man Month
Anti-Patterns - this might be tough for people to read though
--
Pablo Sanchez, High-Performance Database Engineering

http://www.hpdbe.com
Available for short-term and long-term contracts
 
 
 

Assistance needed with creating tables in oracle.

Post by Jim Kenned » Tue, 14 May 2002 12:28:55


Daniel,
Halleluiah! Fantastic.

Concentrating on the next BSO (bright shiny object) technology as the savior
for all the current problems. (unless it is Oracle of course... :-)  )  I
worked for an actuarial consulting firm at one point and we were going gang
busters developing pension administration systems (defined benefit plans -
a bit more complex than 401K plans, due to a host of government
regulations - PBGC, DOL, IRS, etc.) for companies. (eg BASF, NMB, Johnson
Controls, Dow Corning, etc.)  We had invented a toolset to do the GUI and
application development - similar to Smalltalk with a C++ flavor - and it
connected to something like 9 commercial RDBMSs.  Toolset was developed in
house and very powerful. When the toolset was developed - on MS Windows
3.0 - and delivered Pension systems, VB was not a commercial product.  (yes,
that long ago)  At some point of course, due to political BS, the answer
became If we just changed toolsets "we could do all of this for under
$25,000 per system for spec and development costs."  The white Knight
phenom. became rampant.  No one in management would listen to why the
systems were costly to produce - they knew the answer - change toolsets
because MS told them that would solve all their problems.  The real reason
is that it took a lot of experience to develop these things.  The domain
knowledge was much different than most programmers had (not many had
actuarial experience) and the things were very difficult to define.  In
addition, there was the inevitable scope creep in a project, but no one
wanted to charge the client more for scope creep - that would jeopardize the
actuarial consulting side!  So these projects became complex systems that
were sold for very little in order to retain the pension consulting
business.  Not bad as long as you agreed that was the purpose and as a
company you were willing to do that. (One system cost the client $85K and
cost $ 2,000,000 development and the client had a budget cut and decided to
throw the system away.)  So I would say reading Brooks's "No Silver Bullet"
would be a good one.
http://www-inst.eecs.berkeley.edu/~maratb/readings/NoSilverBullet.html  Also
one can chase the never ending BSO.

Also claims of "no programming needed" or all visual or not necessarily
good.  To accomplish some sort of task there must be inputs of some sort
some where.  The information must be specified or assumed in some manner.
If it looks like magic - the end user doesn't have to do much for this
complex system to work - then either the vendor is a liar or they are
talking about some other task.(or making huge assumptions about the
information or inputs)  The information has to come from somewhere it does
not just magically appear.  Granted good systems try NOT to ask the same
questions again and again needlessly, but complex programs that install and
magically run with no configuration I am leery of.  Same goes for "visual
programming" no programming knowledge needed.  Gee, pass the bong on that
one.  Sure it can be "visual" with cure blocks etc, but as it gets more
complex it is programming and it may be a nightmare if it is only visual.

Just some thoughts.  Probably things you already thought of.
Jim



<snip for space only>

Quote:> Perhaps you will all be pleased to know that the University of Washington,
> Winter Quarter 2003, has agreed to a course for mid-level managers, on how
to
> manage technology projects.

> I plan to pull no punches.

> So if you, or anyone else here on the board, have examples you think might
be
> instructive on how managers who don't understand technology can set up a
project
> for failure I would be interested in receiving them.

> Thanks in advance.

> Daniel Morgan

 
 
 

Assistance needed with creating tables in oracle.

Post by Galen Boye » Tue, 14 May 2002 12:09:08



> In our application, we make use of temporary tables quite a bit.
> Consider the following example:

> Set SQLCA.AutoCommit = TRUE

> Create Table #TempVols(ObjID int, StartOil float, EndOil float)

> Insert Into #TempVols(ObjID, StartOil, EndOil)

I thought you could just run the second statement?  I think there is a
way to get a #tmp where you don't have to issue a create table statement
and I thought it was the second statement alone.  (Been awhile since I
worked with #Tmps though)

Quote:> Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
> Sum(EndingOilVol) From CompletionDaily, TankDaily Where
> CompletionDaily.ObjectID = TankDaily.ObjectID and RecordDate =
> '02-02-2002' and UserID = 400

> Update TankCompletionDaily Set BeginningOil = StartOil, EndingOil =
> EndOil From #TempVols Where ObjID = TankCompID and RecordDate =
> '02-02-2002' //or whatever date we want

> Just ignore the "set sqlca.autocommit = true" line because that is
> unique to Powerbuilder.

> I don't want to use a nested SELECT for each column being updated
> because it's too slow.  The #Temp Table method is much faster as I
> have already tested it.

If you need the temp table (or if you would rather not change your logic
per vendor)  investigate global temporary tables.  You don't create them
on the fly.  Oracle maintains the data per session, equivalent to the
unique id for the #tmp table.

[...]

Quote:> Well first, when the temp table is created, both databases generate a
> unique value and append it to the temp table so that if any other
> users run this code simultaneously, they too will have their own temp
> table with different values assigned to their current
> transaction/connection session therefore eliminating the possibility
> of table name conflicts.  Once the code above is complete, both
> databases (after the commit) will delete the temp table.  Another
> reason for using a temp table is that we have some stored procedures
> that are quite long.  We create the temp table at the beginning of the
> stored procedure and populate it with ONLY those records that meet our
> selection criteria and the rest of the stored procedure's queries and
> sql transactions can make use and even join against that temp table.

The global temp table would satisfy your criteria, and probably a bit
faster than the #tmp, cause there is no ddl involved.  Create the table
with all the other tables real tables.

--
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

 
 
 

1. Need some assistance creating a table in an 8i database

Hello all:

We are building support into our Powerbuilder 7.0 application to allow our
customers to utilize their Oracle databases (we are testing against 8i).

Right now our application has support for Microsoft SQL Server 7.0 and 2000
as well as Sybase SQL AnyWhere 5.5 as well as Adaptive Server 7.  Oracle
(later DB/2 as well) support is being added now.

In our application, we make use of temporary tables quite a bit.  Consider
the following example:

Set SQLCA.AutoCommit = TRUE

Create Table #TempVols(ObjID int, StartOil float, EndOil float)

Insert Into #TempVols(ObjID, StartOil, EndOil)
Select Distinct CompletionDaily.ObjectID, Sum(StartOilVol),
Sum(EndingOilVol)
From CompletionDaily, TankDaily
Where CompletionDaily.ObjectID = TankDaily.ObjectID and RecordDate =
'02-02-2002'
           and UserID = 400

Update TankCompletionDaily
Set BeginningOil = StartOil,
      EndingOil = EndOil
From #TempVols
Where ObjID = TankCompID and RecordDate = '02-02-2002' //or whatever date we
want

Just ignore the "set sqlca.autocommit = true" line because that is unique to
Powerbuilder.

I don't want to use a nested SELECT for each column being updated because
it's too slow.  The #Temp Table method is much faster as I have already
tested it.

What's nice about this, is that I can create it in a stored procedure or
within Powerbuilder using Dynamic SQL and Powerbuilder's Transaction Object.
The stored procedure is a bit faster than doing it in PB, however.

How can I accomplish this same task within 8i using a temp table?  The
reason for the temp table is that both Sybase and SQL Server handle the temp
table a bit differently from a normal table.

In what ways you ask?

Well first, when the temp table is created, both databases generate a unique
value and append it to the temp table so that if any other users run this
code simultaneously, they too will have their own temp table with different
values assigned to their current transaction/connection session therefore
eliminating the possibility of table name conflicts.  Once the code above is
complete, both databases (after the commit) will delete the temp table.
Another reason for using a temp table is that we have some stored procedures
that are quite long.  We create the temp table at the beginning of the
stored procedure and populate it with ONLY those records that meet our
selection criteria and the rest of the stored procedure's queries and sql
transactions can make use and even join against that temp table.

Any suggestions?

2. Datagrid -- mutiple selection

3. Need Assistance: Clustering and constraints in a table

4. Trust and Register ok...can't see me!!

5. Urgently need assistance, Corrupt table!

6. DTS import can't transfer column default values?

7. Need Assistance: Clustering and Constraints in a table

8. Multi CD-ROM database

9. Need Assistance: Constraints in a table specific

10. Need Assistance: Constraints in a table

11. Need Assistance: Clustering and Constraints in a table

12. REPOST - Assistance needed with clearing out Child tables

13. Packing Tables - Need a little assistance