Got error when creating stored procedure

Hi,
I am a rookie in Oracle. I created a stored procedure:
create or replace procedure my_first_sp
as
begin
select cid from actions where rownum<3;
end;
And I got an error : "**** compilation error"
After I "show error" I got the description to see a "into" is expected.
But if I change the select statement to a insert statement, no error.
Please advice.
Thanks a lot.

When you have a standalone SELECT statement in PL/SQL, you have to have an INTO clause if you want the results to be stored in a local variable.
In your case, it would appear that you want your query to return multiple rows. In that case, you'd want to create a cursor, i.e.
CREATE OR REPLACE my_first_sp
AS
BEGIN
  FOR cursor_name IN (SELECT cid FROM actions WHERE rownum < 3)
  LOOP
    <<Do something>>
  END LOOP;
END;I would also tend to suspect that your SELECT statement is wrong. This statement will return an arbitrary two cid values from the actions table, which is not likely what you want.
Justin

Similar Messages

  • SSRS dataset throws error when another stored procedure is called inside dataset stored procedure

    Hello;
    I am using Report Build 3.0, I have a simple report which gets data using dataset which is created from a Stored Procedure. I have another stored procedure which updates the data in the table which is used for the report. I want to get the live data on report everytime
    the report is run so that I call that stored procedure (sp_updatedata) inside my report dataset stored procedure and here where my report fails as it throws error while creating dataset.
    Here is sample:
    sp_updatedata (this only returns "Command(s) completed successfully"
    Create Proce sp_getReportData
    As
    Begin
    Exec sp_updatedata -- I call it to update the data before it displays on the report
    Select * from customers
    End
    If I remove this line it works.
    Exec sp_updatedata -- I call it to update the data before it displays on the report
    Thanks
    Essa Mughal

    Hi MESSA,
    According to your description, you create a dataset based on a stored procedure. In this procedure, it calls another procedure. Now it throws error when creating dataset. Right?
    In Reporting Services, when creating dataset, all the query or stored procedure will be executed in SSMS. So if the procedure can be executed in SSMS, it supposed to be working in SSRS. However, it has a limitation in SSRS. In a dataset, it can only return
    one result set.
    In this scenario, I don't think it's the issue of calling other procedure inside of procedure. Because we tested in our local environment, it works fine. I guess the sp_updatedata returns a result set, and the "select * from customers" returns
    another result set. This might be the reason cause the error.
    Reference:
    Query Design Tools in Report Designer SQL Server Data Tools (SSRS)
    Reporting Services Query Designers
    If you still have any question, please post the error message and the store procedure (sp_updatedata).
    Best Regards,
    Simon Hou

  • Got Error when creating application server connection

    Hi Guys...I am using SOA 10.1.3.1.0
    I got the following error when creating application server connection
    In Step 1:
    I selected the Connection type as Standalone OC4J 10.1.3 (Why because I use this one)
    In Step 2:
    In this step I gave username and password (same username and password to connect to BPEL console)to authenticate connection
    In step 3:
    It is asking for Hostname, RMI port and URL path. My computer name is gopal-computer. I gave this hostname. RMI port number is 23791 by default. I kept this one as it is and URL path optional I think. I did not give any thing.
    In step 4:
    When I hit the test connection button its giving the following error
    Error while getting remote MBeanServer for url: ormi://gopal-computer:23791/default:
    Error reading application-client descriptor: Error communicating with server: Connection refused: connect; nested exception is:
         javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
    Please help me.
    Thanks,
    Gopal.....

    For SOA Suite connection you should choose "Oracle application server 10g 10.1.3"

  • ESB throwing error when invoking Stored Procedure

    Hi there,
    I'm using SOA Suite 10.1.3.4. I have an ESB service which stores orders from a IBM Maximo system(Procurement system) into Oracle database using stored procedure. I can insert the orders through the endpoint URL using the test client provided by SOA Suite ESB console. But when Maximo sends the orders i'm getting errors as below. I can also see that the input is null when called the procedure. But in the instance of the ESB Console i can see the Payload sent by the Maximo system. Not sure where and why the payload disappears before calling the stored procedure.
    I have been battling on this for couple of days. Any help on this is much appreciated.
    <2009-01-09 11:21:12,003> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.TopLinkLogger log> client acquired
    <2009-01-09 11:21:12,003> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.TopLinkLogger log> acquire unit of work: 25523441
    <2009-01-09 11:21:12,003> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.TopLinkLogger log> TX beginTransaction, status=STATUS_ACTIVE
    <2009-01-09 11:21:12,003> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.sp.AbstractStoredProcedure execute> BEGIN APSEZ.APS_MAXIMO_INTERFACE.APS_RECIEVE_POV(I_PO_IN_OBJ=>?); END;
    <2009-01-09 11:21:12,003> <DEBUG> <default.collaxa.cube.ws> <Database Adapter::Outbound> <oracle.tip.adapter.db.sp.AbstractStoredProcedure execute> Bindings [I_PO_IN_OBJ=>APSEZ.GET_PO_IN_OBJ(null)]
    ORABPEL-11811
    Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the APSEZ.APS_MAXIMO_INTERFACE.APS_RECIEVE_POV API. Cause: java.sql.SQLException: ORA-06531: Reference to uninitialized collection
    ORA-06512: at "APSEZ.APS_MAXIMO_INTERFACE", line 52
    ORA-06512: at line 1
    [Caused by: ORA-06531: Reference to uninitialized collection
    ORA-06512: at "APSEZ.APS_MAXIMO_INTERFACE", line 52
    ORA-06512: at line 1
    Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
         at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:469)
         at oracle.tip.adapter.db.sp.SPUtil.createResourceException(SPUtil.java:172)
         at oracle.tip.adapter.db.sp.AbstractStoredProcedure.execute(AbstractStoredProcedure.java:116)
         at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:134)
         at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1014)
         at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:232)
         at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:486)
         at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFOperation_JCA.java:739)
         at oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(WSIFInvoker.java:894)
         at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:810)
         at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(WSIFInvoker.java:832)
         at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService(OutboundAdapterService.java:223)
         at oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusinessEvent(OutboundAdapterService.java:135)
         at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(InitialEventDispatcher.java:406)
         at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:164)
         at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
         at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
         at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:205)
         at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(EventUtils.java:136)
         at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(EsbRouterSubscription.java:309)
         at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(EventDispatcher.java:138)
         at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(InitialEventDispatcher.java:545)
         at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(InitialEventDispatcher.java:527)
         at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(EventDispatcher.java:94)
         at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(InitialEventDispatcher.java:160)
         at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1988)
         at oracle.tip.esb.server.dispatch.BusinessEvent.raise(BusinessEvent.java:1467)
         at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.raiseEvent(EventOracleSoapProvider.java:399)
         at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.processMessage(EventOracleSoapProvider.java:225)
         at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:956)
         at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:349)
         at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:466)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
         at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:194)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Thanks
    Dhilip

    I doubt JPublisher has anything to do with this issue as JDeveloper is the tool used for SOA Development. The issue here is with the process that gets invoked by maximo. It is not populating the data correctly, and nulls are being sent to the adapter. When nulls are sent this causes issues in the code because it cannot initilise varrays in the stored procedure.
    Therefore the fix is to sort this issue out is to stop it sending nulls, if nulls are valid form the maximo system then the stored procedure needs to manage these. This can be done by setting defaults for the inputs.
    cheers
    James

  • Getting error when calling stored procedure

    I have created 2 stored procedures as follows
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER PROCEDURE [dbo].[REAL_PUSH_UPDATE_REPORTS] AS
    BEGIN TRANSACTION
         DECLARE @cursor_contact_id bigint;
         DECLARE cursorContactId Cursor FOR SELECT distinct(contact_id) FROM [dbo].credit_reports WHERE loan_id IS NULL;
         OPEN cursorContactId;
         Fetch NEXT FROM cursorContactId INTO @cursor_contact_id;
    IF(@@FETCH_STATUS <> 0)
    PRINT 'There are no LOAN contacts are there with loan ID null, May be you have already executed this procedure'
         WHILE(@@FETCH_STATUS =0)
         BEGIN
    PRINT @cursor_contact_id;
              EXECUTE REAL_UPDATE_REPORTS @cursor_contact_id;
              Fetch NEXT FROM cursorContactId INTO @cursor_contact_id
         END
         CLOSE cursorContactId;
         DEALLOCATE cursorContactId;
         IF (@@Error = 0)
              BEGIN
                   COMMIT TRANSACTION;
              END
         ELSE
              BEGIN
                   ROLLBACK TRANSACTION;
              END
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    ALTER PROCEDURE [dbo].[REAL_UPDATE_REPORTS] @initial_contact_id bigint AS
    BEGIN TRANSACTION
         DECLARE @loan_count bigint;
         DECLARE cursorLoanID Cursor FOR (SELECT l.loan_id loanIDList FROM (([dbo].loans l LEFT OUTER JOIN [dbo].loan_requests lr
    ON lr.loan_id=l.loan_id
    AND lr.contact_id = l.primary_borrower_id)
    LEFT OUTER JOIN [dbo].loan_codes lc
    ON l.loan_code_id = lc.loan_code_id) 
    WHERE (l.primary_borrower_id=@initial_contact_id)
    AND l.active=1  UNION  SELECT l.loan_id 
    FROM   [dbo].loans l LEFT OUTER JOIN [dbo].loan_requests lr
    ON lr.loan_id=l.loan_id LEFT OUTER JOIN [dbo].contacts c
    ON c.contact_id =l.primary_borrower_id
    WHERE (l.loan_id IN
    (SELECT cb.loan_id FROM coborrowers cb where contact_id =@initial_contact_id and active = 1))
    UNION
    SELECT l.loan_id 
    FROM   [dbo].loans l LEFT OUTER JOIN [dbo].loan_requests lr
    ON lr.loan_id=l.loan_id LEFT OUTER JOIN [dbo].contacts c
    ON c.contact_id =l.primary_borrower_id
    WHERE (l.loan_id IN (SELECT cs.loan_id
    FROM cosigners   cs where contact_id =@initial_contact_id and active = 1)) UNION
    SELECT g.loan_id  FROM   [dbo].groups g, [dbo].group_members gm,
    [dbo].loan_requests lr WHERE gm.group_id = g.group_id
    AND lr.loan_id = g.loan_id
    AND lr.contact_id = gm.secondary_borrower_id
    AND gm.secondary_borrower_id=@initial_contact_id and gm.active = 1) 
    ORDER BY loanIDList DESC;
         OPEN cursorLoanID;
         SET @loan_count = @@CURSOR_ROWS;
    PRINT @loan_count;
         IF(@loan_count > 0)     BEGIN
              DECLARE @loans_loan_id bigint;
              Fetch NEXT FROM cursorLoanID INTO @loans_loan_id;
              DECLARE @my_count bigint;
              SET @my_count=1;
              WHILE(@@FETCH_STATUS =0)
              BEGIN
                   DECLARE @temp_contact_id bigint;
                   DECLARE @temp_loan_id bigint;
                   SET @temp_contact_id = @initial_contact_id;
                   SET @temp_loan_id = @loans_loan_id;
                   IF(@my_count=@loan_count)
                        BEGIN
                             UPDATE [dbo].credit_reports SET loan_id = @temp_loan_id WHERE
    loan_id IS NULL AND contact_id = @initial_contact_id 
    AND NOT EXISTS (SELECT * FROM  [dbo].credit_reports
    WHERE contact_id = @initial_contact_id  AND
    loan_id=@temp_loan_id);
                        END
                   ELSE
                        BEGIN
                             INSERT INTO [dbo].credit_reports(contact_id,credit_bureau_id, credit_score, thirty_days_late,
    sixty_days_late, ninety_days_late, currently_negative, amount_past_due,
    inquiries_six_mos, public_records, collections, total_accounts_balance,
    total_mthly_pymts, report_file, report_gu_id, data_entry_by, data_entry_date,
    loan_id)  SELECT contact_id,credit_bureau_id, credit_score, thirty_days_late,
    sixty_days_late, ninety_days_late, currently_negative, amount_past_due,
    inquiries_six_mos, public_records, collections, total_accounts_balance,
    total_mthly_pymts, report_file, report_gu_id, data_entry_by,
    data_entry_date,@temp_loan_id   FROM [dbo].credit_reports WHERE contact_id
    = @initial_contact_id AND loan_id IS NULL
    AND NOT EXISTS (SELECT * FROM
    [dbo].credit_reports WHERE contact_id=@initial_contact_id AND
    loan_id=@temp_loan_id);
    END
    Fetch NEXT FROM cursorLoanID INTO @loans_loan_id;               
    SET @my_count = @my_count + 1;
              END
    close cursorLoanID
    deallocate cursorLoanID
              IF (@@Error = 0)
                   BEGIN
                        COMMIT TRANSACTION;
                        PRINT 'Success for contactID :'+CONVERT(varchar(50),@initial_contact_id);
                   END
              ELSE
                   BEGIN
                        ROLLBACK TRANSACTION;
                        PRINT 'Failed for contactID :'+CONVERT(varchar(50),@initial_contact_id);
                   END
         END
         ELSE
         BEGIN
              ROLLBACK;
              PRINT 'NO Loans For the contactID :'+CONVERT(varchar(50),@initial_contact_id);
         ENDnow the problem is
    i have executed 2 procedures saperately thn its ok while im calling im getting
    Msg 16915, Level 16, State 1, Procedure REAL_UPDATE_REPORTS, Line 5
    A cursor with the name 'cursorLoanID' already exists.
    Msg 16905, Level 16, State 1, Procedure REAL_UPDATE_REPORTS, Line 6
    The cursor is already open.Please let me know the reason...
    Thank you.
    Message was edited by:
    User71408

    What the heck, that's fun..
    I for one, have never seen T-sql or whatever it's called.
    Looking at it, it seems that a
    close cursorLoanID
    deallocate cursorLoanID
    is missing from the ELSE section doing the rollback.
    But, only guessing
    Fun, fun, fun

  • Got error when creating a standby DB from rman:  no backup or copy... Why?

    We try to create standby database from a production DB on another server (10.2.0.4). The RMAN backup is in the nfs file system which is also mounted to the target server (the DR box). So, the access path for the rman backup is the same look from primary DB server and DR DB server. I started the RMAN run:
    RMAN> RUN
    2> {
    3> ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
    4> ALLOCATE AUXILIARY CHANNEL aux2 DEVICE TYPE DISK;
    5> DUPLICATE TARGET DATABASE for standby
    6> nofilenamecheck
    7> dorecover;
    8> }
    9>
    10> exit
    using target database control file instead of recovery catalog
    allocated channel: aux1
    channel aux1: sid=582 devtype=DISK
    allocated channel: aux2
    channel aux2: sid=584 devtype=DISK
    Starting Duplicate Db at 21-JUN-12
    contents of Memory Script:
    set until scn 12198261770353;
    restore clone standby controlfile;
    sql clone 'alter database mount standby database';
    executing Memory Script
    executing command: SET until clause
    Starting restore at 21-JUN-12
    released channel: aux1
    released channel: aux2
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 06/21/2012 16:33:36
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06024: no backup or copy of the control file found to restore
    ===========================================================================
    The backups should have controlfile. There is rman show all display:
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    CONFIGURE BACKUP OPTIMIZATION OFF;
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/inbound/online/controlfile_auto%F';
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
    CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/backup/inbound/online/%d_%T_%t_%s';
    CONFIGURE MAXSETSIZE TO UNLIMITED;
    CONFIGURE ENCRYPTION FOR DATABASE OFF;
    CONFIGURE ENCRYPTION ALGORITHM 'AES128';
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/backup/inbound/online/snapcf_inbound.f';
    Why and how to fix? Thanks for help!

    Here is the list of command:
    RMAN> list backup of controlfile ;
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    5518 Full 4.57M DISK 00:00:07 17-JUN-12
    BP Key: 5518 Status: AVAILABLE Compressed: NO Tag: TAG20120617T035926
    Piece Name: /backup/inbound/online/controlfile_autoc-2080040856-20120617-00
    Control File Included: Ckp SCN: 12197994840698 Ckp time: 17-JUN-12
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    5522 Full 4.57M DISK 00:00:00 18-JUN-12
    BP Key: 5522 Status: AVAILABLE Compressed: NO Tag: TAG20120618T010158
    Piece Name: /backup/inbound/online/controlfile_autoc-2080040856-20120618-00
    Control File Included: Ckp SCN: 12198041382572 Ckp time: 18-JUN-12
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    5526 Full 4.57M DISK 00:00:01 19-JUN-12
    BP Key: 5526 Status: AVAILABLE Compressed: NO Tag: TAG20120619T010352
    Piece Name: /backup/inbound/online/controlfile_autoc-2080040856-20120619-00
    Control File Included: Ckp SCN: 12198090424606 Ckp time: 19-JUN-12
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    5530 Full 4.57M DISK 00:00:02 20-JUN-12
    BP Key: 5530 Status: AVAILABLE Compressed: NO Tag: TAG20120620T010304
    Piece Name: /backup/inbound/online/controlfile_autoc-2080040856-20120620-00
    Control File Included: Ckp SCN: 12198146424201 Ckp time: 20-JUN-12
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    5534 Full 4.57M DISK 00:00:02 21-JUN-12
    BP Key: 5534 Status: AVAILABLE Compressed: NO Tag: TAG20120621T010357
    Piece Name: /backup/inbound/online/controlfile_autoc-2080040856-20120621-00
    Control File Included: Ckp SCN: 12198210334547 Ckp time: 21-JUN-12
    ==================================================================
    I tried to catalog the controlfile:
    RMAN> catalog controlfilecopy '/backup/inbound/online/controlfile_autoc-2080040856-20120621-00';
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of catalog command on default channel at 06/21/2012 17:24:32
    ORA-19563: control file header validation failed for file /backup/inbound/online/controlfile_autoc-2080040856-20120621-00
    ====================================================================
    We have level 1 backup everyday, except Sunday. I have level 0 backup on Sunday. I alos tried the metalink note RMAN Duplicate For Standby Fails with Rman-06024: No Backup Or Copy Of The Control File Found To Restore [ID 466321.1]. It does not work.
    Thanks for help!

  • Unspecified Error when submitting stored procedure

    I am having problems submitting stored procedures against Oracle 8i using OraOLEDB. I am using the ODBC escape syntax in the command text. If I attempt to pass any of the following three characters @ or ! or ~ in the text of a varchar parameter an unspecified error 80004005 occurs, without these characters the process works fine.
    The following VB 6.0 code fragment illustrates the problem:
    Dim a As New ADODB.Connection
    Dim b As New ADODB.Command
    Dim c As ADODB.Recordset
    a.ConnectionString = "DistribTX=0;SPPrmsLOB=1;PLSQLRSet=1;Provider=OraOLEDB.Oracle;Data Source=ORACLE1;User Id=XXXX;Password=XXXX"
    a.Open
    b.CommandText = "{call gpa.dp_gpa_report.list('@MDU')}"
    Set b.ActiveConnection = a
    Set c = b.Execute
    Any advice would be appreciated. Note that if is use SQL Plus to execute gpa.dp_gpa_report.list('@MDU') it executes with not problem.
    More Information
    Software Versions:
    Windows 2000 Pro SP2
    MDAC 2.6
    OraOLEDB.dll - 8.1.7.0
    Oracle 8.1.7.0.0
    I have run the OLE-DB trace facility and it returns the following info where the error occurs:
    COracleCommand::SetCommandText(hr=80004005): 2558
    TID: 304 (ENTRY)
    The stored procedure gpa.dp_gpa_report.list is a wrapper over a table which has the following structure:
    REPORT_CODE NOT NULL VARCHAR2(50)
    EMPLOYEE_ID NOT NULL GRD.GRD_ID_TYP
    FUND_SCREEN_FILTER NUMBER(1)
    MODEL_SORT_FIELD VARCHAR2(2000)
    CLIENT_SORT_FIELD VARCHAR2(2000)
    FUND_LIST_CODE VARCHAR2(10)
    FUND_MODEL VARCHAR2(10)
    BENCHMARK_INDEX VARCHAR2(10)
    BENCHMARK_IS_TEMPLATE VARCHAR2(1)
    VALUE_DATE DATE
    HELD_STOCKS VARCHAR2(1)
    PRICE_PERFORMANCE VARCHAR2(1)
    COMPANY_INFORMATION VARCHAR2(1)
    ANALYSTS_DATA VARCHAR2(1)
    REPORT_FORMAT NUMBER(1)
    INCLUDE_SECTOR_L1 VARCHAR2(1)
    INCLUDE_SECTOR_L2 VARCHAR2(1)
    INCLUDE_SECTOR_L3 VARCHAR2(1)
    INCLUDE_SECTOR_L4 VARCHAR2(1)
    INCLUDE_ASSETS VARCHAR2(1)
    FUND_HOLDINGS VARCHAR2(1)
    INDEX_WEIGHTINGS VARCHAR2(1)
    ACTIVE_POSITIONS VARCHAR2(1)
    NO_OF_ACTIVE_POSITIONS NUMBER(5)
    ACTIVE_POSITIONS_GT_THAN NUMBER
    LIST_SORT_FIELD VARCHAR2(2000)
    AP_SORT_FIELD VARCHAR2(2000)
    INDEX_IND_STRUCT_CODE VARCHAR2(6)
    INDEX_CURRENCY VARCHAR2(6)
    ALWAYS_LATEST_DATE VARCHAR2(1)
    PERCENTAGES VARCHAR2(1)
    MARKET_VALUES VARCHAR2(1)
    HOLDINGS VARCHAR2(1)
    ISIN VARCHAR2(1)
    SEDOL VARCHAR2(1)
    DEPOT VARCHAR2(1)
    TRADED_COUNTRY_CODE VARCHAR2(1)
    SECTOR_LOWEST_CODE VARCHAR2(1)
    GIM2_ASSET_UNIVERSE VARCHAR2(6)
    GIM2_INCLUDE_CASH VARCHAR2(1)
    TRITON_ASSET_UNIVERSE VARCHAR2(6)
    TRITON_INCLUDE_CASH VARCHAR2(1)
    MODEL_ASSET_UNIVERSE VARCHAR2(6)
    MODEL_INCLUDE_CASH VARCHAR2(1)
    MARKET_CAP_LOCAL VARCHAR2(1)
    MARKET_CAP_USD VARCHAR2(1)
    ADR_INFO VARCHAR2(1)
    FMC_ASSET_UNIVERSE VARCHAR2(6)
    FMC_INCLUDE_CASH VARCHAR2(1)

    I am having problems submitting stored procedures against Oracle 8i using OraOLEDB. I am using the ODBC escape syntax in the command text. If I attempt to pass any of the following three characters @ or ! or ~ in the text of a varchar parameter an unspecified error 80004005 occurs, without these characters the process works fine.
    The following VB 6.0 code fragment illustrates the problem:
    Dim a As New ADODB.Connection
    Dim b As New ADODB.Command
    Dim c As ADODB.Recordset
    a.ConnectionString = "DistribTX=0;SPPrmsLOB=1;PLSQLRSet=1;Provider=OraOLEDB.Oracle;Data Source=ORACLE1;User Id=XXXX;Password=XXXX"
    a.Open
    b.CommandText = "{call gpa.dp_gpa_report.list('@MDU')}"
    Set b.ActiveConnection = a
    Set c = b.Execute
    Any advice would be appreciated. Note that if is use SQL Plus to execute gpa.dp_gpa_report.list('@MDU') it executes with not problem.
    More Information
    Software Versions:
    Windows 2000 Pro SP2
    MDAC 2.6
    OraOLEDB.dll - 8.1.7.0
    Oracle 8.1.7.0.0
    I have run the OLE-DB trace facility and it returns the following info where the error occurs:
    COracleCommand::SetCommandText(hr=80004005): 2558
    TID: 304 (ENTRY)
    The stored procedure gpa.dp_gpa_report.list is a wrapper over a table which has the following structure:
    REPORT_CODE NOT NULL VARCHAR2(50)
    EMPLOYEE_ID NOT NULL GRD.GRD_ID_TYP
    FUND_SCREEN_FILTER NUMBER(1)
    MODEL_SORT_FIELD VARCHAR2(2000)
    CLIENT_SORT_FIELD VARCHAR2(2000)
    FUND_LIST_CODE VARCHAR2(10)
    FUND_MODEL VARCHAR2(10)
    BENCHMARK_INDEX VARCHAR2(10)
    BENCHMARK_IS_TEMPLATE VARCHAR2(1)
    VALUE_DATE DATE
    HELD_STOCKS VARCHAR2(1)
    PRICE_PERFORMANCE VARCHAR2(1)
    COMPANY_INFORMATION VARCHAR2(1)
    ANALYSTS_DATA VARCHAR2(1)
    REPORT_FORMAT NUMBER(1)
    INCLUDE_SECTOR_L1 VARCHAR2(1)
    INCLUDE_SECTOR_L2 VARCHAR2(1)
    INCLUDE_SECTOR_L3 VARCHAR2(1)
    INCLUDE_SECTOR_L4 VARCHAR2(1)
    INCLUDE_ASSETS VARCHAR2(1)
    FUND_HOLDINGS VARCHAR2(1)
    INDEX_WEIGHTINGS VARCHAR2(1)
    ACTIVE_POSITIONS VARCHAR2(1)
    NO_OF_ACTIVE_POSITIONS NUMBER(5)
    ACTIVE_POSITIONS_GT_THAN NUMBER
    LIST_SORT_FIELD VARCHAR2(2000)
    AP_SORT_FIELD VARCHAR2(2000)
    INDEX_IND_STRUCT_CODE VARCHAR2(6)
    INDEX_CURRENCY VARCHAR2(6)
    ALWAYS_LATEST_DATE VARCHAR2(1)
    PERCENTAGES VARCHAR2(1)
    MARKET_VALUES VARCHAR2(1)
    HOLDINGS VARCHAR2(1)
    ISIN VARCHAR2(1)
    SEDOL VARCHAR2(1)
    DEPOT VARCHAR2(1)
    TRADED_COUNTRY_CODE VARCHAR2(1)
    SECTOR_LOWEST_CODE VARCHAR2(1)
    GIM2_ASSET_UNIVERSE VARCHAR2(6)
    GIM2_INCLUDE_CASH VARCHAR2(1)
    TRITON_ASSET_UNIVERSE VARCHAR2(6)
    TRITON_INCLUDE_CASH VARCHAR2(1)
    MODEL_ASSET_UNIVERSE VARCHAR2(6)
    MODEL_INCLUDE_CASH VARCHAR2(1)
    MARKET_CAP_LOCAL VARCHAR2(1)
    MARKET_CAP_USD VARCHAR2(1)
    ADR_INFO VARCHAR2(1)
    FMC_ASSET_UNIVERSE VARCHAR2(6)
    FMC_INCLUDE_CASH VARCHAR2(1)

  • Error when calling Stored Procedure from backing bean

    I am using Jdeveloper 11.1.1.6 and am trying to utilize the following URL to execute a SP from a backing bean: http://ramannanda.blogspot.com/2011/11/optimized-update-insert-adf.html
    The reason I am looking at this is currently I have coded my backing bean to perform inserts and deletes through the use of my View Objects. I am performing up to a combined 5-10K inserts and deletes and the performance is rather slow. If there is a way to tune the view objects as well as the commit to be much faster, that is the prefered method. If that can't be done then I would like to figure out the approach identified in the URL.
    I have highlighted a section of code below that is failing when using the URL approach. It errors out with the following exception: javax.el.ELException: oracle.jbo.JboException: java.sql.SQLException: Internal Error: Inconsistent catalog view
    Do you have thoughts as to what might cause this exception.
    create or replace
    type TYP_TEST_R is object
         Test_Id Number(5,0) ,
         Test_Num Number(7,0)
    create or replace
    type TYP_TEST_TB as table of TYP_TEST_R;
    private void myMethod(MyTableVORowImpl pCurrentRow) {
    int i = 0;
    DCIteratorBinding lDciter =
    (DCIteratorBinding)getBindings().get("MyTable1Iterator");
    MyAppModuleAMImpl lMyAppModuleAMImpl =
    (MyAppModuleAMImpl)lDciter.getViewObject().getApplicationModule();
    Connection lConnection =
    lMyAppModuleAMImpl.getDBTransaction().createStatement(1).getConnection();
    StructDescriptor lTblRecordStructType =
    StructDescriptor.createDescriptor("DBADMIN.TYP_TEST_R",
    lConnection);
    .....<additional logic here>......
    Object lArray[] = new Object[lSortedDifferences.size()];
    while (........) {
    Number lNumber = .......
    Number lDifferentStore = (Number)lDifferentIterator.next();
    STRUCT lTempStruct =+_
    new STRUCT(lTblRecordStructType, lConnection,+_
    *new Object[] { pCurrentRow.getTestId(),*+_
    lDifferentStore });+_
    lArray[i] = lTempStruct;
    i = i + 1;
    //create array structure descriptor
    ArrayDescriptor lTableDesc =
    ArrayDescriptor.createDescriptor("DBADMIN.TYP_TEST_TB",
    lConnection);
    //create an Array type with given structure definition
    ARRAY lTableArray =
    new ARRAY(lTableDesc, lConnection, lArray);
    String lCallableProcedureStatement =
    " begin DBADMIN.SP_TEST(?,?); end;";
    OracleCallableStatement lOracleCallableStatement = null;
    lOracleCallableStatement =
    (OracleCallableStatement)lMyAppModuleAMImpl.getDBTransaction().createCallableStatement(lCallableProcedureStatement,
    0);
    lOracleCallableStatement.setARRAY(1, lTableArray);
    lOracleCallableStatement.setString(2,
    (String)ADFUtil.evaluateEL("#{sessionScope['UserName']}"));
    lOracleCallableStatement.executeUpdate();
    }

    That was helpful and now I can execute up to my last line of code: "lOracleCallableStatement.executeUpdate();"
    This code executes the SP.
    My SP is as follows:
    create or replace
    PROCEDURE          SP_TEST
    *( param1 IN TYP_TEST_TB,*
    param2 IN VARCHAR2) as
    CURSOR for_insert_csr IS
    SELECT *
    FROM TABLE(param1) T1;
    temp_update TYP_TEST_R;
    BEGIN
    FOR temp_update IN for_insert_csr
    LOOP
    -- do stuff in this loop
    END LOOP;
    end;
    When trying to execute the SP, I get the following error:
    +<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5+
    javax.el.ELException: oracle.jbo.JboException: java.sql.SQLException: ORA-06550: line 1, column 7:*
    PLS-00201: identifier DBADMIN.SP_TEST must be declared*
    ORA-06550: line 1, column 7:*
    PL/SQL: Statement ignored*
    at com.sun.el.parser.AstValue.invoke(Unknown Source)*
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)*
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1300)*
    at oracle.adf.view.rich.component.UIXDialog.broadcast(UIXDialog.java:97)*
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)*
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)*
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)*
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)*
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)*
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)*
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)*
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)*
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)*
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)*
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)*
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)*
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)*
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)*
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)*
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)*
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)*
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)*
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)*
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)*
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)*
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)*
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)*
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)*
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)*
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)*
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)*
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)*
    at java.security.AccessController.doPrivileged(Native Method)*
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)*
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)*
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)*
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)*
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)*
    Do you have any suggestions on what I might want to try?

  • Error when use stored procedure in Named Query and Custom SQL

    This is a toplink development on Jdev 1013. A package with a function is created which returns a "ref cursor" in a oracle 9i database. I tried to access the function in jdev toplink descriptor editor either through custom sql (Readall) or a named query (procedureTest) and I got java.sql.SQLException: SQL string is not Query. Note: I am NOT talking about programatic storedprocedurecall object.
    The client access code is following (where error was thrown):
    results = (Collection) session.executeQuery("procedureTest", WuTest.class);

    Any responses? Thanks.

  • Got error when create new category

    Hello,
    when I wanted to create a category problematically, I saw this error:
    atg.repository.RepositoryException: createItem called with id of valid item: category:6552:1
         at atg.adapter.gsa.GSARepository.findItemToUndelete(GSARepository.java:871)
         at atg.adapter.gsa.GSARepository.createItem(GSARepository.java:810)
         at atg.adapter.version.VersionRepository.createItem(VersionRepository.java:1972)
         at atg.adapter.version.VersionRepository.createItem(VersionRepository.java:1201)
    Can anyone give me some hint about what it means?
    Thanks ahead!
    ~Russell

    Looks like an issue related to IdGenerator which sometimes might happen when you try to create items after some data import. You can check the DAS_ID_GENERATOR table in your CA schema and look for the row corresponding to "category" (the id_space_name column would be having item-descriptor names) and for that row you can try to update the seed value to a higher value or try to add a prefix or suffix on it. Restart your server after the changes. See if it helps.

  • Creating Stored Procedure in Java

    Hi All,
    I would like to ask how to create a stored procedure in Java.
    My project now is to create a program that will open a DB2 SQL File (Creating Table and Stored Procedure) and then Execute it.
    Executing the CREATE TABLE command is not that difficult since I can break the execution down by statement (divide by ";" in the SQL file).
    The logic I applied here are:
    1. Open the SQL file and store the contents into a String object.
    2. Call the executeUpdate(string_sql_fileContent) method of Statement Object.
    Example: SQL File contect to be executed.
    ===========================================================
    CREATE TABLE MDMTEST.sample
    (firstname CHARACTER(40),
    middlename CHARACTER(40),
    lastname CHARACTER(40),
    idNo SMALLINT NOT NULL
    DATA CAPTURE NONE;
    #SYNC 10;
    ALTER TABLE MDMTEST.sample
    LOCKSIZE ROW
    APPEND OFF
    NOT VOLATILE;
    #SYNC 20;
    ALTER TABLE MDMTEST.sample
    ADD PRIMARY KEY
    (idNo
    #SYNC 30;
    RUNSTATS ON TABLE MDMTEST.sample
    AND INDEXES ALL
    SHRLEVEL REFERENCE;
    ===========================================================
    I can divide this by ";" and execute them by statement.
    But my problem is when creating Stored Procedure... Since in stored procedure there are so many stub-statements...
    Example: Content of SQL File for creating stored procedure.
    ===========================================================
    CREATE PROCEDURE MDMTEST.DROP_ALL_OBJECTS ( )
    SPECIFIC MDMTEST.SQL051109115453000
    LANGUAGE SQL
    NOT DETERMINISTIC
    CALLED ON NULL INPUT
    MODIFIES SQL DATA
    INHERIT SPECIAL REGISTERS
    BEGIN
         Delete Statement;
         Insert Statement;
         Update Statement;
    END;
    ===========================================================
    Take note there are three statements inside the CREATE..BEGIN.. and END.. (namely Delete, Insert, and Update Statements).
    How can I execute the command for creating the procedure in Java? I believe that creating stored procedures in other databases are almost the same...
    So... anyboby who have tried creating stored procedure in Java?
    Please help me in this... I wanna pass the subject hehe..

    I have used these files as a sample:
    Java Program:
    import java.io.*;
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import my.db.components.*;
    public class ProcedureUploader {
         private MyDBConnection dbConn=new MyDBConnection();
         private Statement statement;
    public ProcedureUploader() {
         try{
              dbConn.connectDB ("206.206.206.206","12345","DEV","mdmtest","mdmtest");     
              this.statement=dbConn.getStatement ();               
         }catch(SQLException sqle){
              sqle.printStackTrace();
         public String getContents(String fileName) throws IOException{
              File inputFile = new File(fileName);
    FileReader in = new FileReader(inputFile);
    int c; String contents="";
    while ((c = in.read()) != -1) contents+=(char) c;
    in.close();
    return contents;
    public void executeSQLCommand(String file) throws IOException{         
         String command="";
         try{
              command=getContents(file);          
                   statement.executeUpdate(command);
              System.out.println("Command Execution Successful.");     
         }catch(Exception ex){
              System.out.println("There is a problem executing the command. Please check the SQL file and re-execute again.");
              ex.printStackTrace();
    public static void main(String args[]) throws IOException{
         ProcedureUploader uploader=new ProcedureUploader();
         uploader.executeSQLCommand("C:\\I2\\Development\\ProcedureUploader\\sample.sql");
    SQL File:
    CREATE PROCEDURE MDMTEST.sampleProc ( )
    SPECIFIC MDMTEST.sampleProc
    LANGUAGE SQL
    NOT DETERMINISTIC
    CALLED ON NULL INPUT
    MODIFIES SQL DATA
    INHERIT SPECIAL REGISTERS
    delete from SAMPLE;
    commit;
    select * from SAMPLE;;
    #SYNC 10;
    ===========================================================
    The problem is that ... there will be an error:
    ===========================================================
    There is a problem executing the command. Please check the SQL file and re-execute again.
    com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: delete from SAMPLE;;PECIAL REGISTERS
    ;<psm_repeat>
    at com.ibm.db2.jcc.c.fg.e(fg.java:1596)
    at com.ibm.db2.jcc.c.fg.b(fg.java:1160)
    at com.ibm.db2.jcc.b.gb.h(gb.java:217)
    at com.ibm.db2.jcc.b.gb.b(gb.java:46)
    at com.ibm.db2.jcc.b.w.b(w.java:40)
    at com.ibm.db2.jcc.b.vb.f(vb.java:118)
    at com.ibm.db2.jcc.c.fg.m(fg.java:1155)
    at com.ibm.db2.jcc.c.fg.a(fg.java:1865)
    at com.ibm.db2.jcc.c.fg.c(fg.java:517)
    at com.ibm.db2.jcc.c.fg.executeUpdate(fg.java:501)
    at ProcedureUploader.executeSQLCommand(ProcedureUploader.java:44)
    at ProcedureUploader.main(ProcedureUploader.java:54)
    ===========================================================
    But still the procedure will be created but until the first ";" only... OR.. creates a stored procedure having the following lines only.
    ===========================================================
    CREATE PROCEDURE MDMTEST.sampleProc ( )
    SPECIFIC MDMTEST.sampleProc
    LANGUAGE SQL
    NOT DETERMINISTIC
    CALLED ON NULL INPUT
    MODIFIES SQL DATA
    INHERIT SPECIAL REGISTERS
    delete from SAMPLE;
    ===========================================================

  • How to create stored procedures automatically when creating new company

    I need to create a method in our add-on Business One application that will create stored procedures at the time we install the add-on (when the new company is created).  Where would I store the SQL scripts, and what SAP Business One commands do I need to use to build the stored procedures into the new company database? Can someone give me an example of how to do this?  We are coding in C#, but an example in visual basic would also be helpful if no one out there in forum land uses C#   
    Thanks,
    Nancy Walk
    [email protected]

    Hi Nancy!
    Of course are there people here that use C#
    To solve your problem, create a routine in your add-on that checks at startup if the stored procedures are present. If they are not, create them. You can use the DI-API, or just add them directly to your database.
    <i>Note: SAP does not like it when you play around directly in the SAP databases, and does not supply support for databases that are changed manually. You'd better use the DI-API...</i>
    Hope it helps...
    Grtz, Rowdy

  • How can I create stored procedure?

    I am new in this field, I was reading in this web site on how to create stored procedure,and this is what I did :
    SQL> CREATE PROCEDURE test.proc1 (n IN NUMBER)
    2 AS BEGIN
    3 select * from districts
    4 where doe = n;
    5 END;
    6
    Please direct me. I don't know if I am wrong or right, test is the name of the database, and proc1 is the stored procedure that I want to create, why when I hit Enter after END; I got the number 6.
    How can I call this stored procedure, if it works.
    Thanks in advance
    null

    Some reading and training might prove useful. Even if you are using Linux, this forum is no place for a question like that.

  • How can i create stored procedures dynamically?

    I have tried to create a stored procedure building a string with the PL/SQL code needed to create the procedure. If i run the code using SQL+ works fine, but using the following code:
    Public Sub CreateStoredProcedure()
    Dim strSql As String
    strSql = "CREATE OR REPLACE PACKAGE OPSPRUEBAS AS " & vbCrLf
    strSql = strSql & vbTab & "PROCEDURE consulta (resultado OUT VARCHAR2); " & vbCrLf
    strSql = strSql & "END OPSPRUEBAS; " & vbCrLf
    strSql = strSql & "/ " & vbCrLf
    strSql = strSql & ". " & vbCrLf
    strSql = strSql & "CREATE OR REPLACE PACKAGE BODY OPSPRUEBAS AS " & vbCrLf
    strSql = strSql & "PROCEDURE consulta (resultado OUT VARCHAR2) IS " & vbCrLf
    strSql = strSql & "oc_ref" & vbTab & vbTab & "REF Content_Ontology; " & vbCrLf
    strSql = strSql & "oc" & vbTab & vbTab & "Content_Ontology; " & vbCrLf
    strSql = strSql & "ori" & vbTab & vbTab & "role_def; " & vbCrLf
    strSql = strSql & "ori_ref" & vbTab & vbTab & "ref role_def; " & vbCrLf
    strSql = strSql & "conce" & vbTab & vbTab & "concept; " & vbCrLf
    strSql = strSql & "conce_ref" & vbTab & "REF concept; " & vbCrLf
    strSql = strSql & "b" & vbTab & vbTab & "boolean; " & vbCrLf
    strSql = strSql & "BEGIN " & vbCrLf
    strSql = strSql & "b:=false; " & vbCrLf
    strSql = strSql & "select REF(oi) into ori_ref from rol_table oi where oi.name='Playing'; " & vbCrLf
    strSql = strSql & "select deref(ori_ref) into ori from dual; " & vbCrLf
    strSql = strSql & "select REF(oi) into oc_ref from c_ontologies oi where oi.web_source_prop=websource('FilmContentOntology'); " & vbCrLf
    strSql = strSql & "select deref(oc_ref) into oc from dual; " & vbCrLf
    strSql = strSql & "if oc.if_has_co_class('Film')='TRUE' AND " & vbCrLf
    strSql = strSql & "oc.if_has_co_class('theater')='TRUE' AND " & vbCrLf
    strSql = strSql & "oc.if_has_co_relationship('is_scheduled')='TRUE' AND " & vbCrLf
    strSql = strSql & "oc.if_has_co_attributes('Film', lista('is_scheduled', 'title', 'actor'))='TRUE' AND " & vbCrLf
    strSql = strSql & "oc.if_has_co_attributes('theater', lista('theatername', 'address', 'email'))='TRUE' " & vbCrLf
    strSql = strSql & "then resultado:='FilmContentOntology'; " & vbCrLf
    strSql = strSql & "else resultado:='No Existe'; " & vbCrLf
    strSql = strSql & "end if; " & vbCrLf
    strSql = strSql & "END consulta; " & vbCrLf
    strSql = strSql & "END OPSPRUEBAS; " & vbCrLf
    strSql = strSql & "/ " & vbCrLf
    strSql = strSql & ". " & vbCrLf
    strSql = strSql & "COMMIT;" & vbCrLf
    TextBox2.Text = strSql
    'Dim myConnectionString As String = "User Id=system;Password=daniel;Data Source=websogo;"
    'Dim oraConn As Oracle.DataAccess.Client.OracleConnection = New Oracle.DataAccess.Client.OracleConnection(myConnectionString)
    Dim myCmd As New System.Data.OleDb.OleDbCommand()
    Dim MyConnection As New System.Data.OleDb.OleDbConnection()
    MyConnection.ConnectionString = "Provider=MSDAORA;Data Source=websogo;password=daniel;User ID=system"
    MyConnection.Open()
    'oraConn.Open()
    myCmd.Connection = MyConnection
    myCmd.CommandType = CommandType.Text
    myCmd.CommandText = strSql
    myCmd.ExecuteNonQuery()
    'Dim e As Oracle.DataAccess.Client.OracleException
    'Try
    ' myCmd.ExecuteNonQuery()
    'Catch e
    ' Dim error1 As Oracle.DataAccess.Client.OracleError
    ' error1 = e.Errors.Item(0)
    ' Textbox3.Text = error1.Source & " " & error1.Message
    'End Try
    MyConnection.Close()
    End Sub
    I've tried using Microsoft ODP, OLEDB and Oracle's ODP.NET
    Also tried to catch any error but there are no errors!
    Has anybody achived a successful dynamically stored procedure creation using .net?
    thanks in advance
    Dan

    I'm trying to create Stored Procedures via .NET and able to do so but when I look in Oracle Enterprise Manager Console, the Stored Procedures are marked as INVALID... If I edit the Stored Procedure (i.e. delete a space or something minor) and SAVE then it compiles fine.....
    Any ideas ????
    will be using this against 9i & 10g db

  • Creating Stored Procedures

    I'd like to learn how to create stored procedures in Oracle 10g. I'm proficient at this with MS SQL but I can't get to first base with Oracle.
    I am not using SQL *Plus and really I don't want to use it. I'd rather use a DB access program like Aqua Data Studio. When I attempt to create a procedure I get a "Compiled with errors" message. I don't know how to see the errors because I can't do a "Show Errors" message.
    Is there a way to create stored procedures using standard SQL and staying away from SQL *Plus?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    The two best free tools I know of are:
    http://sourceforge.net/projects/tora/
    and
    http://www.oracle.com/technology/products/database/sql_developer/
    TOra is more a database system tool, and SQL Developer is more of a development tool, but see if either of those will be to your liking ;)
    ~Jer

Maybe you are looking for

  • Is there a way to change the Render Settings to be same as Source?

    My footage is all in the codec I want to deliver in. In this case, XDCAM HD MOV files. I want everything to render to this codec so that I'm not wasting render cycles transcoding to ProRes just to then have to render the whole thing when I output it

  • SRM Shopping Cart Approval on mobile

    Hi, We have a requirement to enable approval of shopping carts from the mobile inbox of approver. The workflow under consideration is the Item-Based Approval Process (WS145000015). The workflow works perfectly well within SRM portal for single as wel

  • Is 9.0.2 patch available as a download somewhere for 9.0.1.1?

    I am currently having a known issue with the SYS_CONNECT_BY_PATH statement in a package definition. I was told it is fixed in 9.0.2....but I can't find anywhere to download that patch? Thanks, Bryan

  • Incoterms  report

    Dear All, for which t-code  i see  incoterms  for mass PO ? Example: PO  Number    Payment term                      incoterm 300604         PT05                        Our Works,Baddi 330417        PT08                            Our Works, Delhi Re

  • Click and show in any order

    Senario Captivate 5 I have 4 faces on the left of my slide and 4 hidden text boxes of information next to them. The learner clicks the face to show the information. If the learner clicks out of sequence they cannot then go back and click previous fac