Insert data from source table to destination table dependning up on a criteria.once inserted delete from source table.

HI,
I have a source table with millions of records .I need to insert some of the data (depending on a condition) to a repository table.
Once they are inserted they can be deleted from the source table.
The deletion is taking a lot of time .
I need to reduce the time to delete the records.
ex:-  1 million records in 8 seconds.
Had already used bulk collect and cursors but cannot succeed.
Please suggest how to increase the performance.
Thanks & Regards

APPROACH 1:-
CREATE OR REPLACE PROCEDURE SP_BC
AS
DETAILS_REC SOURCETBL%ROWTYPE;
COUNTER NUMBER:=1;
RCOUNT NUMBER:= 1;
START_TIME PLS_INTEGER;
END_TIME PLS_INTEGER;
CURSOR C1 IS
SELECT * FROM SOURCETBL WHERE DOJ<SYDATE;
BEGIN
START_TIME := DBMS_UTILITY.GET_TIME;
    DBMS_OUTPUT.PUT_LINE(START_TIME/100);
    OPEN C1;
    LOOP
    FETCH C1 INTO DETAILS_ROW;
    EXIT WHEN  C1%NOTFOUND;
           BEGIN
            EXIT WHEN COUNTER >10000;
            INSERT INTO DESTINATIONTBL VALUES DETAILS_REC;
            IF SQL%FOUND THEN
                DELETE FROM SOURCETABLE WHERE ID= DETAILS_REC.ID;
              COUNTER:=COUNTER+1;
        END IF; 
    COMMIT;
        END;
     COUNTER:=1;
    END LOOP;
    COMMIT;
END;
APPROACH 2:-
    CREATE OR REPLACE PROCEDURE SP_BC1
IS
TYPE T_DET IS TABLE OF SOURCETBL%ROWTYPE;
T_REC T_DET;
BEGIN   
    SELECT *  BULK COLLECT INTO T_REC FROM SOURCETBL
     WHERE NAME=@NAME;
    FOR I IN  T_REC .FIRST ..T_REC .LAST
       LOOP
         INSERT INTO DESTINATIONTBL VALUES T_REC (I);
      IF SQL%FOUND THEN
      DELETE FROM SOURCETBL WHERE ID =
       WHERE ID = T_REC (I).ID;  
       END IF; 
       EXIT WHEN T_REC=0;
    END LOOP;
    COMMIT;
END;
APPROACH 3:-
CREATE OR REPLACE PROCEDURE SP_BC2
AS
TYPE REC_TYPE IS TABLE OF SOURCETBL%ROWTYPE ;
DETAILS_ROW REC_TYPE;
CURSOR C1 IS
SELECT * FROM
     SOURCETBL WHERE END<SYSDATE;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 BULK COLLECT INTO DETAILS_ROW LIMIT 999;
    FORALL I IN 1..DETAILS_ROW.COUNT
              /* A BATCH OF 999 RECORDS WILL BE CONSIDERED FOR DATA MOVEMENT*/
INSERT INTO DESTINATIONTBL VALUES DETAILS_ROW(I);
--            IF SQL%FOUND  THEN
--                DELETE from SOURCETBL WHERE ID IN DETAILS_ROW(I).ID;
--           END IF;
        EXIT WHEN  C1%NOTFOUND; 
    COMMIT;   
    END LOOP;
    COMMIT;
3rd approach seems better but i have an issue with referring the fileds of a record type.

