If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > inserting date in oracle database with asp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-22-10, 04:49
naj_riq naj_riq is offline
Registered User
 
Join Date: Apr 2010
Posts: 6
inserting date in oracle database with asp

i have made a table emp in oracle. them made 2 pages using frontpage
first one is to collect data from user and second one is to insert that data in the emp table.
i typed the following code in the second page:

<%
dim empno,empname,job,mgr,hdate,salary,comm,deptno
empno = request.form("empno")
empname = request.form("empname")
job = request.form("job")
mgr = request.form("mgr")
hdate= request.form("hiredate")
salary = request.form("salary")
comm = request.form("comm")
deptno = request.form("deptno")

con.execute("insert into emp values("&empno&",'"&empname&"','"&job&"',"&mgr&",' "&hdate&"',"&salary&","&comm&","&deptno&") ")

con.close
%>

after executing, browser is showing error
EXPECTED ")" END OF STATEMENT
and arrow is directed at the beginning of hdate variable in the insert into command.



plz help!!!!
Reply With Quote
  #2 (permalink)  
Old 04-22-10, 05:45
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Code:
Dim sql
sql = insert into emp values("&empno&",'"&empname&"','"&job&"',"&mgr&",' "&hdate&"',"&salary&","&comm&","&deptno&") "

Response.Write sql
What does this produce?
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 04-24-10, 02:03
naj_riq naj_riq is offline
Registered User
 
Join Date: Apr 2010
Posts: 6
thanx.....
i m new to asp n have started workin on it recently
was trying to insert into database in oracle through front end
Reply With Quote
  #4 (permalink)  
Old 04-26-10, 06:24
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Did my post help you or are you still having trouble? I'm not sure I follow your last reply.
__________________
George
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 04-27-10, 01:45
naj_riq naj_riq is offline
Registered User
 
Join Date: Apr 2010
Posts: 6
yup.....
i was able to solve my problem.....i m makin a proj using asp n oracle
Reply With Quote
  #6 (permalink)  
Old 04-27-10, 10:01
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Good work!


Next up I STRONGLY recommend taking a look at "prepared statements" using command objects instead of direct inline sql. There are severe security implications with pulling form variables directly in to a query from an HTTP request. Bad mojo. Have a look at "sql injection" for more info on that one. Also, you'll see some (usually modest) performance benefits from using prepared statements.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #7 (permalink)  
Old 04-30-10, 03:44
naj_riq naj_riq is offline
Registered User
 
Join Date: Apr 2010
Posts: 6
Problem in datatype

create table quiz_result
( quiz_id varchar(8),
qno varchar(10),
answer varchar(10) NOT NULL,
logintime timestamp NOT NULL,
logouttime timestamp NOT NULL,
PRIMARY KEY(quiz_id,qno),
emp_no number(8),
CONSTRAINTS fk_Permp_emp_mstr FOREIGN KEY (emp_no)
REFERENCES mp_emp_mstr(emp_no)
)

i was tryin to create the above mentioned table. i wnat to store both date and time in the fields logintime and logouttime.
but the following error occured

logintime timestamp NOT NULL,
INVALID DATATYPE.

WHICH DATATYPE SHUD I USE INSTEAD OF TIMESTAMP??
Reply With Quote
  #8 (permalink)  
Old 04-30-10, 10:30
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
edit: n/m, I forgot you were using Oracle.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #9 (permalink)  
Old 05-05-10, 07:47
naj_riq naj_riq is offline
Registered User
 
Join Date: Apr 2010
Posts: 6
create table gp_detail
( book_no number(3) REFERENCES book_mstr(book_no),
gp_no number(4) REFERENCES gp_hdr(gp_no),
item_no number(2),
item_desc varchar(50),
issue_qty number(2),
remarks varchar(65),
CONSTRAINTS pk_gp_detail(book_no,gp_no,item_no)
)
/

i m geeting an error at line 8..............INVALID COLUMN NAME
book_no and gp_no are foreign keys
i want to make book_no,gp_no and item_no .......all three of them together as the primary key.
plzzz tell me where i m goin wrong in my code
Reply With Quote
  #10 (permalink)  
Old 02-26-11, 08:58
seoservice seoservice is offline
Registered User
 
Join Date: Feb 2011
Location: Miami, Florida
Posts: 10
Sending SMS via ASP.NET

Hello Guys !!!

Anyone can know how can I will use ASP.net for sending sms....

I don't have any idea. so please specify ....


regards
Manish
Reply With Quote
  #11 (permalink)  
Old 05-29-11, 13:16
airmbul airmbul is offline
Registered User
 
Join Date: May 2011
Location: P.O. Box 1044, Magnolia Houston TX.77355
Posts: 1
International SOS Evacuation by Air Ambulance

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On