473,657 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running a query manually when using web modules

Hi. I'm implementing a web deployment using 9i. I have a table for STOCK,
which has one or more PURCHASES, which have one or more PURCHASE_ITEMS.

When a purchase item is INSERTED, I'd like the web module component to
update the relevant grandparent record of STOCK, and when UPDATED, to
remember the previous level and adjust accordingly.

I'm sure that this can probably be done in PL/SQL, but don't have a clue
how - all books and tutorials I have found take a 'PHP-style' approach or
use servlets and don't seem to use web modules.

I am mostly familiar with Design Editor. Can anyone help? Thanks.
Jul 19 '05 #1
3 2490
"none" <no**@none.co m> wrote in message news:<f4******* *************** ********@news.t eranews.com>...
Hi. I'm implementing a web deployment using 9i. I have a table for STOCK,
which has one or more PURCHASES, which have one or more PURCHASE_ITEMS.

When a purchase item is INSERTED, I'd like the web module component to
update the relevant grandparent record of STOCK, and when UPDATED, to
remember the previous level and adjust accordingly.

I'm sure that this can probably be done in PL/SQL, but don't have a clue
how - all books and tutorials I have found take a 'PHP-style' approach or
use servlets and don't seem to use web modules.

I am mostly familiar with Design Editor. Can anyone help? Thanks.


What do you mean by web modules, is this a tool or product?

You can certainly create PL/SQL code in your database to execute your
logic. And I assume you can call a PL/SQL procedure from PHP. I know
you can do it from a servlet using a JDBC connection. So I'm not sure
what your issue is, unless you do not understand PL/SQL. Perhaps you
could provide more detail.

Dave
Jul 19 '05 #2
We are using Design Editor in 9i to create modules. We then generate the
modules as 'web modules'. Editor generates all the server code to carry out
simple transactions like insert, update etc.

Someone else's page on web modules is
http://www.iherve.com/oracle/wg_title.htm

What I think we need is a way to get a web module to take fields in the
insert/update of a purchased item (which would be something like '50 watches
of make W123'), run a query to get current stock for W123, and then update
the current stock by adding purchased stock to current stock. We're not
using PHP or servlets, but the Oracle web server. The entire thing is
created from within Oracle itself. I do not understand PL/SQL, although I
have had a look at some tutorials they do not mention anything about
integrating a transaction into a module created by Oracle.

"Dave" <da**********@y ahoo.com> wrote in message
news:5e******** *************** ***@posting.goo gle.com...
"none" <no**@none.co m> wrote in message

news:<f4******* *************** ********@news.t eranews.com>...
Hi. I'm implementing a web deployment using 9i. I have a table for STOCK, which has one or more PURCHASES, which have one or more PURCHASE_ITEMS.

When a purchase item is INSERTED, I'd like the web module component to
update the relevant grandparent record of STOCK, and when UPDATED, to
remember the previous level and adjust accordingly.

I'm sure that this can probably be done in PL/SQL, but don't have a clue
how - all books and tutorials I have found take a 'PHP-style' approach or use servlets and don't seem to use web modules.

I am mostly familiar with Design Editor. Can anyone help? Thanks.


What do you mean by web modules, is this a tool or product?

You can certainly create PL/SQL code in your database to execute your
logic. And I assume you can call a PL/SQL procedure from PHP. I know
you can do it from a servlet using a JDBC connection. So I'm not sure
what your issue is, unless you do not understand PL/SQL. Perhaps you
could provide more detail.

Dave

Jul 19 '05 #3
"none" <no**@none.co m> wrote in message news:<ba******* *************** ********@news.t eranews.com>...

Ah ok. I learned something today. Never heard of design editor before.
:)

I don't know what you table names and columns are, so I made some
assumptions...

Looks to me like you have two options.

1.) PL/SQL procedure, which you will have to figure out how to call
from your web module...which would look something like this....

create or replace procedure UpdateStock(p_p roduct_number number, p_qty
number)
is
begin
UPDATE STOCK SET STOCK_LEVEL = STOCK_LEVEL + p_qty
WHERE PRODUCT_NUMBER = p_product_numbe r;
commit;
end;
/

2.) Create a trigger on the purchase items table which will be
completely transparent to your application code. Whenever you insert
into the table, it will update the stock levels within the same
Transaction context. This may be easier for you to implement, but it
may depend if you as a developer are allowed to touch the database
schema. The :NEW is special syntax in the trigger representing the new
column values being inserted into the PURCHASE_ITEM table.

create trigger UpdateStock
AFTER INSERT
on PURCHASE_ITEM
for each row
begin
UPDATE STOCK SET STOCK_LEVEL = STOCK_LEVEL + :NEW.PURCHASE_Q TY
WHERE PRODUCT_NUMBER = :NEW.PURCHASED_ PRODUCT_NUMBER;
end;
/

