Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old October 27th, 2003, 08:18 PM
roarman roarman is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Florida
Posts: 2 roarman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to roarman
Creating an Apache Form

I'm tring to create a form (Apache) that extracts data from a customer table, puts it into the form and then updates any changes back to the table. Here is the code I have already. Am I even on track?

create or replace procedure account_update as

C_customer_id customer.customer_id%type;
C_last_name customer.last_name%type;
C_first_name customer.first_name%type;
C_address customer.address%type;
C_city customer.city%type;
C_state customer.state%type;
C_zipcode customer.zipcode%type;
C_email customer.email%type;
C_password customer.password%type;
C_username customer.username%type;

begin

select C.*
into C_customer_id,
C_last_name,
C_first_name,
C_address,
C_city,
C_state,
C_zipcode,
C_email,
C_password,
C_username
from customer C
where C.username = 'rorymcfarr';

htp.htmlOpen;
htp.headOpen;
htp.title('Account Update');
htp.headClose;
htp.bodyOpen;
htp.formOpen('account_customer', 'post');
htp.print('Account Number');
htp.formText (C_customer_id);
htp.br;
htp.print('First Name');
htp.formText(C_first_name);
htp.br;
htp.print('Last Name');
htp.formText(cname => 'C_last_name');
htp.br;
htp.print('Address');
htp.formText(cname => 'C_address', csize => '40');
htp.br;
htp.print('City');
htp.formText(cname => 'C_city');
htp.br;
htp.print('State');
htp.formText(cname => 'C_state');
htp.br;
htp.print('Zipcode');
htp.formText(cname => 'C_zipcode');
htp.br;
htp.print('Email');
htp.formText(cname => 'C_email');
htp.br;
htp.print('Password');
htp.formPassword(cname => 'C_password');
htp.br;
htp.print('User Name');
htp.formText(cname => 'C_username');
htp.br;
htp.formSubmit(NULL, 'Submit');
htp.formReset('Reset', NULL);
htp.formClose;
htp.bodyClose;
htp.htmlClose;
end account_update;


create or replace procedure account_customer(customer_id in number,
first_name in varchar2,
last_name in varchar2,
address in varchar2,
city in varchar2,
state in varchar2,
zipcode in number,
myemail in varchar2,
password in varchar2,
username in varchar2) as

cust_id customer.customer_id%type;

begin

insert into customer
values
(customer_id,
last_name,
first_name,
address,
city,
state,
zipcode,
myemail,
password,
username);
commit;

--if no customer matches, no_data_found is raised
select customer_id into cust_id from customer where email = myemail;

--adds session cookie to users header
owa_util.mime_header('text/html', FALSE);
owa_cookie.send('session', cust_id, sysdate + 1);
owa_util.http_header_close;

htp.htmlOpen;
htp.headOpen;
htp.title('Account Update');
htp.headClose;

htp.bodyOpen;

htp.print('Account Updated Complete');
htp.anchor('videolist', 'View our selection.');

htp.bodyClose;
htp.htmlClose;

exception
when NO_DATA_FOUND then
owa_util.redirect_url('login?loginerror=true');
when others then
htp.print('Error#' || SQLCODE || ' : ' || SUBSTR(SQLERRM, 1, 100));

end account_customer;

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Creating an Apache Form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway