Solved

ORACLE STORED PROCEDURE CALLING PROBLEM IN JSP?

Posted on 2004-03-27
7
280 Views
Last Modified: 2010-03-31
I wrote a stored procedure in oracle 9i  I don’t know its right or wrong  but its compiling error free ..  I want pass TID for example 189  it should return record set it could be 1 record or more then 1..
well This is my PROCEDURE:


-----------------XXX----------------XXX-------------------------XXX------------------
CREATE OR REPLACE PROCEDURE GETMSGRECSET
(TH_ID   IN ESSE.TID%TYPE)
        
        
IS
         cursor ET_cursor IS
      select EM.MSGID,EMT.PID,EM.SUT,EM.CDATE
                     FROM ESSE EM, ESST EMT
                     WHERE
                     EM.TID=TH_ID AND
                     EMT.CID=EM.MSGID AND
                     EMT.APPROVED=1 ;
begin
      
      COMMIT;
      
      
end GETMSGRECSET;
/

-----------------XXX----------------XXX-------------------------XXX------------------

I need 2 no how I can get all filed  in jsp ?
and is there any thing wrong in my s-procedure so let me know ..??
0
Comment
Question by:onlyamir007
  • 4
  • 3
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10695675

You need to return the cursor from the SP. Why is there a commit in a select?

>>I need 2 no how I can get all filed  in jsp ?

Probably just cast the single row in the ResultSet returned from the SP  (the cursor) to a ResultSet (your n rows)
0
 
LVL 4

Author Comment

by:onlyamir007
ID: 10697267
Can you give me example ??
b/caz, I’m new I mean I’m writing SP first time :$
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 10698003
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Author Comment

by:onlyamir007
ID: 10698384
thx 4 your help
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10698422
8-)
0
 
LVL 4

Author Comment

by:onlyamir007
ID: 10702039
HI  CEHJ
I need little more help :$
-----------------------------xxxxxxxxxxxxxxxxxxxxxxxx-------------------------xxxxxxxxxxxxxxxxxxxxxx------------------
CREATE OR REPLACE FUNCTION sp_get_M
(
FM_ID          IN             NUMBER,
TUSER        OUT             EM.USERID%TYPE,
TRPS         OUT            EM.MID%TYPE
)
    RETURN types.ref_MGcursor
AS
    F_cursor types.ref_MGcursor;
BEGIN
    OPEN F_cursor FOR

                                SELECT EM.USERID
            FROM EF, ET, EM , EUR
            WHERE
            EF.FID        =    FM_ID ;


            SELECT COUNT(USERID) AS TUSER
            INTO TUSER
            FROM EM
            WHERE
            EM.USERID   =   <<<<<<<  I WANT USE HERE  FIRST QUERY USERID OUTPUT ???????? >>>>>        
            
    RETURN F_cursor;
END;
/
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10703270
This is not really the TA for these questions onlyamir007. Please post in the database TA.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 65
Apps blocked by Java 9 88
difference of if loops 23 62
how to install java on RHEL image on EC2 4 41
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question