Also, for a great new Oracle web development tool/environment. Check
out Oracle HTML DB. It is very cool. But knowing PL/SQL is probably
important for creating very custom solutions.

Dave
We are using Design Editor in 9i to create modules. We then generate the
modules as 'web modules'. Editor generates all the server code to carry out
simple transactions like insert, update etc.

Someone else's page on web modules is
http://www.iherve.com/oracle/wg_title.htm

What I think we need is a way to get a web module to take fields in the
insert/update of a purchased item (which would be something like '50 watches
of make W123'), run a query to get current stock for W123, and then update
the current stock by adding purchased stock to current stock. We're not
using PHP or servlets, but the Oracle web server. The entire thing is
created from within Oracle itself. I do not understand PL/SQL, although I
have had a look at some tutorials they do not mention anything about
integrating a transaction into a module created by Oracle.

"Dave" <da**********@y ahoo.com> wrote in message
news:5e******** *************** ***@posting.goo gle.com...
"none" <no**@none.co m> wrote in message

news:<f4******* *************** ********@news.t eranews.com>...
Hi. I'm implementing a web deployment using 9i. I have a table for STOCK, which has one or more PURCHASES, which have one or more PURCHASE_ITEMS.

When a purchase item is INSERTED, I'd like the web module component to
update the relevant grandparent record of STOCK, and when UPDATED, to
remember the previous level and adjust accordingly.

I'm sure that this can probably be done in PL/SQL, but don't have a clue
how - all books and tutorials I have found take a 'PHP-style' approach or use servlets and don't seem to use web modules.

I am mostly familiar with Design Editor. Can anyone help? Thanks.


What do you mean by web modules, is this a tool or product?

You can certainly create PL/SQL code in your database to execute your
logic. And I assume you can call a PL/SQL procedure from PHP. I know
you can do it from a servlet using a JDBC connection. So I'm not sure
what your issue is, unless you do not understand PL/SQL. Perhaps you
could provide more detail.

Dave

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2075
by: Grant D. Watson | last post by:
If this has been answered before, or if my terminology is off, please bear with me; my Python experience is limited to use in one class and to personal projects. I'd like to do something rather silly: I'd like to run a particular piece of code from a given module every time that the module is imported, and not just at the time that the module is originally loaded. So, every time a module says import foo or something analogous, I want...
29
5798
by: pb648174 | last post by:
I have a very long transaction that runs on the same database that other users need to use for existing data. I don't care if they see data from the transaction before it is done and am only using the transaction because I need a way to roll it back if any errors happen during the transaction. Unfortunately all tables affected in the long running transaction are completely locked and nobody else can access any of the affected tables while...
6
4839
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID SalesManName AT Alan Time
7
3530
by: Bernard Lebel | last post by:
Hello, I'm stumbled at a serious problem, and quite frankly getting desparate. This is a rather long-winded one so I'll try to get straight to the point. I have this Python program, that performs MySQL queries to a database. These queries are performed at regular intervals. Basically it is looking for fields that match certain criterias. Such fields are not present at all time. When the program finds such field, it then takes
7
1723
by: funfair | last post by:
hi,every one im facing a problem in running access it's about 25 tables 80 forms 46 query (5 append query ,1 update query ,2 delete query ) 60 reports 4 modules after 7 months of perfect working in access 2003 around 8users working in it .i was working with these users in my sharing folder which i know that may corrupt the whole application but from one week i transfer it
7
15661
by: 2b|!2b==? | last post by:
I am attempting to manually load debug symbols for a module. I am doing it by carrying out the ff steps: i). Select the call stack window ii). right click and select 'Load Symbols' from displayed menu iii). The Find Symbols: MyModule.pdb dialog box is displayed However, when I navigate to and select the correct pdb file (myModule.pdb), an error message is displayed with the message:
3
3591
by: Richard Hollenbeck | last post by:
I hope this isn't too confusing. The following query runs pretty fast by itself, but when I want to use it in a report (pasted below the query), it takes at least fifteen seconds to run! Then I want to analyze the query in Excel and I have to do some manual tweaking. I'd like to run this same query as a summary for the whole class without having to manually do it in Excel, rather in an Access report, but that gets even more complicated....
1
2614
osward
by: osward | last post by:
Hi everyone, Background 1. I have a table that consits 400+ rows of data and is growing by day. The table already has paging links at the bottom but I restricted to display rows of data only >= current date. Otherwise, user have to waste time to page up the pages to find the current date 2. I got a script of simple calendar from the web that use mktime() to create links on the calendar Task I need to let user view data earlier than...
3
174
by: none | last post by:
Hi. I'm implementing a web deployment using 9i. I have a table for STOCK, which has one or more PURCHASES, which have one or more PURCHASE_ITEMS. When a purchase item is INSERTED, I'd like the web module component to update the relevant grandparent record of STOCK, and when UPDATED, to remember the previous level and adjust accordingly. I'm sure that this can probably be done in PL/SQL, but don't have a clue how - all books and...
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.