Cursor QueryProblems while inserting data into an external db in OBPM 10GR3

Hi all,
I have to call the db and insert a number of records at the same time. About 500 records at a time.
Whenever I do it, I get the following error after 2 or 3 requests/instances:-
Caused by: The maximum number of opened cursors has been exceeded in the SQL statement cache.
Detail:The maximum number of opened cursors can be configured in the external resources SQL configuration.
Caused by: The maximum number of opened cursors has been exceeded in the SQL statement cache.
Detail:The maximum number of opened cursors can be configured in the external resources SQL configuration.
Now, my question is, if I increase the number of opened cursors, what is the impact on the engine performance, instance size and process performance?
Is there any deadlock that takes place?
Is it a good idea to increase the number of cursors?
How do we close the cursors after every db transaction to ensure performance and scalability?
I use the following Query:-
String sqlQuery = "INSERT INTO TEST_TABLE(TEST_IDS )VALUES('"+ testIdArg +"')";
*// set a timeout of 180 seconds on the DDA query*
*     DynamicSQL.queryTimeout = 100;*
*     implname = "test_schema";*
*     items = Fuego.Sql.DynamicSQL.executeUpdate(sentence : sqlQuery, implname : implname);*      
*What do I change in this query to eliminate db cursor problems?
*I have to run the same query more than 500 times for each instance? And there can be multiple instances every 30 seconds...
I tried closing the cursors using Fuego.Sql.DynamicSQL.close(it : items);
But unfortunately, items is an integer not an Iterator.

Looks like your system may be under load, or you may be perfroming an insert that is taking longer than 45 - 60 seconds. The DB adapter runs as a synchronous process so if the insert takes longer than 60 seconds you will get timeouts,
There may be some tuning that needs to be performed. Can you please give me a little more background on the activity that is happen when it errors?
Are you able to post the full error stack.
cheers
James

