Hi Yang,

Yang XIAO wrote:

> Hi, there
>
> Do you have any idea on how to execute a sql statement like:
> EXECUTE PK_CRS_TEST.PR_MEMBERSHIP_DELETE(1);
>
> I tried the following, but it give me err:
> stella@lewis:~/crs > java TalkOracle
> SQLException: ORA-00900: invalid SQL statement
>
> ...
> try {
>                     con =
> DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.225:1526:ARES_L",
> usr, pwd);
>
>                     Statement stmt = con.createStatement();
>                     sql = "EXECUTE PK_CRS_TEST.PR_MEMBERSHIP_DELETE(1)";

Try using oracle syntax:

   sql = "begin PK_CRS_TEST.PR_MEMBERSHIP_DELETE(1); end;";

The execute command you use (in SQL plus?) is a shortcut that wrappes "begin" "end" 
around
the statement.


>
>                     boolean rs = stmt.execute(sql);
>                     if (rs) {
>                         System.out.println("we went through");
>                     }
>                     else System.out.println("it returns an update count or there are 
>no
> more results");
>
> thanks for help in advance
> yang
>

------------------------------------------------------------
      COAS, Your partner in computer aided services

   Nijverheidsweg 34        Tel:   +31 (0) 187 49 3222
   Postbus 44               Fax:   +31 (0) 187 49 2912
   3250 AA Stellendam       Email: [EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to