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

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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
 
Unread Dev Shed Forums Sponsor:
  #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

Developer Shed Advertisers and Affiliates



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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap