Help Insert Data

Hi i am student doing a project for my school and i trying to insert data
i am inserting triples with jena adapter into my Oracle Database from a .nt file. 4 tables are being created FAMILY_NS, FAMILY_TPL, RDFB_FAMILY and RDFC_FAMILY. my data are in N-Triple format.i want to know why i can't view my data through sql-developer in my database.do i store those data or not?
here is the code i use to insert data into my database
import java.io.*;
import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.graph.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.util.*;
import oracle.spatial.rdf.client.jena.*;
public class Bulk {
public static void main(String[] args) throws Exception
String szJdbcURL = "jdbc:oracle:thin:@192.168.2.3:1521:orcl";
String szUser = "kostas";
String szPasswd = "welcome";
String szModelName = "Family";
Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
GraphOracleSem graph = new GraphOracleSem(oracle, szModelName);
PrintStream psOut = System.out;
String dirname = "C:\\users\\CoCo\\Desktop\\file";
File fileDir = new File(dirname);
String[] szAllFiles = fileDir.list();
// loop through all the files in a directory
for (int idx = 0; idx < szAllFiles.length; idx++) {
String szIndFileName = dirname + File.separator + szAllFiles[idx];
psOut.println("process to [ID = " + idx + " ] file " + szIndFileName);
psOut.flush();
try {
// Model model = FileManager.get().loadModel("C:\\users\\CoCo\\Desktop\\file\\example.nt");
InputStream is = new FileInputStream(szIndFileName);
graph.getBulkUpdateHandler().prepareBulk(
is, // input stream
"http://www.recshop.fake/cd", // base URI
"N-TRIPLE", // data file type: can be RDF/XML, N-TRIPLE, etc.
null, // tablespace
null, // flags
null, // listener
null // staging table name.
is.close();
catch (Throwable t) {
psOut.println("Hit exception " + t.getMessage());
Edited by: CoCo on Oct 18, 2011 6:14 AM
Edited by: CoCo on Oct 18, 2011 6:15 AM

You haven't run completeBulk yet.
Please search for completeBulk in the following document.
http://download.oracle.com/docs/cd/E16338_01/appdev.112/e11828/sem_jena.htm
Thanks,
Zhe Wu

Similar Messages

  • Help with ORA 14400 error while inserting data

    Hi all,
    i am facing an ora 14400 error in the following scenario , please help.
    i have created a table using the syntax:
    CREATE TABLE temp_table
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    when i try to insert data using :
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    i get the following error output:
    Error report:
    SQL Error: ORA-14400: inserted partition key does not map to any partition
    14400. 00000 - "inserted partition key does not map to any partition"
    *Cause:    An attempt was made to insert a record into, a Range or Composite
    Range object, with a concatenated partition key that is beyond
    the concatenated partition bound list of the last partition -OR-
    An attempt was made to insert a record into a List object with
    a partition key that did not match the literal values specified
    for any of the partitions.
    *Action:   Do not insert the key. Or, add a partition capable of accepting
    the key, Or add values matching the key to a partition specification

    Hi Chaitanya,
    Change your table script to
    CREATE TABLE temp_table
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P1 VALUES LESS THAN(MAXVALUE)
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    1 row insertedor refer question regarding "Date Partitioning a table"
    *009*
    Edited by: 009 on Nov 3, 2010 11:29 PM

  • RFC scenario for inserting data in SAP, help me experts

    hi...
    i have to insert data in SAP database using BAPI_PR_CREATE.
    which adapter i hv to use for RFC(sender/receiver)(syn/Asyn).
    this sceanrio is File1-RFC-File2.
    file1 sends the data to RFC to insert data and file2 should hv to send the autogeneration keyID for PR
    Its very urgent...
    please help me..
    thx in advance
    john

    hi ...
    i did that..
    but..iam gting only 1 msg in monitering...
    evrythn is fine,,,,my scenario shows in MONI black flag...but gting only one msg and the data which i sent to SAP is not storing in SAP..and when i search in SM58 in XI server...i cnt see any messages...
    can u explain me Y..?
    thx for response..
    john

  • Help please !!  Need to insert date automatically in form

    I have been trying unsuccessfully for a week to automatically
    capture today's date on a form. I can display a date on screen but
    it will not insert date into mySQL db. All other information is
    inserted as expected.
    Am I just whistling in dark? Is there no way to eliminate
    user input for the order date field?
    I have looked throughout the forums and no luck.
    Anyone have any ideas about how to do?
    Thanks,
    Dale :-)

    You can use a timestamp function within your MySQL table, but
    remember you can only use the timestamp function ONCE in a table.
    Using the timestamp Function:
    Set the field type to TIMESTAMP. You can also set the default
    to CURRENT_TIMESTAMP and the attributes to ON UPDATE
    CURRENT_TIMESTAMP if you want the timestamp to change when the
    record is updated.
    If you want to record times more than the one time you are
    using the timestamp and you are using PHP/MySQL or PHP/MySQL ADODB
    (InterAKT's PhAKT Extension), then try this:
    http://chuckomalley.net/help/insert_date_help.php
    That gets the time into the MySQL Database. Next thing you'll
    want to do is to have it display the time the way you want it. The
    default will display it as yyyy-mm-dd hh:mm:ss and you may not want
    it that way. To display it the way you want it try this:
    http://chuckomalley.net/help/display_formatted_date.php
    For the specific syntax on using this, refer to the online
    MySQL Manual and search for DATE_FORMAT() at
    http://dev.mysql.com/doc/mysql/en/index.html
    Cheers
    Chuck

  • Need Help In Inserting Data

    Hello Everybody
    I have to insert data through excel sheets containing over 2,00,000 lakh records
    I am using toad to insert data but the issue with toad is that it supports excel 97-2003 format and I have to divide the excel sheets again and again to insert the data
    I can also use the pl/sql developer to insert the data but I don't know the process, plz suggest some gud ways to do that
    Thanks & Regards
    Peeyush Sharma

    Hi,
    Use the below script for control file:
    load data
    infile 'C:\Documents and Settings\abcd\Desktop\dat1.csv'
    into table empz
    fields terminated by "," optionally enclosed by '"'
    (emp_id,emp_name,emp_sal)
    {code}
    there is a difference between .txt and csv loading. as  we are using csv(comma seperated values)
    fields terminated by : {code} fields terminated by "," optionally enclosed by '"' should be comma ( ,) .

  • Query for inserting data into table and incrementing the PK.. pls help

    I have one table dd_prohibited_country. prohibit_country_key is the primary key column.
    I have to insert data into dd_prohibited_country based on records already present.
    The scenario I should follow is:
    For Level_id 'EA' and prohibited_level_id 'EA' I should retreive the
    max(prohibit_country_key) and starting from the maximum number again I have to insert them
    into dd_prohibited_country. While inserting I have to increment the prohibit_country_key and
    shall replace the values of level_id and prohibited_level_id.
    (If 'EA' occurs, I have to replace with 'EUR')
    For Instance,
    If there are 15 records in dd_prohibited_country with Level_id 'EA' and prohibited_level_id 'EA', then
    I have to insert these 15 records starting with prohibit_country_key 16 (Afetr 15 I should start inserting with number 16)
    I have written the following query for this:
    insert into dd_prohibited_country
    select     
         a.pkey,
         b.levelid,
         b.ieflag,
         b.plevelid
    from
         (select
              max(prohibit_country_key) pkey
         from
              dd_prohibited_country) a,
         (select
    prohibit_country_key pkey,
              replace(level_id,'EA','EUR') levelid,
              level_id_flg as ieflag,
              replace(prohibited_level_id,'EA','EUR') plevelid
         from
              dd_prohibited_country
         where
              level_id = 'EA' or prohibited_level_id = 'EA') b
    My problem here is, I am always getting a.pkey as 15, because I am not incrementing it.
    I tried incrementing it also, but I am unable to acheive it.
    Can anyone please hepl me in writing this query.
    Thanks in advance
    Regards
    Raghu

    Because you are not incrementing your pkey. Try like this.
    insert
       into dd_prohibited_country
    select a.pkey+b.pkey,
         b.levelid,
         b.ieflag,
         b.plevelid
       from (select     max(prohibit_country_key) pkey
            from dd_prohibited_country) a,
         (select     row_number() over (order by prohibit_country_key)  pkey,
              replace(level_id,'EA','EUR') levelid,
              level_id_flg as ieflag,
              replace(prohibited_level_id,'EA','EUR') plevelid
            from     dd_prohibited_country
           where level_id = 'EA' or prohibited_level_id = 'EA') bNote: If you are in multiple user environment you can get into trouble for incrementing your PKey like this.

  • Inserting data to a . SDF database (SQL Server Compact Edition connection)

    Hi, all.
    I'm working on a project that worked fine while connecting to SQL Server 2008. I used a connection string like this:
    Driver={SQL Server Native Client 10.0};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
    Now, I've replaced all database connections in my project to work with SQL Server Compact Edition, and my connection string is something like this:
    Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=myDir\myDataBase.sdf; 
    After changing the type of connection, I'm getting an error on "DB Tools Insert Data.vi". This is what I get:
    Error -2147217872 occurred at NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib: DB Tools Insert Data.vi->Main.vi
    Possible reason(s):ADO Error: 0x80040E30 Exception occured in Microsoft SQL Server Compact OLE DB Provider: The given type name was unrecognized. [,,,,,] in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib: DB Tools Insert Data.vi->Main.vi
    This is a simplified block diagram (as I said, it worked perfectly while using SQL Server 2008 connection):
    Could you please help me?
    Thanks in advance,
    Francisco

    Hi, Steve. Thanks for your answers.
    I worked around this problem by using directly a SQL query instead of this function (you were right, using DBTools Execute Query VI). But now I'm getting problems with other functions, when inserting data into the DB including NULL values.
    I make a SQL query like this using DBTools Execute Query VI:
    INSERT INTO Table1 (Column1, Column2, Column3, Column4, Column5, Column6) VALUES ('Value1', 'Value2', 'Value3', 'NULL', 'Value5', 'Value6') 
    and get the following error:
    ADO Error: 0x80040E07Exception occured in Microsoft SQL Server Compact OLE DB Provider: A literal value in the command could not be converted to the correct type due to a reason other than data overflow. [,,,,,] in NI_Database_API.lvlib:Conn Execute.vi->INSERT (new) restricción (DBCT).vi->Restricciones a Base de Datos (DBCT).vi->Definir - editar restricciones.vi->Main.vi
    The same SQL query worked perfectly when using the SQL Server 2008 connection, so it's not a database structure issue.
    Could somebody please help me?
    Regards,
    Francisco

  • Error using DB Tools Insert Data.vi

    Hi
    I am trying to insert data into a Paradox database and I am getting the following error:
    "Error -2147467259 occurred at Conn Execute.vi->DB Tools Create Table.vi->DB Tools Create Table If Not Exist.vi->DB Tools Insert Data.vi->Header Infromation 20061019 two inserts.vi
    Possible Reasons: Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine cannot open the file ''.  It is already opened exclusively by another user, or you need permission to view its data. in Conn Execute.vi->DB Tools Create Table.vi->DB Tools Create Table If Not Exist.vi->DB Tools Insert Data.vi->Header Infromation 20061019 two inserts.vi"
    Right now the vi is set up to create a table if one does not exist.
    Any Suggestions on this .

    Hello Shani,
    Have you had a chance to look over the other questions Crystal asked above?  Those answers will help us to better help you.  I also found the following discussion forum - I know they are using a different database, but I think you can tweak the solution so it works for you too. 
    Have a fantastic Wednesday!
    Janell R | Applications Engineer

  • Help for date compare in sqlite?

    Hi all,
          How to decide a date is between two date or not? for example, I want to query the tasks in the next week from the sqlite db, how to do?
            SELECT  * FROM TASK_TD WHERE TASK_DATE > NOW AND TASK_DATE < NEXTWEEK_DATE
        That does not work!
       Anybody can help me?Thanks a lot.
    David

    If you're using ActionScript (Flex or Flash) for your database, you could also declare your columns as "Date" (i.e. the ActionScript Date class). AIR has added support for Date as a recognized data type in its SQLite implementation:
    http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html#columnAffinity
    http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html#additionalSQL
    By using statement parameters to pass in Date data the ActionScript Date objects are converted when you insert data, and when you retrieve data it automatically comes back as ActionScript Date objects.
    Internally in the database, the Date values are stored as SQLite REAL (Unix epoch format) so date comparisons should work fine. For instance, if you want to find all rows with a date in a certain range, you could use this SQL:
    SELECT *
    FROM mytable
    WHERE datecolumn BETWEEN :startdate AND :enddate
    Then you'd need to specify the :startdate and :enddate values as parameters:
    sqlStatement.parameters[":startdate"] = new Date(2000, 3, 15);
    sqlStatement.parameters[":enddate"] = new Date(2005, 6, 13);
    2. Add a custom SQLite function for this purpose (see more about it in http://sqlite.org/cintro.html under 'Extending SQLite' section). Note that in such case you'll suffer slow performance if you have large tables (since dates are not indexed correctly).
    Unfortunately AIR doesn't support custom functions in SQLite.

  • How to insert data into datagrid dynamically and also programatically with data and column names being retrived from a xml file..

    iam not able to insert data into datagrid corresponding to the column names..as iam inserting both data and column names programatically..ie iam not able to co relate the data with the column names.plzzz help me asap

    A DataGrid is row-based rather than cell-based with each row
    corresponding to an item in an underlying collection (specified in the
    dataProvider property). In order to add data to a DataGrid you
    manipulate the underlying collection, rather than the grid directly.
    Based on the limited description of your problem I would imagine you
    would need to create dynamic objects with property names that correspond
    to the dataFields of your dynamically created datagrid columns.
    So if you had created columns with dataFields "alpha", "beta" and
    "gamma" on your datagrid, you could create an item in your grid by
    adding the following object to your dataProvider:
    var gridItem : Object = new Object();
    gridItem.alpha = "alphaValue";
    gridItem.beta = "betaValue";
    gridItem.gamma = "gammaValue";

  • PL/SQL procedure to insert data doesn't work and unable to find reason.

    Sorry that I couldn't find the best place to post this question. It seems that the forum does not deal with this kind of question. I post here for help.
    I have a stored procedure to insert data into one table. SP was compiled without error and executed without error (from log table to get information). But the data was not inserted into
    the target table. I have tried different way to figure out the reason. But I failed to get any idea. Please help me to find possible reasons. The smple SP looks like this:
    CREATE OR REPLACE PROCEDURE my.sp_insert( P_DATE IN VARCHAR2)
    IS
    declare section
    begin
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    commit;
    exception section
    UPDATE PROCESS_LOG_TABLE CLAUSE;
    html_email section;
    rollback;
    end my.sp_insert
    I have tested that "select record1, record2, record3, record4 from table1, table2, table3, table4" really fetch the 7,000 records. and if I only run part of SQL from SQLPLUS as
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    It will work and insert 7,000 records into target table. Why did it not insert into target_table when execiting as stored procedure? Please help with your input. Thanks.
    Edited by: citicbj on Feb 12, 2013 4:15 PM

    Dear Friend,
    Is the user from which you created database procedure and sqlplus that you tested the code successfully is same?
    Regards
    Ahamed Rafeeque Cherkala

  • How can I insert data into the standard CRM tables ?

    Hi Experts,
    Scenario----
    I need to download few attributes (fields) from SAP MDM to SAP CRM via SAP XI. I'm using the 'COMT_PRODUCT_MAINTAIN_API' API for it.
    The attributes(fields) that are present in the strucutres of API are downloaded into CRM system (by executing the Inbound proxy that is created based on the Message Interface created on XI) by calling the functions present in the API.
    And for those fields that are not present in CRM, but need to be downloaded into CRM, I'm creating the Set Type attributes in CRM, which get appended to the API.
    My query is:
    There are fields in CRM into which I need to insert the values. But they are not listed in the API. So, how can I insert(/download) the values into these standard fields?
    Regret the long description. Intended to be clear.
    TIA. Points will be awarded.
    Regards,
    Kris
    Edited by: Kris on Jul 21, 2008 8:00 AM

    he INSERT program throws exception???
    can any one help me how to insert data into tabel.I have never used the jdbc driver to access, but what do you think that the flag READONLY=true means? An insert is not a read.
    Kaj

  • How can i insert data into DB from my page programatically in Oracle ADF..?

    Hai, this is praveen.
    I have created  an EO and VO, when i have inserted data by dragging and dropping from DataControl -->Operations-->Create. I have successfully inserting data. But how can i do it programatically. What are the pre-defined steps that i can use over there to insert data into table programatically. Could u plz help me?

    Hi,
    You have to create an action Listener in the bean for any button.
    Then call an AM method.
    In that you have to do the following
    ViewObject yourVO = getYourVO();
    Row r = yourVo.createRow();
    r.setAttribute("Column1", value1); //the name of column should be as it is in your vo attribute.
    yourVO.insertRow(r);
    this.getDbTransaction().commit();
    Thanks

  • How can I Insert data into my msaccess Database table

    Hello all,
    I am new to Java programming and I have problem that how can i insert name into my database table.
    The code which i have written is following:
    String filename = "d:/test.mdb";
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    database+= filename.trim() + ";DriverID=22;READONLY=true}";
    Connection con = DriverManager.getConnection(database,"","");
    String s = String.valueOf(text.getText());
    int k =10;
    Statement st = con.createStatement();
    st.execute("create table Test123(name text)");
    st.execute("INSERT INTO Test123 values" +s);
    on the INSERT program throws exception???
    can any one help me how to insert data into tabel.
    Thanks

    he INSERT program throws exception???
    can any one help me how to insert data into tabel.I have never used the jdbc driver to access, but what do you think that the flag READONLY=true means? An insert is not a read.
    Kaj

  • Insert data from two rows into a single row in a new table

    Hi
    i have a table like the following
    Deptno Dname      Salary
    10     Computer     2000
    10     Computer     4000
    10     Computer     3000
    10     Science     6000
    10     Science 1000
    10     Science     4000
    10     Science     10000
    I want to insert data into a new table like the following
    Deptno MaxSalCom     Minsalcom MinSalSci     MaxSaSci
    10     2000     4000      1000     10000
    Deptno--As in Table1
    MaxSalCom--Maximum salary for Dname " Computer"
    Minsalcom--Minimum salary for Dname " Computer"
    MaxSalSci--Maximum salary for Dname " Science"
    MinsalSci--Minimum salary for Dname " Science"
    Please help me how to go about it

    with data as
    (select 10 dno, 'Computer' dname, 2000 sal FROM dual
    union all
    select 10, 'Computer', 4000 FROM dual
    union all
    select 10, 'Computer', 3000 FROM dual
    UNION all
    select 10, 'Science', 6000 FROM dual
    union all
    select 10, 'Science', 1000 FROM dual
    union all
    select 10, 'Science', 4000 FROM dual
    union all
    select 10, 'Science', 10000 FROM dual
    select dno, min(decode(dname,'Computer',sal)) min_sal_comp , max(decode(dname,'Computer',sal)) max_sal_comp,
    min(decode(dname,'Science',sal))min_sal_sci , max(decode(dname,'Science',sal)) max_sal_sci
    from data
    group by dno;

Maybe you are looking for

  • Errors in calling web-service from pl/sql

    Hello All, Morning , we are getting the errors mentioned here (ORA-29261 bad argument , ORA-06512 at SYS.UTL_HTTP) while calling the composite (having a bpel process) deployed on 11g WLS server. From PL/SQL side we are calling this by forming the soa

  • Entitlement management in CRM

    Hi need a help. Any one worked on the Entitlement functionality in CRM,if yes is there any config guide or implementation guide document available ? i could see only SPA help not other document Appreciate if you can locate me the link or any document

  • PDF from SWF ?

    Hello, I have a SWF which accepts a clients text into a text input box. That text is them formatted and output into a dynamic text box. The client OK's it, and then I use Loadvars to send the data to me, however I also want an image of what the clien

  • Is it necessary to have both installations, ps cc  and ps cc(2014)  on my pc, or can I deinstall the older version?

    Is it necessary to have both installations, ps cc  and ps cc(2014)  on my pc, or can I deinstall the older version?

  • Leopard 10.5.1 may cause iPhoto to self-start and caused 5 re-starts since

    Well - I installed Leopard update (10.5.1) this morning and since then I have had to re-start my computer 5 times - or perhaps 6 - I'm losing count. On the first three occasions, iPhoto started up on its own and was not able to load any photos, so I