Similar Messages

  • Error while inserting data into a table.

    Hi All,
      I created a table.While inserting data into the table i am getting an error.Its telling "Create data Processing Function Module".Can any one help me regarding this?
    Thanx in advance
    anirudh

    Hi Anirudh,
      Seems there is already an entry in the Table with the same Primary Key.
    INSERT Statement will give short dump if you try to insert data with same key.
    Why dont you use MODIFY statement to achieve the same.
    Reward points if this Helps.
    Manish

  • Error while Inserting data into flow table

    Hi All,
    I am very new to ODI, I am facing lot of problem in my 1st interface. So I have many questions here, please forgive me if it has irritated to you.
    ========================
    I am developing a simple Project to load a data from an input source file (csv) file into a staging table.
    My plan is to achieve this in 3 interfaces:
    1. Interface-1 : Load the data from an input source (csv) file into a staging table (say Stg_1)
    2. Interface-2 : Read the data from the staging table (stg_1) apply the business rules to it and copy the processed records into another staging table (say stg_2)
    3. Interface-3 : Copy the data from staging table (stg_2) into the target table (say Target) in the target database.
    Question-1 : Is this approach correct?
    ========================
    I don't have any key columns in the staging table (stg_1). When I tried to execute the Flow Control of this I got an error:
    Flow Control not possible if no Key is declared in your Target Datastore
    With one of the response (the response was - "FLOW control requires a KEY in the target table") in this Forum I have introduced a column called "Record_ID" and made it a Primary Key column into my staging table (stg_1) and my problem has been resolved.
    Question-2 : Is a Key column compulsary in the target table? I am working in BO Data Integrator, there is no such compulsion ... I am little confused.
    ========================
    Next, I have defined one Project level sequence. I have mapped the newly introduced key column Record_Id (Primary Key) with the Project level sequence. Now I am got another error of "CKM not selected".
    For this, I have inserted "Insert Check (CKM)" knowledge module in my Project. With this the above problem of "CKM not selected" has been resolved.
    Question-3 : When is this CKM knowledge module required?
    ========================
    After this, the flow/interface is failing while loading data into the intermediar ODI created flow table (I$)
    1 - Loading - SS_0 - Drop work table
    2 - Loading - SS_0 - Create work table
    3 - Loading - SS_0 - Load data
    5 - Integration - FTE Actual data to Staging table - Drop flow table
    6 - Integration - FTE Actual data to Staging table - Create flow table I$
    7 - Integration - FTE Actual data to Staging table - Delete target table
    8 - Integration - FTE Actual data to Staging table - Insert flow into I$ table
    The Error is at Step-8 above. When opened the "Execution" tab for this step I found the message - "Missing parameter Project_1.FTE_Actual_Data_seq_NEXTVAL RECORD_ID".
    Question-4 : What/why is this error? Did I made any mistake while creating a sequence?

    Everyone is new and starts somewhere. And the community is there to help you.
    1.) What is the idea of moving data from stg_1 and then to stg_2 ? Do you really need it for any other purpose other than move data from SourceFile to Target DB.
    Otherwise, its simple to move data from SourceFile -> Target Table
    2.) Does your Target table have a Key ?
    3.) CKM (Check KM) is required when you want to do constraint validation (Checking) on your data. You can define constraints (business rules) on the target table and Flow Control will check the data that is flowing from Source File to Target table using the CKM. All the records that donot satisfy the constraint will be added to E$ (Error table) and will not be added to the Target table.
    4.) Try to avoid ODI sequences. They are slow and arent scalable. Try to use Database sequence wherever possible. And use the DB sequence is target mapping as
    <%=odiRef.getObjectName( "L" , "MY_DB_Sequence_Row" , "D" )%>.nextval
    where MY_DB_Sequence_Row is the oracle sequence in the target schema.
    HTH

  • Error while inserting data into BFILE datatype

    Dear Experts,
    I am trying to insert data into resume table, but it is throwing error:
    create table resume(resume blob);
    declare
    f_lob bfile;
    b_lob blob;
    begin
    insert into resume(resume) values(empty_blob())
    return documents into b_lob;
    f_lob := bfilename( 'RESUME_SAVE', 'Pawan-resume.doc' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile
    ( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    return documents into b_lob;
    ERROR at line 8:
    ORA-06550: line 8, column 10:
    PL/SQL: ORA-00904: "DOCUMENTS": invalid identifier
    ORA-06550: line 7, column 2:
    PL/SQL: SQL Statement ignored
    Please help
    Regards
    Sunil Kumar

    Thank you very much Mihael................... It works
    But I think there is a mistake in oracle documentation, please check following link:
    http://docs.oracle.com/cd/B10501_01/appdev.920/a96591/adl14cas.htm
    Thanks & Regards
    Sunil Kumar

  • Error While Inserting Data into table using OAF

    Hi Experts,
    I am learning OAF; i am trying into insert the data into table using OAF. I followed the below procedure.
    My table(OLF_TEST_TBL) Columns:
    EmpID (Number), Ename(VARCHAR2 100), Sal Number, and who columns.
    1. created Application Module (AM).
    package: oracle.apps.mfg.simplepg.server
    name: oaf_test_tbl_am
    2. created simple page
    name:EmployeePG
    package:oracle.apps.mfg.simplepg.webui
    3. Assigned the Application Module to Page
    4. Created Entity Object(EO)
    name:oaf_test_tbl_eo
    package:oracle.apps.mfg.simplepg.schema.server
    schema:apps
    table:OLF_TEST_TBL
    note:
    1. EMPID column is selected as primary key
    2. selected create method, remove method and validation method.
    3.checked generate default view object
    VO:
    name:olf_test_tbl_vo
    note: Entity Object was assigned to VO
    Coming To page:
    page main region:EmployeeMainRN
    1.under main region i created one more region using wizard
    selected AM and VO, region style-default single column
    2. under main region i created one more region
    region style- pagebuttonbar, ID:pagebutoonsRN
    3. under pagebuttonRN, created two submit buttons(ID:SUBMIT, ID:CANCEL).
    In AM java page:
    created a method to insert row and for commit.
    Insert Method:
    public void insertrow(){
    OAViewObject vo=(OAViewObject)getoaf_test_tbl_vo1();
    if(!vo.isPreparedForExecution()){
    vo.executeQuery();
    Row row=vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Commit Method:
    public void savaDataTooaftesttable(){
    getDBTransaction().commit();
    In EmployeeMainRN, created a controller.
    In this controller process request method, 'insertrow' method was called.
    import oracle.apps.fnd.framework.OAApplicationModule;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("insertrow");
    To commit the transaction when SUBMIT button pressed, commit method was called in process form request method.
    import oracle.apps.fnd.framework.OAViewObject;
    public void processformRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("SUBMIT") != null)
    am.invokemethod("savaDataTooaftesttable");
    Error After clicking the submit button_
    I ran the page, page was opened successfully. Once i enter data and click submit button, it's giving the following error.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object oaf_test_tbl_am.oaf_test_tbl_vo1700_oaf_test_tbl_vo1_practice_test_prc1_oracle_apps_mfg_simplepg_server_oaf_test_tbl_am.oaf_test_tbl_vo1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    Experts, Kindly help me why i am getting this error.
    Awating your replies.
    Thanks in advance.

    If you dont want to create message. You can throw exception like below as well
              throw new OAException("Emp Id is "+empId+" and employee name is "+empName, OAException.CONFIRMATION);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error in native SQL while inserting data into CORP table

    HI all,
    I am getting an exception while inserting records using native SQL into CORP table.
    PFB the code.
    LOOP AT gi_hrp1001 INTO wa_hrp1001.
      TRY.
            EXEC SQL.
              INSERT INTO misuser.Table_4
              VALUES (wa_hrp1001-otype , wa_hrp1001-objid ).
            ENDEXEC.
          CATCH cx_sy_native_sql_error.
            MESSAGE 'Connect - Error ' TYPE 'E'.
        ENDTRY.
      ENDLOOP.
    Please help.
    Thanks & Regards
    Nitesh

    I see two issue with your Insert. 1) you need to specify the field names in the table, for example otype and objid. 2) You need to indicate in the VALUES that you're using host variables by using the prefix :.
    I think the correct syntax is:
            EXEC SQL.
              INSERT INTO misuser.Table_4
             (otype, objid)
              VALUES (:wa_hrp1001-otype, :wa_hrp1001-objid)
            ENDEXEC.
    Good luck.

  • Problems while inserting data into Oracle10g RDF store

    hi
    I ran into this error again after it was fixed last time. Even this time it was the same error
    ID: 9777 Error: java.sql.SQLException: ORA-13199: RDF:Error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 98
    I was been told that this problem will be fixed in the new version of Oracle RDF store , just wondering whether the new version has been released. Currently I am using Oracle10g .
    triples causing errors :
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Receptor_Down_Regulation> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#dDEFINITION> "<def-source>NCI</def-source><def-definition>Due to internalization of ligand-receptor complexes, increased receptor turnover, or decreased receptor expression following exposure to a ligand or agent, Receptor Down Regulation involves a decrease in the number of ligand-specific cellular proteins that bind to, and mediate, the effects of a regulatory molecule.</def-definition>" .
    ID: 7528 Error: java.sql.SQLException: ORA-13199: RDF:Error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 98
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#EFP_Cell_Cycle_Pathway> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#FULL_SYN> "<term-name>Estrogen-responsive protein Efp controls cell cycle and breast tumors growth</term-name><term-group>PT</term-group><term-source>BIOCARTA</term-source>" .
    ID: 7525 Error: java.sql.SQLException: ORA-13199: RDF:Error occurred
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 98
    triples that did not throw any error while loading
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Hypercalcemia> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#FULL_SYN> "<term-name>hypercalcemia</term-name><term-group>PT</term-group><term-source>NCI-GLOSS</term-source><source-code>CDR0000045363</source-code>" .
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Hypercalcemia> <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#FULL_SYN> "<term-name>Hypercalcemia</term-name><term-group>PT</term-group><term-source>NCI</term-source>" .
    <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#Hypercalcemia> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
    thanks chandra

    "RDF Error occurred" is a generic error message and might be from a number of causes (there are more meaningful error messages in the next patch release, 10.2.0.3). The likely cause is an error due to leading blanks in an object literal string or a null object literal string. For example " Oracle" and "" cause this error during load. This has been fixed in 10.2.0.3. A special patch including this and other fixes for RDF is being made available also. I will post details here as soon as it is ready.
    For now, the best option might be to process your data and remove the leading blanks and re-write the null strings as "NULL" and re-try the load. The special RDF patch should be ready in a couple of weeks.

  • Data services job failes while insert data into SQL server from Linux

    SAP data services (data quality) server is running on LInux server and Windows. Data services jobs which uses the ODBC driver to connect to SQL server is failing after selecting few thousand records with following reason as per data services log on Linux server. We can run the same data services job from Windows server, the only difference here is it is using SQL server drivers provided by microsoft. So the possible errors provided below, out of which #1 and #4 may not be the reason of job failure. DBA checked on other errors and confirmed that transaction log size is unlimited and system has space.
    Why the same job runs from Windows server and fails from Linux ? It is because the ODBC drivers from windows and Linux works in different way? OR there is conflict in the data services job with ODBC driver.
    ===== Error Log ===================
    8/25/2009 11:51:51 AM Execution of <Regular Load Operations> for target <DQ_PARSE_INFO> failed. Possible causes: (1) Error in the SQL syntax;
    (2)6902 3954215840 RUN-051005 8/25/2009 11:51:51 AM Database connection is broken; (3) Database related errors such as transaction log is full, etc.; (4) The user defined in the
    6902 3954215840 RUN-051005 8/25/2009 11:51:51 AM datastore has insufficient privileges to execute the SQL. If the error is for preload or postload operation, or if it is for
    ===== Error Log ===================

    this is another method
    http://www.mssqltips.com/sqlservertip/2484/import-data-from-microsoft-access-to-sql-server/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Access issues while inserting data in a table in same schema

    Hi All.
    I have a script that at first creates and then populates a table. My script used to run fine in production environment till few hours back. But all of a sudden, it is popping up error while inserting data into the table .
    Error message - "Insufficient Previlages".
    Please suggest me what may be the reasons for this kind of error.
    Thanks in advance

    Sonika wrote:
    Hi All.
    I have a script that at first creates and then populates a table. My script used to run fine in production environment till few hours back. But all of a sudden, it is popping up error while inserting data into the table .
    Error message - "Insufficient Previlages".
    Please suggest me what may be the reasons for this kind of error.
    1) something changed
    2) you are hitting a bug

  • Error while loading  data into External table from the flat files

    HI ,
    We have a data load in our project which feeds the oracle external tables with the data from the Flat Files(.bcp files) in unix.
    While loading the data, we are encountering the following error.
    Error occured (Error Code : -29913 and Error Message : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: un) while loading data into table_ext
    Please let us know what needs to be done in this case to solve this problem.
    Thanks,
    Kartheek

    Kartheek,
    I used Google (mine still works).... please check those links:
    http://oraclequirks.blogspot.com/2008/07/ora-29400-data-cartridge-error.html
    http://jonathanlewis.wordpress.com/2011/02/15/ora-29913/
    HTH,
    Thierry

  • Error while insert data using execute immediate in dynamic table in oracle

    Error while insert data using execute immediate in dynamic table created in oracle 11g .
    first the dynamic nested table (op_sample) was created using the executed immediate...
    object is
    CREATE OR REPLACE TYPE ASI.sub_mark AS OBJECT (
    mark1 number,
    mark2 number
    t_sub_mark is a class of type sub_mark
    CREATE OR REPLACE TYPE ASI.t_sub_mark is table of sub_mark;
    create table sam1(id number,name varchar2(30));
    nested table is created below:
    begin
    EXECUTE IMMEDIATE ' create table '||op_sample||'
    (id number,name varchar2(30),subject_obj t_sub_mark) nested table subject_obj store as nest_tab return as value';
    end;
    now data from sam1 table and object (subject_obj) are inserted into the dynamic table
    declare
    subject_obj t_sub_mark;
    begin
    subject_obj:= t_sub_mark();
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,subject_obj from sam1) ';
    end;
    and got the below error:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7
    then when we tried to insert the data into the dynam_table with the subject_marks object as null,we received the following error..
    execute immediate 'insert into '||dynam_table ||'
    (SELECT

    887684 wrote:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7The problem is that your variable subject_obj is not in scope inside the dynamic SQL you are building. The SQL engine does not know your PL/SQL variable, so it tries to find a column named SUBJECT_OBJ in your SAM1 table.
    If you need to use dynamic SQL for this, then you must bind the variable. Something like this:
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,:bind_subject_obj from sam1) ' USING subject_obj;Alternatively you might figure out to use static SQL rather than dynamic SQL (if possible for your project.) In static SQL the PL/SQL engine binds the variables for you automatically.

  • Is there a way to Insert Data into a Lookup Column Type on a SharePoint List Destination in SSIS?

    Greetings.
    I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
    http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
    However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
    is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
    I have read and re-read the SharePoint SSIS Adapters 2011.docx from
    http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
    "Looking Up Values in a SharePoint List
    If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
    data in the lookup column on the ";#" delimiter to separate the ID value from the description.
    If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
    I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
    I have several of these lookup column types pointing to several different lists.
    Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
    Thank you.
    My errors are:
    Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
    Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
    inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will

    I have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
    In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
    Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
    column --> SharePoint displays “4005” and successfully links to the lookup list.
    Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
    with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
    and things work well.
    There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
    1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
    2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
    3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
    Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
    SELECT
    pps.SSNm,
    pps.file_updated,
    pps.Employee_id,
    /* pps.CheckDistNm,*/
    Check_Distribution_id = COALESCE( d.ID, 0 ),
    pps.Job_nbr,
    pps.SeqNm,
    pps.action_eff_dt,
    Fund_id = COALESCE( f.id, 0 ),
    Appropriation_id = COALESCE( ap.id, 0 ),
    ActionCode_id = COALESCE( ac.id, 0 ),
    SpecNumber_id = COALESCE( jt.ID, 0 ),
    pps.Employee_id,
    /* pps.Fund,
    pps.Approp,
    pps.Unit,*/
    Unit_id = COALESCE( u.ID, 0 ),
    PosNm,
    PosCode,
    pps.LastName,
    pps.FirstName,
    pps.MI
    FROM
    x_PPS.aReportVw.pps_screens_active AS pps
    LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
    pps.CheckDistNm = d.Check_Distribution
    LEFT OUTER JOIN dbo.Units AS u ON
    pps.Fund = u.Fund AND
    pps.Approp = u.Approp AND
    pps.Unit = u.Unit
    LEFT OUTER JOIN dbo.Appropriations AS ap ON
    pps.Approp = ap.Approp
    LEFT OUTER JOIN dbo.Funds AS f ON
    pps.Fund = f.Fund
    LEFT OUTER JOIN dbo.ActionCodes AS ac ON
    pps.ActionCode = ac.ActionCode
    LEFT OUTER JOIN dbo.JobTitles AS jt ON
    pps.SpecNm = jt.SpecNumber AND
    pps.JurisClass = jt.JurisClass

  • Inserting Data into nested table

    I am exploring the differences between OBJECT & RECORD.
    As i am still in process of learning, I found that both are structures which basically groups elements of different datatypes or columns of different datatypes, one is used in SQL and other is used in PL/SQL, please correct me if I am wrong in my understanding.
    Below i am trying to insert data into an table of type object but i am unsuccessful can you please help.
    CREATE OR REPLACE type sam as OBJECT
    v1 NUMBER,
    v2 VARCHAR2(20 CHAR)
    ---Nested Table---
    create or replace type t_sam as table of sam;
    --Inserting data----
    insert into table(t_sam) values(sam(10,'Dsouza'));
    Error Message:
    Error starting at line 22 in command:
    insert into table(t_sam) values(sam(10,'Dsouza'))
    Error at Command Line:22 Column:13
    Error report:
    SQL Error: ORA-00903: invalid table name
    00903. 00000 -  "invalid table name"
    *Cause:   
    *Action:

    Ariean wrote:
    So only purpose of equivalent SQL types concept of nested tables is to use them as one of the data types while defining an actual table?
    Sort of - you can definitely use them for more than just "defining an actual table". (I'm fairly certain you could pass a nested table into a procedure, for example - try it, though - I'm not 100% sure on that - it just "makes sense". If you can define a type, you can use it, pass it around, whatever.).
    Ariean wrote:
    And that nested table could be a record in SQL or an Object in PLSQL or just simple datatype(number,varchar etc)?
    Nested tables are just like any other custom data type. You can create a nested table of other data types. You can create a custom data type of nested tables.
    It could get stupidly .. er, stupid O_0
    CREATE TYPE o_myobj1 AS object ( id1   number, cdate1  date );
    CREATE TYPE t_mytype1 AS table of o_myobj1;
    CREATE TYPE o_myobj2 AS object ( id2   number,  dumb  t_mytype1 );
    CREATE TYPE t_dumber AS table of o_myobj2;
    O_0
    Ok, my brain's starting to hurt - I hope you get the idea
    Ariean wrote:
    Secondly is my understanding correct about OBJECT & RECORD?
    I can't think of any benefit of describing it another way.

  • Inserting Data into a Collection

    Hi
    Can anybody suggest how to Insert data into a Collection from another Collection Using Bulk Binds in PLSQL?
    My scenario :-
    CREATE OR REPLACE PACKAGE te_ar IS
    TYPE srm_rec IS RECORD (col1 <table>.<col1>%TYPE, col2 <table>.<col2>%TYPE);
    TYPE srm_rec_list IS TABLE OF srm_rec INDEX BY BINARY_INTEGER;
    FUNCTION z_srm_rec RETURN srm_rec_list PIPELINED;
    END te_ar;
    CREATE OR REPLACE PACKAGE BODY te_ar IS
    FUNCTION z_srm_rec RETURN srm_rec_list PIPELINED IS
    v_srm_rec srm_rec;
    TYPE col1_t IS TABLE OF <table>.<col1>%TYPE INDEX BY BINARY_INTEGER;
    TYPE col2_t IS TABLE OF <table>.<col2>%TYPE INDEX BY BINARY_INTEGER;
    col1_tt col1_t;
    col2_tt col2_t;
    CURSOR c1
    IS
    SELECT col1, col2 FROM table;
    BEGIN
    OPEN c1;
    FETCH c1 BULK COLLECT INTO col1_tt,col2_tt;
    FORALL i IN 1 .. c1%ROWCOUNT
    v_srm_rec.col1(i) := col1_tt(i);
    v_srm_rec.col2(i) := col2_tt(i);
    PIPE_ROW(v_srm_rec);
    CLOSE c1;
    RETURN;
    END;
    END te_ar;
    I have created a Record Type in which I am trying to insert rows using bulk bind and return it using a pipelined function.
    This approach is throwing me errors in which I am unable to use both Pipelining and Bulk Binds together so that I can make the Performance of the entire bit better.
    Please suggest the way forward.
    Any other relevant info I am ready to supply.
    Thanks
    Arnab

    FORALL is used for bulk DML statements and will not work for your collections. http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm#LNPLS01321. I think you may want to use a regular FOR loop.

  • Inserting data into a Clob

    I need to insert data into a Clob (>8k) and have not been able to determine how
    to do it without using Oracle's extensions to the JDBC JDK.
    Does anyone have a code snippet to show how to populate the Clob in the first
    place?
    Thanks,
    Cully.
    Settings from weblogic.properties:
    weblogic.jdbc.connectionPool.oraclePoolCSA=\
    url=jdbc:oracle:thin:@IHP273:1521:AIRCORE,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=2,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=csav2;password=csav2
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.oraclePoolCSA=\
    guest,everyone
    weblogic.allow.reset.weblogic.jdbc.connectionPool.oraclePoolCSA=everyone
    weblogic.allow.shrink.weblogic.jdbc.connectionPool.oraclePoolCSA=everyone
    weblogic.jdbc.TXDataSource.CSATXDataSource=oraclePoolCSA

    Shiva,
    That was it....instead of doing the Blob work all in the same insert
    statement, I grabbed a new sequence and inserted a row with an empty_blob().
    After that I did an update on that row setting the correct value of the
    Blob.
    Thanks for the help!!
    "Shiva Paranandi" <[email protected]> wrote in message
    news:[email protected]...
    I tried with SP2 only and it works. The problems might be that you aregetting a
    null blob. Try inserting an emtpy blob first. Check out this program whichworks
    for me on WLS 6, SP2.
    Shiva.
    Tony Bailey wrote:
    Still getting the NPE. Any other ideas??? Are you able to do this
    successfully on sp2?
    "Shiva Paranandi" <[email protected]> wrote in message
    news:[email protected]...
    Try these two things:
    1. Change your SQL query to "SELECT image FROM " + table + " for
    update";
    2. Also, set conn.setAutoCommit(false);
    Shiva.
    Tony Bailey wrote:
    If I step through the code in the debugger, everything is A-OK up
    until
    the
    getBinaryOutputStream, then I get a NPE. The blob appears to be
    instantiated when I toString() it in the previous line.
    private Blob getBlob(File f, String table)
    throws SQLException
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String SQL;
    Blob imgblob = null;
    FileInputStream fis = null;
    OutputStream bos = null;
    try
    conn = dbutil.getConnection();
    SQL = "SELECT image FROM " + table;
    pstmt = conn.prepareStatement(SQL);
    rs = pstmt.executeQuery();
    rs.next();
    imgblob = rs.getBlob("image");
    logger.log(Debug.DEBUG, "DictTblCtrlr.getBlob(): The
    blob
    is: "
    + imgblob);
    fis = new FileInputStream(f);
    bos = ((OracleBlob)imgblob).getBinaryOutputStream();
    byte[] buffer = new byte[65534];
    int length = -1;
    while ((length = fis.read(buffer)) != -1)
    bos.write(buffer, 0, length);
    bos.flush();
    catch (Exception sqle)
    logger.log(Debug.ERROR, "DictTblCtrlr.getBlob(): " +
    sqle.getMessage());
    sqle.printStackTrace();
    throw new SQLException(sqle.getMessage());
    finally
    try { fis.close();  bos.close(); } catch (Exception e)
    dbutil.release(rs, pstmt, conn);
    return imgblob;
    [07-19-2001 03:02:07] DEBUG:DictTblCtrlr.getBlob(): The blob is:
    weblogic.jdbc.rmi.SerialBlob@1f1f12
    [07-19-2001 03:02:23] ERROR:DictTblCtrlr.getBlob():
    java.lang.NullPointerException
    java.sql.SQLException: java.lang.NullPointerException
    at
    weblogic.jdbc.rmi.SerialBlob.getBinaryOutputStream(SerialBlob.java:73)
    at
    com.uctech.psws.persistence.datacontroller.DictionaryTableController.getBlob
    (DictionaryTableController.java:410)
    at
    com.uctech.psws.persistence.datacontroller.DictionaryTableController.insert(
    DictionaryTableController.java:363)
    "Shiva Paranandi" <[email protected]> wrote in message
    news:[email protected]...
    Could you post the exception?
    Shiva.
    Tony Bailey wrote:
    Using the example, I get a NullPointerException when calling
    getBinaryOutputStream() under WL6.0sp2.
    "Filip Hanik" <[email protected]> wrote in message
    news:[email protected]...
    look under
    $BEA_HOME/wlserver6.0sp1/samples/examples/jdbc/oracle/OracleBlobClob.java
    >>>>>>>
    ~
    Namaste - I bow to the divine in you
    ~
    Filip Hanik
    Software Architect
    [email protected]
    www.filip.net
    "Cully Orstad" <[email protected]> wrote in message
    news:[email protected]...
    I need to insert data into a Clob (>8k) and have not been
    able
    to
    determine how
    to do it without using Oracle's extensions to the JDBC JDK.
    Does anyone have a code snippet to show how to populate the
    Clob
    in
    the
    first
    place?
    Thanks,
    Cully.
    Settings from weblogic.properties:
    weblogic.jdbc.connectionPool.oraclePoolCSA=\
    url=jdbc:oracle:thin:@IHP273:1521:AIRCORE,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=2,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=csav2;password=csav2
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.oraclePoolCSA=\
    guest,everyone
    weblogic.allow.reset.weblogic.jdbc.connectionPool.oraclePoolCSA=everyone
    >>>>>>>>
    >>>>>>
    >>>>
    >>
    weblogic.allow.shrink.weblogic.jdbc.connectionPool.oraclePoolCSA=everyone
    >>>>>>>>
    weblogic.jdbc.TXDataSource.CSATXDataSource=oraclePoolCSA

