Example of asp classic using msdaora calling oracle 10g stored proc?
i just migrated a sql server application to oracle using sql developer workbench. i am having immediate problems of course...
this example asp code and oracle procedure first complains of wrong number and type of arguments. if i have similar code that i just remove the return parameter then it works but anything that i need an inpurt parameter for doesn't work.
any assistance most appreciated!
set sp_portfolio = Server.CreateObject("ADODB.Command")
sp_portfolio.ActiveConnection = MM_MHR_CONN_STR_STRING
sp_portfolio.CommandType = 4
sp_portfolio.CommandTimeout = 0
sp_portfolio.Prepared = true
sp_portfolio.CommandText = "PMS.Sp_HPMSQ003_Get_Portfolio"
sp_portfolio.Parameters.Append sp_portfolio.CreateParameter("IP_PMSPF_ID", 200, 1,10,sp_portfolio__P_PMSPF_ID)
sp_portfolio.Parameters.Append sp_portfolio.CreateParameter("rs", 200, 2, 10000)
set rst_Portfolio = sp_portfolio.Execute
CREATE OR REPLACE PROCEDURE "SP_HPMSQ005_GET_PROJECTS"
v_P_PMSPF_ID IN NUMBER DEFAULT NULL ,
v_P_START_DT IN varchar2 DEFAULT NULL ,
cv_1 IN OUT SYS_REFCURSOR
AS
BEGIN
OPEN cv_1 FOR
select P.*, TO_CHAR(PMSPT_PLND_REL_DT, 'YYYY') || ' ' || TO_CHAR(PMSPT_PLND_REL_DT, 'MM') Combodate,
TO_CHAR(PMSPT_PLND_REL_DT, 'MM') RelMnth, TO_CHAR(PMSPT_PLND_REL_DT, 'YYYY') RelYear,
S.PMSPS_IMGPTH_TXT, S.PMSPS_DESC_TXT
From TPMSPT_PROJECT P, TPMSPP_PORTFOLIO_PROJECT F, TPMSPS_PROJECT_STATUS S
Where F.PMSPF_ID = v_P_PMSPF_ID
and P.PMSPT_ID = F.PMSPT_ID
and S.PMSPS_CD = P.PMSPS_CD
and P.PMSPT_PLND_REL_DT >= TO_DATE(ltrim(rtrim(v_P_START_DT)), 'yyyy.mm.dd')
Order by P.PMSPT_PLND_REL_DT, UPPER(P.PMSPT_SNAM_TXT);
END;
Hi,
If all the data and tables involved have been successfully migrated into Oralce then your best option will be to try one of the forums that can help with ASP or MSDAORA. They will be in a better postion to help with problems using these products and diagnosing the cause.
If it then turns out it was caused by a SQL*Developer migration problem then we can investigate that further.
Regards,
Mike
Similar Messages
-
Calling Oracle 10g Stored Proc with Assoc Array from C# VS 2008
I have the following PL/SQL procedure:
CREATE OR REPLACE PROCEDURE HMA_ADM.PRC_VDM_SAVDEL_VEN_DOC
P_OP IN VARCHAR2,
P_USRID IN TB_VDM_MANAGE_DOCUMENTS.CREATEDBY%TYPE,
P_DATE IN VARCHAR2, -- HAS TO BE STRING, ELSE WE GET AN ERROR
P_DOCNAM IN TB_VDM_MANAGE_DOCUMENTS.DOCUMENT_NAME%TYPE,
P_DOCLNK IN TB_VDM_MANAGE_DOCUMENTS.DOCUMENTLINK%TYPE,
P_FNGUID IN TB_VDM_MANAGE_DOCUMENTS.FILENET_GUID%TYPE,
P_DESC IN TB_VDM_MANAGE_DOCUMENTS.DESCRIPTION%TYPE,
P_REQID IN VARR
) IS
Where VARR is:
CREATE OR REPLACE TYPE VARR IS TABLE OF INTEGER;
In C# I have the following code:
int64[] intReqID;
OracleCommand cmdVDL = new OracleCommand(DBQueries.SPQRY_SAVDELVENDOC, connDB);
cmdVDL.CommandType = CommandType.StoredProcedure;
cmdVDL.Parameters.Add(new OracleParameter("P_OP", strOP));
cmdVDL.Parameters.Add(new OracleParameter("P_CREATEBY", strUID));
cmdVDL.Parameters.Add(new OracleParameter("P_CREATEDATE", strDate));
cmdVDL.Parameters.Add(new OracleParameter("P_DOCNAM", strDocNam));
cmdVDL.Parameters.Add(new OracleParameter("P_DOCLNK", strURL));
cmdVDL.Parameters.Add(new OracleParameter("P_FNGUID", strGUID));
cmdVDL.Parameters.Add(new OracleParameter("P_DESC", strDesc));
cmdVDL.Parameters.Add(new OracleParameter("P_REQID", OracleDbType.Int64) {
CollectionType = OracleCollectionType.PLSQLAssociativeArray,
Size = intReqID.Count(),
Value = intReqID,
DbType = DbType.Int64,
OracleDbType = OracleDbType.Int64
OracleParameterStatus[] stat = new OracleParameterStatus[intReqID.Count()];
for (i = 0; i < intReqID.Count(); i++) {
stat[i] = OracleParameterStatus.Success;
cmdVDL.Parameters["P_REQID"].ArrayBindStatus = stat;
cmdVDL.ExecuteNonQuery();
When I run this I get the following error:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'PRC_VDM_SAVDEL_VEN_DOC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
If I remove the Associative Array from both, the procedure runs fine.
What am I doing wrong?Additionally,
1) UDT support requires 11106.20 or higher ODP (but can be used against 10g db)
2) if the plsql is changeable, you may want to swap it to associative array instead to avoid having to create custom classes for the UDT, and here's a short sweet example.
Greg
CREATE or replace PACKAGE MYPACK3 AS
TYPE numarray is table of number index by BINARY_INTEGER;
PROCEDURE getempsinarray(thearray IN numarray, numrecs out number);
END MYPACK3;
CREATE or replace PACKAGE BODY MYPACK3 AS
PROCEDURE getempsinarray(thearray IN numarray, numrecs out number)
IS
begin
numrecs := thearray.count;
END getempsinarray;
END MYPACK3;
using System;
using System.Data;
using Oracle.DataAccess.Client;
public class indexby
public static void Main()
OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger;");
con.Open();
OracleCommand cmd = new OracleCommand("mypack3.getempsinarray", con);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter Param1 = cmd.Parameters.Add("param1", OracleDbType.Int32);
Param1.Direction = ParameterDirection.Input;
Param1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
Param1.Value = new int[3]{7369,7499, 7521};
Param1.Size = 3;
OracleParameter Param2 = cmd.Parameters.Add("param2", OracleDbType.Int32, DBNull.Value, ParameterDirection.Output );
cmd.ExecuteNonQuery();
Console.WriteLine("{0} records passed in",Param2.Value);
con.Close();
} -
Any one use java call oracle ERP stored procdure
Hi,
Any one use java call oracle ERP stored procdure?
Example I want ues java call below stored, it can work , but in Oracle ERP have error : "APP-MRP-22130: Cannot connect to database
Cause: The current routine cannot connect to the database.
Action: Contact your system administrator or customer support representative.
CREATE OR REPLACE procedure XXBOM_ITEM_IMPORT
is
x number;
begin
fnd_global.apps_initialize
(1070, /*i_user_id*/
20634, /*i_responsibility_id*/
401 /*i_application_id*/
/* import item */
x := fnd_request.submit_request(
application => 'INV',
program => 'INCOIN',
argument1 => 141,
argument2 => 1,
argument3 => 1,
argument4 => 1,
argument5 => 1
end;Note 164701.1 in metalink may be relevant.
-
Error in calling Oracle AMG stored proc
Oracle FIn version - 11.2.0
Oracle client version - 9.2.0
Hi,
I’m trying to do an Oracle AMG call setGlobalInfo from VBScript. This call fails with the following error message. Please let me know how I could fix this.
SetGlobalInfo: Return MsgData = FND FND_AS_UNEXPECTED_ERROR N PKG_NAME PA_INTERFACE_UTILS_PUB N PROCEDURE_NAME Set_Global_Info N ERROR_TEXT ORA-20001: Oracle error -20001: ORA-20001: Error occurred during product initialization for MO when executing 'begin MO_GLOBAL.INIT; end;'.
SQLCODE = -20001
SQLERROR = ORA-20001: SQL_PLSQL_ERROR: N, ROUTINE, MO_GLOBAL.INIT, N, ERRNO, -2000
SetGlobalInfo: Return MsgCount = 1
SetGlobalInfo: Return Status = U
Thanks in advance,
RajuOracle FIn version - 11.2.0
Oracle client version - 9.2.0
Hi,
I’m trying to do an Oracle AMG call setGlobalInfo from VBScript. This call fails with the following error message. Please let me know how I could fix this.
SetGlobalInfo: Return MsgData = FND FND_AS_UNEXPECTED_ERROR N PKG_NAME PA_INTERFACE_UTILS_PUB N PROCEDURE_NAME Set_Global_Info N ERROR_TEXT ORA-20001: Oracle error -20001: ORA-20001: Error occurred during product initialization for MO when executing 'begin MO_GLOBAL.INIT; end;'.
SQLCODE = -20001
SQLERROR = ORA-20001: SQL_PLSQL_ERROR: N, ROUTINE, MO_GLOBAL.INIT, N, ERRNO, -2000
SetGlobalInfo: Return MsgCount = 1
SetGlobalInfo: Return Status = U
Thanks in advance,
Raju -
Why we dont use STANDBY_ARCHIVE_DEST in oracle 10g
Hi,
Why we dont use standby_archive_dest in oracle 10g standby database,
at which location the archives will arrive in standby database if standby redo logs created &
at which location the archives will arrive in standby database if standby redo logs are not created.
Please answer.
ThanksHi,
But B14239-05 doc for oracle database 10g ,
Under the 3rd chapter,
Example 3-5 Modifying Initialization Parameters for a Physical Standby Database
DB_NAME=chicago
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston)'
CONTROL_FILES='/arch1/boston/control1.ctl', '/arch2/boston/control2.ctl'
DB_FILE_NAME_CONVERT='chicago','boston'
LOG_FILE_NAME_CONVERT=
'/arch1/chicago/','/arch1/boston/','/arch2/chicago/','/arch2/boston/'
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1=
'LOCATION=/arch1/boston/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=boston'
LOG_ARCHIVE_DEST_2=
'SERVICE=chicago LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=chicago'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=chicago
FAL_CLIENT=boston
standby_archive_dest is not mentioned?
Why?? -
How to use iframes in oracle 10g
I have to load two jsp pages in a single html . I have done that thru iframes. But i have to dynamically load the second jsp page in the frame 2 , when the user clicks upon certain details in the frame 1 jsp page. I have wriiten the code of document.iframe in format trigger attribute. It doesn't work. Is there any other way to achieve this. I want to load the frame 2 jsp page dynamically , according to the input i get from frame 1 jsp page.
Hi,
>>Anybody know how to use profiler in oracle 10g
What do you mean "profiler". About Resource Limits/Create Profiles ?
>>i couldn't able to install the enterprise manager console.
What OS ?
>>because i need to trace the execution of a stored procedure.waiting the reply.
Debug ? You can use SQL Developer, TOAD, PLSQL Developer for this purpose.
Cheers -
How to Use Profiler in ORACLE 10g
Hi all,
Anybody know how to use profiler in oracle 10g and also i couldn't able to install the enterprise manager console.is there any tools available for that.because i need to trace the execution of a stored procedure.waiting the reply.
SathishHi,
>>Anybody know how to use profiler in oracle 10g
What do you mean "profiler". About Resource Limits/Create Profiles ?
>>i couldn't able to install the enterprise manager console.
What OS ?
>>because i need to trace the execution of a stored procedure.waiting the reply.
Debug ? You can use SQL Developer, TOAD, PLSQL Developer for this purpose.
Cheers -
Can we call a Java Stored Proc from a PL/SQL stored Proc?
Hello!
Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
Thank you!For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
CREATE OR REPLACE PACKAGE MyPackage AS
TYPE Ref_Cursor_t IS REF CURSOR;
FUNCTION get_good_ids RETURN VARCHAR2 ;
FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
END MyPackage;
CREATE OR REPLACE PACKAGE BODY MyPackage AS
FUNCTION get_good_ids RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'MyServer.getGoodIds() return java.lang.String';
FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
IS table_cursor Ref_Cursor_t;
good_ids VARCHAR2(100);
BEGIN
good_ids := get_good_ids();
OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' | | good_ids | | ')';
RETURN table_cursor;
END;
END MyPackage;
public class MyServer{
public static String getGoodIds() throws SQLException {
return "1, 3, 6 ";
null -
Creating a Oracle 10g stored procedure as a datasource for crystal 9 repor
Can someone direct me to instructions or information on how to create a Oracle 10g stored procedure as a datasource for my Crystal Reports 9.0 report?
i've found this example for you
http://www.pdssoftware.com/newsletter/mar07/page6.htm
and you could be able to get the guides from the SAP guide website for the products
http://help.sap.com/businessobject/product_guides/
hope this was helpful
good luck
Amr -
Calling a COBOL stored proc from Java Servlet
I am trying to call a COBOL stored proc from a Java Servlet. The stored proc is stored on a DB2 database. I need to send 6 inputs to the COBOL stored proc and the output will be the return code of the stored proc. I'm not sure if I'm going about this the right way. This is how my code looks...
public int callStoredProc(CallableStatement cstmt,
Connection con,
String sYear,
String sReportNbr,
String sSystemCode,
String sUserId,
String sModuleNbr,
String sFormId){
int iParm1 = 0;
try{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
catch(ClassNotFoundException ex){
System.out.println("Failed to locate database driver: "
+ ex.toString());
return iParm1;
try{
cstmt = con.prepareCall("{? = CALL MKTPZ90C
cstmt.registerOutParameter(1, Types.INTEGER);
cstmt.setString(2, sYear);
cstmt.setString(3, sReportNbr);
cstmt.setString(4, sSystemCode);
cstmt.setString(5, sUserId);
cstmt.setString(6, sModuleNbr);
cstmt.setString(7, sFormId);
cstmt.execute();
iParm1 = cstmt.getInt(1);
CloseSQLStatement(cstmt);
catch(SQLException ex) {
CloseSQLStatement(cstmt);
System.out.println("SQL exception occurred:" +
ex.toString());
return iParm1;
return iParm1;
Could someone tell me if this is the right way to go about doing this?
Thanks!!!!!!I didn't see the code where you create the database connection (variable "con"). However, the answer to your question "Is this the right way...", for me, is "Anything that works is the right way." So try it. That's a first approximation, but once you have something that works you can start on improving it, if that becomes necessary.
-
Reg.SMTP Error while using UTL_MAIL in Oracle 10g
Hi,
I am getting the following SMTP error while trying to use the UTL.MAIL package of Oracle 10g. The query is as follows.
begin
utl_mail.send(
sender => 'NAVEEN',
recipients => '[email protected]',
subject => 'Testing utl_mail',
message => 'The receipt of this email means'|| ' that UTL_MAIL works'
end;
UTL_MAIL package is installesd and the port 25 is configured and firewall is changed.
The same block was working fine before 5 days and now is giving the error as
ORA-29279: SMTP permanent error: 501 badly formatted MAIL FROM user - no "<"
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 99
ORA-06512: at "SYS.UTL_SMTP", line 222
ORA-06512: at "SYS.UTL_MAIL", line 407
ORA-06512: at "SYS.UTL_MAIL", line 594
ORA-06512: at line 2
Could you please help me out how to proceed???
Regards,
Naveen Kumar.Can you back that statement about an Oracle UTL_SMTP bug up with an actual bug number??
From what you have posted, this is not a bug!! but expected and documented (RFC'ed) SMTP server behaviour.
My proof:
/home/billy> telnet mail 25
Trying 165.143.128.26...
Connected to mail
Escape character is '^]'.
220 CNTRRA20-GTW01 [CNTRRA20-GTW01] Thu, 06 Mar 2008 14:26:26 +0200
HELO 10.251.93.58
250 CNTRRA20-GTW01 Hello [10.251.93.58]
MAIL FROM: naveen <[email protected]>
501 naveen <[email protected]> : illegal character(s) in domain string
MAIL FROM: NAVEEN
501 NAVEEN : domain string is NULL.
quit
221 CNTRRA20-GTW01 closing connection. Goodbye!
Connection closed by foreign host.
/home/billy>
As you can clearly see, the SMTP server expects a DOMAIN name as part of the MAIL FROM address. It also does not accept the alternative format suggested.
Yes, not all SMTP servers are equal and some support additional formatting.
But to imply that because the SMTP server does not accept your address formatted as string NAVEEN, it is a UTL_SMTP problem, sounds like a smelly one to me. -
Using JDeveloper with Oracle 10g Express Edition
Hi,
can JDeveloper 11g 11.1.1.4.0 Studio Edition be used to develop applications connection with Oracle 10g Express Edition?
If not, is there a version downloadable that can?
TIAYes, it can.
John -
Migration using data pump Oracle 10g - Oracle 11g
HI all,
1)
Right now I`m using Oracle 11g. I have a plan to import data from Oracle 10g. I would like to know if its possible to import data which was exported by datapump on Oracle 10g ?
Should I convert somehow expdp output from Oracle 10g to Oracle 11g format ?
2)
Next question is. If I will use expdp to create dump of complete database. May I use *.dmp to import selected users ? Or only full database can be restored ?Yes, you can import 10g dump into an 11g database.
Maybe you should take some time and read the section on datapump in the fine Oracle® [Database Utilities|http://download.oracle.com/docs/cd/B28359_01/server.111/b28319/dp_import.htm#i1007324] manual.
:p -
How to generate report using toad in oracle 10g
hi ,
i am using oracle 10g with toad editor .if i am execute any table, result it will be 100 rows like, i want to make report each records page wise with header,footer etc..
please help..
thank u..That is a Toad question isn't it, and Larry still didn't buy Quest, so you are at the wrong address.
Go to http://www.questsoftware.com and find their forums.
Thank you.
Sybrand Bakker
Senior Oracle DBA -
Using REGEXP_REPLACE in oracle 10g for repetition of the source string
Hello all,
I kept trying but unsuccessful, Here is what i would like.
I have a source string and i would like that to be repeated in the way i would like.
Let say, i have about 50 tables to write update statements for each with the same table from another database.
So, I would like to take the columns i need for each table, use a regular expression and create a set clause.
FOR EXAMPLE
say, a table has 3 columns
Source string is 'TABLE_COLUMN_1_ID,TABLE_COLUMN_2_VALUE,TABLE_COLUMN_3_DESC'
I would like to use regular expressions in 10g and get this
desired o/p
'TABLE_COLUMN_1_ID = TABLE_COLUMN_1_ID,TABLE_COLUMN_2_VALUE = TABLE_COLUMN_2_VALUE,TABLE_COLUMN_3_DESC = TABLE_COLUMN_3_DESC'
I thought s its easy with my knowledge of expressions but still struggling.
Any help is greatly appreciated.
Thanks.Something like this ?
SELECT REGEXP_REPLACE('TABLE_COLUMN_1_ID,TABLE_COLUMN_2_VALUE,TABLE_COLUMN_3_DESC',
'([^,]+)', ' \1 = \1') x
FROM DUAL;
X
TABLE_COLUMN_1_ID = TABLE_COLUMN_1_ID, TABLE_COLUMN_2_VALUE = TABLE_COLUMN_2_VALUE, TABLE_COLUMN_3_DESC = TABLE_COLUMN_3_DESC
Maybe you are looking for
-
Duplicate vendor check during supplier registration
Hi Gurus, Does SAP SRM ROS check for duplicate vendor during supplier registration? if it is not done in standard, can it be enhanced to do so? Thanks and regards, Ranjan
-
My ipod touch would not connect to itunes. I was told to do a factory reset. After i had done this it said the ipod could not be restored and is now in recovery mode and unuseable. Anyone any suggestions?
-
Random iTunes library problem or bug with duplicates
iTunes (Mac) spontaneously creates duplicate songs and does some unusual things in the process. The duplicate songs only appear in my library, the music media remains intact most of the time. Sometimes iTunes moves one or two songs from the same reco
-
MiniSAP - SE80 Prompts Error "Printer not suitable for job step..."
Hi all, I bought an ABAP Objects book. I installed the MiniSAP. When I run SAP GUI and SE80, both with BCUSER and DDIC, it gives me error message "Printer not suitable for job step. Automatic printing not possible." If I double-click on the message,
-
SRM contract upload and price tolerance during upload/simulation
Hi have anyone made/is it possible to create a tolerance to SRM GOA upload. So, during upload there is simulation and messages after upload, so, I guess it is possible to create tolerance (using badi?) that if price is fx. 10% more than old pri