Similar Messages

  • Can we copy back songs from iPhone to iTunes library, once if deleted from iTunes library ?

    can we copy back songs from iPhone to iTunes library, once if deleted from iTunes library ?

    Have you not got a backup of your content ? iTunes will only copy back purchases that you made from Apple. For music from other sources you will need to find a program from another source which can copy them back from the phone - if you do a search on google you might find some. Or depending from where you got them from can you re-download them from those sites ?

  • A Table that was created at Run time. A Row Properly Deleted from Table Is Still Present on Form with BindingNavigator

    Hello
    I have a dataset that was created at design time
    but - after I run the app, it randomly creates a table based on The Users name
    since I do not know the users name before had, the table is not part of my existing dataset
    (I actually used an insert into sql nonquery to just make this table a copy of the masterUserTable)
    Now - I have a binding navigator on my form, that is originally bound to masterUserTable, but my goal is to make it bound to the users table (let's say GabrielUserTable)
    I thought I did so with this code: 
            'TODO: This line of code loads data into the 'MyLearningDBDataSet.masterUserTable' table. You can move, or remove it, as needed.
            Me.MyMainDBTableAdapter.Fill(Me.MyLearningDBDataSet.masterUserTable)
            Dim ThisNewVariable As String = MyUserNameIs & "UserTable"
            Dim ThisNewTableName As New DataTable
            Me.MyLearningDBDataSet.masterUserTable.TableName = ThisNewVariable
            Me.MyMainDBTableAdapter.Fill(Me.MyLearningDBDataSet.masterUserTable)
    that appeared to do the trick  (but if it is incorrect please advice on the proper way to add a table made at runtime to a users existing datset)
    Else where in my code  I successfully execute the following NonQuery :
            SqlString= "DELETE FROM " & MyUserNameIs & "UserTable" & vbCrLf &
                "WHERE vState='" & txtStateInfo.Text & "';"
    I check in Visual Studio 2013 that the row was deleted from the "GabrielUserTable"  (Gabriel is the current value of MyUserNameIs) by using the Server Explorer and right clicking
    on the table and choosing show talbe data
    But the MyMainDBBindingNavigator is still showing the item I deleted.
    So after searching for answers - I created a new button for testing and added the following code to test if it would work
            Me.Validate()
            Me.MyMainDBBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.MyLearningDBDataSet)
    but the data is still shwoing after deleting it with my NonQuery 
    Please Help!

    Hi genterprise,
    >> Now - I have a binding navigator on my form, that is originally bound to masterUserTable, but my goal is to make it bound to the users table (let's say GabrielUserTable)
    In my option, if you want to rebind the users table to the navigator, you need to set the BindingNavigator.BindingSource. Based on your description, it seems that you did not reset the datasoure of the MyMainDBBindingNavigator. It was the original datasource
    of the masterUserTable. For more details about BindingNavigator.BindingSource Property. You could refer the link below:
    # BindingNavigator.BindingSource Property
    https://msdn.microsoft.com/en-us/library/system.windows.forms.bindingnavigator.bindingsource%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • How to Locate Original Files in Aperture Once Version Deleted from Library

    I have a very large aperture library (250GB). For a long time, I have maintained my library by deleting only the "versions" of photos that I do not like (File-Delete Version), not realizing that the originals were still there. I would like to also delete the originals (master), since they are large RAW files taking up a lot of space. But with the versions now gone from my library, I do not know how to locate the original files to delete. Is there any way for me to do this?
    I feel like there should be a way to find out if there are any original files not associated with a corresponding version in the library, to allow you to recover accidently deleted files.  That would be a start, but I can't find a way to do it. Thanks.

    Also, I visited the Apple store recently and was told that deleting the version does not delete the master, and they even showed me on their computers where files deleted from the library were stored (they did this by "File-Open Library in iPhoto," highlighting all the images, and then "File-Reveal in Finder-Original File."
    For a managed library: "Delete version" will only delete the selected version, if there is more than one version of the the same image. But if you only have one version left, delete version will delete the original file as well. An original is of no use, if you do not have a version to reference it.  The " File-Delete Original Image and All Versions" option is there to be able to delete all versions at once, together with the original file.
    For a referenced library you will be prompted, if you want to delete the referenced original, if you are deleting the last version.
    Just try it for a managed library. Import an image and use "Delete version" for the last version.  The version will be moved to Aperture's Trash. And if you empty the trash, you will find the original version in the Trash in your Dock. And it cannot be put back from the Trash.
    You will be prompted, if you really want to delete the file, when you empty Aperture's Trash.
    The App Store genius must have shown you a referenced library, when the original was not removed after deleting the version, or they did not delete the last version, if it was a managed library.

  • Very important question need immediate answer please very serious, is there any way possible i can get recent text messages from the last 2 days and print them off after they have been deleted from my phone?

    is there anyway i can retrieve recent text messages from the last 2 days and have them printed off after they have been deleted from my phone?  this is seriously important i need this for an attourney!

    click here:
    Re: Can I request to get the content of old text messages

  • I created an Imovie on Ipad. Before exporting the Imovie, I deleted the video clips from camera roll. Error message "this proj. contains clips which have been deleted from your photo library." Help!  Can I recover the "preview" file of my video in Imovie?

    Is there an app out there to find the files within Imovie app on my Ipad where the Imovie "preview" is playing from?
    I deleted the original vidoe clips from my Camera Roll before exporting the Imovie to Youtube because my camera roll was out of memory.
    I'm using the latest Imovie app for Ipad.
    Cheers
    shoestringlady

    iPad Photo Recovery: How to Recover Deleted Photos
    http://www.iskysoft.com/iphone-data-recovery-mac/ipad-photo-recovery.html
    How to Restore Lost or Deleted Files from iPad
    http://www.iphone-ipad-recovery.com/recover-ipad-mini-files.html
    How to Recover Deleted Files from iPad
    http://www.kvisoft.com/tutorials/recover-deleted-files-from-ipad.html
    iSkysoft Free iPhone Data Recovery
    http://www.iskysoft.com/iphone-data-recovery/
    Recover iPhone/iPad/iPod touch lost data, Free.
    Free recover iPhone/iPad/iPod touch lost contacts, photos, videos, notes, call logs and more
    Recover data directly from iPhone or from iTunes backup
    Preview and recover lost iOS data with original quality
    Wondershare Dr.Fone for iOS
    http://www.wondershare.net/data-recovery/iphone-data-recovery.html?gclid=CJT7i9e 6gb4CFcvm7AodbUEAJQ
    Recover contacts, messages, photos, videos, notes, call history, calendars, voicemail, voice memos, reminders, bookmarks and other documents.
     Cheers, Tom

  • How can I transfer voice memos from my iPhone 4 without syncing and having all music/video/audiobook content deleted from my phone?

    I would like to be able to transfer several very long voice memos from my iPhone 4 to my PC.  They are too long to email to myself. I manage music manually, so the phone doesn't sync automatically.  I have also not checked off "include voice memos" in my music sync preferences because of a warning that pops up which suggests that I will lose all the music, video & audiobook content on my phone and that it will be replaced with all iTunes content. (Several of the audiobooks on my phone were transferred in directly from my library system's audiobook service & I will lose them permanently if they are wiped off the phone.) Is there a way around this? I am able to transfer photographs directly to my computer because my PC recognizes the iPhone as an external disk and I was able to locate the photo folder, but I have no idea of where to look for the voice memo folder in order to transfer them in the same manner.  Any suggestions would be appreciated!

    See:
    13019 error
    iTunes: Error 13019 during sync

  • I have experienced great difficulty deleting photos from iPad I have followed advice and synced with computer and iTunes and deleted from computer and then synced again but managed to get hundreds more unwanted photos.

    I have had great difficulty deleting photos from iPad I have followed advice and connected to computer and iTunes but cannot find anywhere to click on delete I also deleted photos fro computer and synced again and then found hundreds of more photos on iPad which were unwanted at the same time I lost a film I had purchased from iTunes and   The soundtrack of film from iPod

    Photos that were synced from your computer you should be able to delete by movin/removing them from where they were synced from and then re-syncing (or de-selecting the whole folder if you want to remove the entire album from the iPad).
    Photos taken with the iPad, copied onto it via the camera connection kit, or saved from emails/websites etc can be deleted directly on the iPad - either via the trashcan icon in the top right corner if viewing the photo in full screen, or via the icon of the box with the arrow coming out of it in thumbnail view. They should also appear in Windows Explorer on PC where you can delete them, and in iPhoto on a Mac you can delete them after importing.

  • Does The Create Table Privilege allow to insert data ?

    Hi,
    I wish to know if it's possible that a user UserA allows another user UserB to create a table but does not allow him (does not allow UserB ) to insert data in a table UserB has created .If it's possible, I would want to know the commands to do that.
    Thanks .

    sys@LINUX>create user user1 identified by user1;
    User created.
    sys@LINUX>grant connect, resource to user1;
    Grant succeeded.
    sys@LINUX>create user user2 identified by user2;
    User created.
    sys@LINUX>grant connect, resource to user2;
    Grant succeeded.
    sys@LINUX>conn user1/user1
    Connected.
    user1@LINUX>create table t (id number);
    Table created.
    user1@LINUX>disc
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production
    With the Partitioning, OLAP and Data Mining options
    user1@LINUX>conn / as sysdba
    Connected.
    sys@LINUX>grant create any table to user2;
    Grant succeeded.
    sys@LINUX>conn user2/user2
    Connected.
    user2@LINUX>create table user1.tab (id number);
    Table created.
    user2@LINUX>insert into user1.tab values(1);
    insert into user1.tab values(1)
    ERROR at line 1:
    ORA-01031: insufficient privileges
    user2@LINUX>select * from user1.tab;
    select * from user1.tab
    ERROR at line 1:
    ORA-01031: insufficient privileges
    user2@LINUX>delete from user1.tab;
    delete from user1.tab
    ERROR at line 1:
    ORA-01031: insufficient privileges
    user2@LINUX>update user1.tab set id=1;
    update user1.tab set id=1
    ERROR at line 1:
    ORA-01031: insufficient privilegesInteresting issue. Although user2 was able to create a table in user1 schema (because he has "create any table" privilege), he's NOT able to run ANY DML on that table (NO insert, update, delete and select)!
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Urgent!!!!!  Inserting data in table control of infotype.

    Hi Experts,
    I want to insert data in custom infotype.I am using FM HR_INFOTYPE_OPERATION for this purpose.But custom infotype contains a table control.
    Table control of infotype has 20 rows containing  fields name01 , addr01 upto name20 , addr20.
    How do i insert data in table control fields of infotype if i want to use FM HR_INFOTYPE_OPERATION .
    Pls suggest if there is another way to do it.
    Thanks.

    Thanks for your reply.
    I am Calling FM HR_INFOTYPE_OPERATION in a loop of a table.
    Table contains multiple employee numbers-PERNR.There can be all different PERNR or some records of same PERNR.
    Suppose if there are four records in the table.First two records are of the same PERNR.Then how would name01 or name02 will be assigned.
    Now, third record is  of new PERNR .Again it should be name01.
    So the question is how everytime in a loop i will assign nameNN for different PERNR.
    nameNN and addrNN was an example. I am sending my code here.
    Loop at it_data.
    gs_9000-PERNR = it_data-pernr..
    gs_9000-currentamount03 = it_data-curramt.
    gs_9000-mtdamount03 = it_data-mtd.
    gs_9000-qtdamount03 = it_data-qtd.
    gs_9000-ytdamount03 = it_data-ytd.
    gs_9000-roll12amount03 = it_data-roll.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = gs_9000-pernr
    IMPORTING
    RETURN = RETURNE.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '9000'
    NUMBER = gs_9000-PERNR
    VALIDITYBEGIN = '20080801' 
    RECORD = gs_9000
    OPERATION = 'INS'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    IMPORTING
    RETURN = RETURN
    KEY = KEY.
    IF RETURN IS NOT INITIAL.
    WRITE :/ 'Error Occurred'.
    ENDIF.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = gs_9000-PERNR
    endloop.
    So in above code...
    gs_9000-currentamount03 = it_data-curramt.
    gs_9000-mtdamount03 = it_data-mtd.
    gs_9000-qtdamount03 = it_data-qtd.
    gs_9000-ytdamount03 = it_data-ytd.
    gs_9000-roll12amount03 = it_data-roll.
    these are table control fields , so how i wud i assign for
    gs_9000-currentamount04 = it_data-curramt.
    gs_9000-mtdamount04 = it_data-mtd.
    gs_9000-qtdamount04 = it_data-qtd.
    gs_9000-ytdamount04 = it_data-ytd.
    gs_9000-roll12amount04 = it_data-roll.
    in loop of a table.
    Thanks

  • Why its showing error : Invalid Object Name 'table name' when we try to insert data ?

    Hi,
        When i try to insert data in the database with the following query
                    con.Open();
                    cmd = new SqlCommand("insert into good(ID,Name) values('" + textBox1.Text + "','" + textBox2.Text + "')", con);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Insert success");
                    con.Close();
        its showing following error Invalid Object Name 'good'

    Use 3-part naming like: MyDatabase.dbo.good(ID,Name) .
    Also consider using stored procedure for database INSERTs.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Some Objects owned by SYS became invalid due wrong deletion from OBJ$ table

    Hi,
    While cleaning up streams from source database,we have found some rules and stream queue name was still present, so we tried to delete those records from obj$ table, but by mistake we have deleted all records from obj$ table related to streams.Actually we executed the following sql statement:
    DELETE FROM OBJ$ WHERE NAME LIKE '%STREAM%';COMMIT;
    For this fault some problem arrise.After this we have found lots of SYS owner objects (VIEW,PACKAGE,TYPE) are become invalid.This situation happened in a remote database.For this remote database there is missing a TYPE "AQ$_JMS_STREAM_MESSAGE".
    We have created a dummy database in local and executed the same delete statement, and after this We have executed (after shutdown immediate & startup migrate)catpatch.sql & (after shutdown immediate & startup) utlrp.sql but still there are some objects exists invalid.
    e.g. one object is "_DBA_APPLY_ERROR" which is invalid.While I have tried to open the table "APPLY$_ERROR" for this view it showing an error message "ORA-00600: internal error code, arguments: [kkdlusr1], [30813], [], [], [], [], [], []"
    We are using ORACLE 9.2.0.5 and Windows XP for our work.
    Now please tell me what is it`s remedy.
    Thanks in advance.

    I had exec utlirp.sql..
    Well you were asked to run utlrp.sql. I can't speak about the time that it will take to get complete. For the invalid objects, there are two ways to make them valid,one run utlrp.sql and see how many become valid and the other ( painful one) is to manually look for the errors in their compilation and sort it out.
    Aman....

  • Deleting from multiple tables

    I have a master table and a detail table. I need to delete a set of records from both the master and detail tables based on a criteria. Now if I delete from one table then I will not know which records I have to delete from the other table. So the records needs to be deleted from both the tables using the criteria. My SQL statement to select the records is
    <<
    select *
    FROM TL_RATE A, TL_RATE_DETAIL B
    WHERE A.CARRIER_ID = B.CARRIER_ID
    AND A.TARIFF_CLASS_ID = B.TARIFF_CLASS_ID
    AND A.LANE_ID = B.LANE_ID
    AND A.SERVICE_COM_ID = B.SERVICE_COM_ID
    AND A.EFFECTIVE = B.EFFECTIVE
    AND DATE_INVALID < SYSDATE-365;
    >>
    Thanks

    You don't show what table DATE_INVALID is in. However, you should just delete the matching rows from the OTHER table first then that table. This is very slightly different from the rows returned by your query since your query is an inner join. In other words, you're excluding rows that might exist in one table but not the other. Assuming DATE_INVALID is in TL_RATE ...
    delete tl_rate_detail
    where (CARRIER_ID, TARIFF_CLASS_ID, LANE_ID, SERVICE_COM_ID, EFFECTIVE) in (
      select CARRIER_ID, TARIFF_CLASS_ID, LANE_ID, SERVICE_COM_ID, EFFECTIVE
      from tl_rate
      where date_invalid < sysdate - 365)
    delete tl_rate
    where date_invalid < sysdate - 365
    /Richard

  • Once a row is deleted from a table ,how can i recover it back in the table?

    Hi
    I have made a delete program in Jdev. I had deleted some of the rows from table such that count goes 2 from 10.
    Now I want to use this table again for some other program,how should i restore the deleted rows so that i can use the table properly.
    However toad tool showing that no row is deleted from the table.
    Thanks & Regards

    Can you please elaborate how are you deleting rows from table.

  • Restful service unable to insert data using PL/SQL.

    Hi all,
    Am running: AL 2.01 standalone mode on OEL 4.8 in VM box A.
    Oracle database 10.2.0.4 with Apex 4.2.0.00.27 on OEL4.8 in VM box B.
    Able to performed oracle.example.hr Restful services with no problem.
    Unable to insert data using AL 2.0.1 but works on AL 1.1.4.
    which uses the following table (under schema: scott):
    create table json_demo ( title varchar2(20), description varchar2(1000) );
    grant all on json_demo to apex_public_user; and below procedure ( scott's schema ):
    CREATE OR REPLACE
    PROCEDURE post(
        p_url     IN VARCHAR2,
        p_message IN VARCHAR2,
        p_response OUT VARCHAR2)
    IS
      l_end_loop BOOLEAN := false;
      l_http_req utl_http.req;
      l_http_resp utl_http.resp;
      l_buffer CLOB;
      l_data       VARCHAR2(20000); 
      C_USER_AGENT CONSTANT VARCHAR2(4000) := 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
    BEGIN
      -- source: http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
      -- Ask UTL_HTTP not to raise an exception for 4xx and 5xx status codes,
      -- rather than just returning the text of the error page.
      utl_http.set_response_error_check(false);
      -- Begin the post request
      l_http_req := utl_http.begin_request (p_url, 'POST', utl_http.HTTP_VERSION_1_1);
      -- Set the HTTP request headers
      utl_http.set_header(l_http_req, 'User-Agent', C_USER_AGENT);
      utl_http.set_header(l_http_req, 'content-type', 'application/json;charset=UTF-8');
      utl_http.set_header(l_http_req, 'content-length', LENGTH(p_message));
      -- Write the data to the body of the HTTP request
      utl_http.write_text(l_http_req, p_message);
      -- Process the request and get the response.
      l_http_resp := utl_http.get_response (l_http_req);
      dbms_output.put_line ('status code: ' || l_http_resp.status_code);
      dbms_output.put_line ('reason phrase: ' || l_http_resp.reason_phrase);
      LOOP
        EXIT
      WHEN l_end_loop;
        BEGIN
          utl_http.read_line(l_http_resp, l_buffer, true);
          IF(l_buffer IS NOT NULL AND (LENGTH(l_buffer)>0)) THEN
            l_data    := l_data||l_buffer;
          END IF;
        EXCEPTION
        WHEN utl_http.end_of_body THEN
          l_end_loop := true;
        END;
      END LOOP;
      dbms_output.put_line(l_data);
      p_response:= l_data;
      -- Look for client-side error and report it.
      IF (l_http_resp.status_code >= 400) AND (l_http_resp.status_code <= 499) THEN
        dbms_output.put_line('Check the URL.');
        utl_http.end_response(l_http_resp);
        -- Look for server-side error and report it.
      elsif (l_http_resp.status_code >= 500) AND (l_http_resp.status_code <= 599) THEN
        dbms_output.put_line('Check if the Web site is up.');
        utl_http.end_response(l_http_resp);
        RETURN;
      END IF;
      utl_http.end_response (l_http_resp);
    EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line (sqlerrm);
      raise;
    END; and executing in sqldeveloper 3.2.20.09 when connecting directly to box B as scott:
    SET serveroutput ON
    DECLARE
      l_url      VARCHAR2(200)   :='http://MY_IP:8585/apex/demo';
      l_json     VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}';
      l_response VARCHAR2(30000);
    BEGIN
      post( p_url => l_url, p_message =>l_json, p_response => l_response);
    END;which resulted in :
    anonymous block completed
    status code: 200
    reason phrase: OK
    with data inserted. Setup using 2.0.1
       Workspace : wsdemo
    RESTful Service Module:  demo/
              URI Template:      test
                    Method:  POST
               Source Type:  PL/SQLand executing in sqldeveloper 3.2.20.09 when connecting directly to box B as scott:
    SET serveroutput ON
    DECLARE
      l_url      VARCHAR2(200)   :='http://MY_IP:8585//apex/wsdemo/demo/test';
      l_json     VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}';
      l_response VARCHAR2(30000);
    BEGIN
      post( p_url => l_url, p_message =>l_json, p_response => l_response);
    END;which resulted in :
    status code: 500
    reason phrase: Internal Server Error
    Listener's log:
    Request Path passes syntax validation
    Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=WSDEMO, _failed=false, _lastUpdate=1364313600000, _template=/wsdemo/, _type=BASE_PATH]
    Applied database connection info
    Attempting to process with PL/SQL Gateway
    Not processed as PL/SQL Gateway request
    Attempting to process as a RESTful Service
    demo/test matches: demo/test score: 0
    Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true]
    Determining if request can be dispatched as a Tenanted RESTful Service
    Request path has one path segment, continuing processing
    Tenant Principal already established, cannot dispatch
    Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: POST demo/test
    demo/test is a public resource
    Using generator: oracle.dbtools.rt.plsql.AnonymousBlockGenerator
    Performing JDBC request as: SCOTT
    Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute
    INFO: Error occurred during execution of: [CALL, begin
    insert into scott.json_demo values(/*in:title*/?,/*in:description*/?);
    end;, [title, in, class oracle.dbtools.common.stmt.UnknownParameterType], [description, in, class oracle.dbtools.common.stmt.UnknownParameterType]]with values: [thetitle, thedescription]
    Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute
    INFO: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    java.sql.SQLException: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
            at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
            at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
            at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
            at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
            at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:205)
            at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1043)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)
            at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612)
            at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3713)
            at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4755)
            at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:242)
            at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124)
            at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:101)
            at $Proxy46.execute(Unknown Source)
            at oracle.dbtools.common.jdbc.JDBCCallImpl.execute(JDBCCallImpl.java:44)
            at oracle.dbtools.rt.plsql.AnonymousBlockGenerator.generate(AnonymousBlockGenerator.java:176)
            at oracle.dbtools.rt.resource.templates.v2.ResourceTemplatesDispatcher$HttpResourceGenerator.response(ResourceTemplatesDispatcher.java:309)
            at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:88)
            at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:412)
            at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059)
            at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999)
            at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434)
            at oracle.dbtools.standalone.SecureServletAdapter.doService(SecureServletAdapter.java:65)
            at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:196)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
            at java.lang.Thread.run(Thread.java:662)
    Error during evaluation of resource template: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-idPlease advise.
    Regards
    Zack

    Zack.L wrote:
    Hi Andy,
    Sorry, forgot to post the Source that's use by both AL1.1.4 and AL2.0.1.
    Source
    begin
    insert into scott.json_demo values(:title,:description);
    end;
    it's failing during the insert?
    Yes, it failed during insert using AL2.0.1.
    So the above statement produces the following error message:
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-idThis suggests to me that an unprintable character (notice how there is nothing between the double quotes - "") has worked its way into your PL/SQL Handler. Note how the error is reported to be a column 74 on line 2, yet line 2 of the above block should only have 58 characters, so at a pure guess somehow there's extra whitespace on line 2, that is confusing the PL/SQL compiler, I suggest re-typing the PL/SQL handler manually and seeing if that cures the problem.

Maybe you are looking for

  • How to change my Email address and my home address ?

    Hi, I Create a new account @live.com  , I want all my last  certifications to be use the new Email address instead of the old one and also how to change my home address Last Questions , I want to change my login account on this forums to  use the new

  • N Level approval custom workflow

    Hi, I have a requirement to implement N-Level approval custom workflow. I am aware that there is standard SRM N-Level approval but I need a customized one. Could you please provide any documentation/inputs on this. Regards, Prasad

  • Person responsible in COPA thru settlement

    Hi, Is there any possibility of getting the person responsible in COPA as sales person when the project is settled? If so, pl share the details of user exit to be used. Regards,

  • Viper remote start on 2014 Jeep JK

    Will any of these two viper remote starts work with a 2014 automatic Jeep wrangler unlimited with manual doors and no alarm?Will I be able to install a viper invisibeam after the remote start is installed?    1. Viper 4115V1D Remote Start System with

  • Delete customer

    Hi, Can any one help me in this query- We have one customer ABC which was deleted in 2006. But system allows to create sales order for ABC even in yr 2008(03 APR 2008.) what is the effect of deleting a customer in sales cycle. i.e. which functions ar