Help with jc_insert error

User d8da4712c1

27-05-2013 12:17:23

Hello,


I'm using jc_insert like this (1), and getting this error (2) but don't understand why!


(1)

$stmt = OCIParse($link,"
declare
cd_id cd_id_array;
begin
cd_id := jchem_table_pkg.jc_insert(:molfile1, :table, :jc_prop, 'true', 'false', ''); end;");

$jc_table='sub_structure';

$jc_prop='jchemproprities';

$blob2=OCINewDescriptor($link, OCI_D_LOB);

OCIBindByName($stmt, ':molfile1', $blob2, -1, OCI_B_BLOB);

$blob2->writetemporary($molfile1, OCI_TEMP_BLOB);

//OCIBindByName($stmt,":slot_labo_id_lotlabo_id",$slot_labo_id_lotlabo_id,-1);

OCIBindByName($stmt,":table",$jc_table,-1);

OCIBindByName($stmt,":jc_prop",$jc_prop,-1);

ociexecute($stmt);


ocicommit($link);

$Blob2->close();

$Blob2->free();

OCIFreeStatement($stmt);


(2):

Warning: ociexecute(): ORA-29532: appel Java arrete par une exception Java non interceptee : oracle.jdbc.driver.OracleSQLException: ORA-00942: Table ou vue inexistante
ORA-06512: a "KIET.JCHEM_TABLE_PKG", ligne 45
ORA-06512: a "KIET.JCHEM_TABLE_PKG", ligne 50



$stmt = OCIPar


 


se($link,"
                        declare
                        cd_id cd_id_array;
                        begin
                        cd_id := jchem_table_pkg.jc_insert(:molfile1, :table, :jc_prop, 'true', 'false',                         ''); end;");
                        $jc_table='sub_structure';
                        $jc_prop='jchemproprities';
                        $blob2=OCINewDescriptor($link, OCI_D_LOB);
                        OCIBindByName($stmt, ':molfile1', $blob2, -1, OCI_B_BLOB);
                        $blob2->writetemporary($molfile1, OCI_TEMP_BLOB);
                        //OCIBindByName($stmt,":slot_labo_id_lotlabo_id",$slot_labo_id_lotlabo_id,-1);  
                        OCIBindByName($stmt,":table",$jc_table,-1);
                        OCIBindByName($stmt,":jc_prop",$jc_prop,-1);
                        echo $stm;                        
ociexecute($stmt);  
                         ocifetchstatement($stmt, $cd_id, 0, 1,OCI_FETCHSTATEMENT_BY_ROW);
                        ocicommit($link);
                        $Blob2->close();
                        $Blob2->free();    
                        OCIFreeStatement($stmt);


ChemAxon aa7c50abf8

27-05-2013 13:24:47

Does it work, when you try using plain SQL from SQL*Plus/SQL Developer/Toad/... ?


Peter

User d8da4712c1

27-05-2013 13:57:57










pkovacs wrote:

Does it work, when you try using plain SQL from SQL*Plus/SQL Developer/Toad/... ?


Peter



I think yes but when I run jc_compare I can't find it !!


declare
cd_id cd_id_array;
begin
cd_id :=jchem_table_pkg.jc_insert('qq1
  Marvin  03140315382D
--
 13 14  0  0  0  0  0  0  0  0999 V2000
    2.2043    0.1758    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.4898    0.5883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.4898    1.4133    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.7754    0.1758    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0609    0.5883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.6536    0.1758    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3680    0.5883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0825    0.1758    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0825   -0.6492    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3680   -1.0617    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.6536   -0.6492    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0609   -1.0617    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.7754   -0.6492    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  2  3  2  0  0  0  0
  2  4  1  0  0  0  0
  4  5  2  0  0  0  0
  5  6  1  0  0  0  0
  6  7  2  0  0  0  0
  7  8  1  0  0  0  0
  8  9  2  0  0  0  0
  9 10  1  0  0  0  0
 10 11  2  0  0  0  0
  6 11  1  0  0  0  0
 11 12  1  0  0  0  0
 12 13  1  0  0  0  0
  4 13  1  0  0  0  0
M  END
','sub_structure');
end;
////////////////output:
anonymous block completed

then the search:
select cd_id from sub_structure where jc_compare(cd_smiles,'qq1
  Marvin  03140315382D
--
 13 14  0  0  0  0  0  0  0  0999 V2000
    2.2043    0.1758    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.4898    0.5883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.4898    1.4133    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.7754    0.1758    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0609    0.5883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.6536    0.1758    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3680    0.5883    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0825    0.1758    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.0825   -0.6492    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3680   -1.0617    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.6536   -0.6492    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0609   -1.0617    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.7754   -0.6492    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  2  3  2  0  0  0  0
  2  4  1  0  0  0  0
  4  5  2  0  0  0  0
  5  6  1  0  0  0  0
  6  7  2  0  0  0  0
  7  8  1  0  0  0  0
  8  9  2  0  0  0  0
  9 10  1  0  0  0  0
 10 11  2  0  0  0  0
  6 11  1  0  0  0  0
 11 12  1  0  0  0  0
 12 13  1  0  0  0  0
  4 13  1  0  0  0  0
M  END
','t:s')=1;

//////////////////output:
CD_ID       
-----------

0 rows selected



ChemAxon aa7c50abf8

27-05-2013 14:03:45

Did you commit the insert? You have to for the newly inserted structure to be included in the search. This is JChem Cartridge specific.


Peter

User d8da4712c1

27-05-2013 14:23:38










pkovacs wrote:

Did you commit the insert? You have to for the newly inserted structure to be included in the search. This is JChem Cartridge specific.


Peter



It work after the commit ,thank you Peter, Cheers ;)

User d8da4712c1

27-05-2013 14:28:07

Let me know if you have any suggestions for the error when using it in php code (first post), also I'm getting an error everytime I try to go to this sections on this forum (› View posts since last visit› View your posts› View unanswered posts) ,are you upgrading phpbb?



Thanks.




ChemAxon aa7c50abf8

27-05-2013 15:06:20

Let me know if you have any suggestions for the error when using it in php code (first post)

, so this is php... I didn't know what it was, so I asked one my colleagues who guessed it was perl. We are mostly Java and .NET programmers here... (Apart from Java, I did some PL/SQL, C/C++, C#, Visual Basic, shell programming, Groovy and am now learning Turkish.  )


I'm getting an error everytime I try to go to this sections on this forum (› View posts since last visit› View your posts› View unanswered posts) ,are you upgrading phpbb?

I've told the administrator about this. He will fix it or contact you later.


Thanks


Peter

User d8da4712c1

27-05-2013 15:25:46










pkovacs wrote:

Let me know if you have any suggestions for the error when using it in php code (first post)

, so this is php... I didn't know what it was, so I asked one my colleagues who guessed it was perl. We are mostly Java and .NET programmers here... (Apart from Java, I did some PL/SQL, C/C++, C#, Visual Basic, shell programming, Groovy and am now learning Turkish.  )


I'm getting an error everytime I try to go to this sections on this forum (› View posts since last visit› View your posts› View unanswered posts) ,are you upgrading phpbb?

I've told the administrator about this. He will fix it or contact you later.


Thanks


Peter



 yah that happens, scripting languages have a lot of similarities but php is widespread  too, I'll debug it maybe I'm not generating the right request....keep it up with the languages


Thanks Peter