Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2010
    Posts
    6

    Unanswered: 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!!!!

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    Dim sql
    sql = insert into emp values("&empno&",'"&empname&"','"&job&"',"&mgr&",' "&hdate&"',"&salary&","&comm&","&deptno&") "
    
    Response.Write sql
    What does this produce?
    George
    Home | Blog

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

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Did my post help you or are you still having trouble? I'm not sure I follow your last reply.
    George
    Home | Blog

  5. #5
    Join Date
    Apr 2010
    Posts
    6
    yup.....
    i was able to solve my problem.....i m makin a proj using asp n oracle

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    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? ***

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

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    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? ***

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

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

  11. #11
    Join Date
    May 2011
    Location
    P.O. Box 1044, Magnolia Houston TX.77355
    Posts
    1

    International SOS Evacuation by Air Ambulance


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •