| |
|
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.
|
 |

04-22-10, 04:49
|
|
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!!!!
|
|

04-22-10, 05:45
|
|
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?
|
|

04-24-10, 02:03
|
|
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
|
|

04-26-10, 06:24
|
|
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.
|
|

04-27-10, 01:45
|
|
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
|
|

04-27-10, 10:01
|
|
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.
|
|

04-30-10, 03:44
|
|
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??
|
|

04-30-10, 10:30
|
|
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.
|
|

05-05-10, 07:47
|
|
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
|
|

02-26-11, 08:58
|
|
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
|
|

05-29-11, 13:16
|
|
Registered User
|
|
Join Date: May 2011
Location: P.O. Box 1044, Magnolia Houston TX.77355
Posts: 1
|
|
|
International SOS Evacuation by Air Ambulance
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|