Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Calling an Insert Stored Procedure in ASP

Re: Calling an Insert Stored Procedure in ASP

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Fri, 27 Jun 2003 13:54:25 +0000
Message-ID: <bdhbe5$310$1@ctb-nnrp2.saix.net>


Jason wrote:

> Ok, folks. Here's the deal. Basically, I have a Stored Procedure in
> Oracle that inserts data into a table. Simple enough. I want to call
> this sp from ASP, and here is the code:
>
> InsertQuery = "'" & serial_num & "','" & payment_type & "', " & "'" &
> contract_num & "', '" & delivery_task_order & "', '" & invoice_num &
> "', '" & invoice_date & "', '" & invoice_entered & "', " & quantity &
> ", " & unit_price & ", " & shipping_price & ", " & travel_setup_price
> & ", " & parts_consumables & ", " & invoice_amount & ", '" &
> invoice_paid_date & "', " & total_remaining & ", " & total_award & ",
> '" & comments & "'"
>
> Set cn = Server.CreateObject("ADODB.Connection")
> cn.open Application("CASSNET_ConnectionString")
> cn.execute("INVOICE_INSERT " & InsertQuery)

Huh? Unsure what you're trying to do here... You must however grok the basic INSERT sql statement in its fullest. I.e. INSERT INTO tablename [( column list)] VALUES ( value list )

That is what Oracle expects. That is what you must pass it.

> ORA-00900: invalid SQL statement

Exactly. As Oracle has no idea what the following is: INVOICE_INSERT 'value', 'value'....

That is not a valid SQL command. In any database.

If that is a Stored Proc call, then you must use a proper anynomous PL/SQL call, e.g.
BEGIN
  INVOICE_INSERT( valuelist );
END; Or you should use the stored proc class/call that is provided for you by the class/object library you're using.

Lastly, read up on bind parameters.

Oh yeah - also seriously consider getting the book 'Oracle Expert One-on-one' by Thomas Kyte. IMO that is compulsory reading for both Oracle DBA's and developers.

--
Billy
Received on Fri Jun 27 2003 - 08:54:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US