ASP invokes an Oracle stored procedure and returns the result set

Source: Internet
Author: User
ASP invokes an Oracle stored procedure and returns the result set
Look over the Internet many ASP call Oracle method, but there is no special very direct things, so summed up the things of the last one to come up with a way of their own, feel more popular so hereby released
###################################################
Oracle's stored procedures
###################################################
--Create Baotou
Create or Replace package pck_as
As
Type t_product_id is table of number
Index by Binary_integer;
Type t_serial_no is table of varchar (300)
Index by Binary_integer;
Type t_buy_date is table of date
Index by Binary_integer;

Procedure ALLSFC
(
product_id out t_product_id,
Serial_no out T_serial_no,
Buy_date out T_buy_date
);

--procedure ALLSFC1;
End Pck_as;
--Create the package body
Create or replace package body Pck_as
As
Procedure ALLSFC
(
product_id out t_product_id,
Serial_no out T_serial_no,
Buy_date out T_buy_date
)
Is
Cursor Cur_sfc_tbl_product_reg is
Select Product_id,serial_no,buy_date from Sfc_tbl_product_reg;

I number default 1;

Begin
For Onrecord in Cur_sfc_tbl_product_reg
Loop
PRODUCT_ID (i): = onrecord.product_id;
Serial_no (i): = Onrecord.serial_no;
Buy_date (i): = Onrecord.buy_date;
I: = i + 1;
End Loop;
End
End

###################################################
ASP's Call
###################################################
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Untitled Document </title>
<body>
<%
Dim Str_ora
Dim Objconn_ora
Str_ora = "Driver={microsoft ODBC for Oracle}; Server=ora192;uid=dwuser;pwd=family.samsung.com.cn "
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.