Maybe you are looking for

  • Confirm / Fulfill Open Qty pulling in partial quantity in sales order

    Hello all,     The inventory for item AA is 83.5 case for batch 123A.   In the sales order i create, for item AA with Order Qty of 83 cases, it pull in from batch 123A, confirming 83 cases.   Next line item AA, i need another 1 case. It goes to anoth

  • Cannot Print to CUPS Printer, UPS Label Printer

    After upgrading to Mavericks, I can no longer print to my UPS Label Printer which utilizes the CUPS drivers. I have tried deleting the printer and reinstalling it. No luck. All other printers are working fine. Any ideas?

  • Flash gallery in web module not showing

    When using the web module the flash galleries do not show anymore; there is simply a black screen in the center panel. The HTLM galleries show alright. The problem started a few days ago when I updated to Adobe Flash Player 11. Any suggestions?

  • Incoming connections and firewall

    I have about a ten apps that have internet connections for their operation. Each time a particular app starts up after a boot/reboot of OS, I get the message "Do you want the application XYZ to accept incoming network connections. Settings can be cha

  • Fire fox will not open on my laptop. When I checked my profile, I have two defalt profiles. Help.

    Laptop Vista OS. Firefox opens about 10% of the time. Firefox is now opened in safe mode on the laptop. I started to troubleshoot by locating my profile. I found two default profiles. One named "8wc96kd.default-1350623840166" dated 10/18/2012. The ot