Dbd Error Ocistmtfetch
representation of strings Message ID: 4732D650.5000705@easysoft.com E R wrote: > Alright, so here's another mystery: > > use DBI; > ... > $ENV{NLS_LANG} = ""AMERICAN_AMERICA.WE8ISO8859P1"; > > $dbh = DBI->connect(...); > $c = chr(228); > print "result: ", select_scalar("SELECT 1 FROM DUAL WHERE '$c' = > chr(228)"), "\n"; > > The select_scalar subroutine merely returns the first column of the > first row of the query. > > The above code emits: > > result: > > However, if I change NLS_LANG to "AMERICAN_AMERICA.US7ASCII", it emits: > > result: 1 > > Is there another NLS_LANG setting I should use, or should I check my > versions of OCI, DBD::Oracle and perl? I think I'm running OCI version > 8. My perl is 5.8.0. > > Thanks, > ER > > Are you actually running the code you keep sending? In: sub select_scalar { my ($dbi, $sql) = @_; my $sth = $dbi->prepare($sql); $sth->execute(); my $r = $sth->fetch_row_array(); return $r->[0]; } there is no such method fetch_row_array - it should be fetchrow_array. In: $ENV{NLS_LANG} = ""AMERICAN_AMERICA.WE8ISO8859P1" there is an extra ". In: select_scalar("SELECT 1..... you have missed off the $dbi argument select_scalar requires. It is also a good idea to put RaiseError=>1 in you DBI connect for examples like this so any errors are trapped and use strict, use warnings never goes amiss. So fixing all of that we have: use strict; use warnings; use DBI; $ENV{NLS_LANG} = "AMERICAN_AMERICA.WE8ISO8859P1"; my $dbi = DBI->connect('dbi:Oracle:xxx','xxx','xxx',{RaiseError=>1}) || die $DBI::errstr; my $c = chr(228); print "result: ", select_scalar($dbi, "SELECT 1 FROM DUAL WHERE '$c' = chr(228)"), "\n"; sub select_scalar { my ($dbi, $sql) = @_; my $sth = $dbi->prepare($sql); $sth->execute(); my $r = $sth->fetchrow_array(); return $r->[0]; } I think you may be on rather too old an Oracle (at 8) for this. What do you get when you add: my $sth = $dbi->prepare(q{select chr(228) from dual}); $sth->execute; DBI::dump_results($sth); just after the connect call and what does: my $nls_params = $dbi->ora_nls_parameters(); foreach my $k (keys %$nls_params) { print "$k, $nls_params->{$k}\n"; } output. Rather interestingly I get "DBD::Oracle::st fetch failed: OR
Q&A Tutorials Poetry RecentThreads NewestNodes Donate What'sNew on Mar 28, 2012 at 11:58UTC ( #962166=perlquestion: print w/replies, xml ) Need Help?? Skeeve has asked for the wisdom of the Perl Monks concerning the following question: I'm encountering strange errors when using placeholders in an sql query, using an Oracle database. For example this query gives me DBD::Oracle::db prepare failed: ORA-00907: missing right parenthesis ( +DBD ERROR: error possibly near <*> indicator at char 114 in ' sele +ct (FROM_TZ( CAST(sysdate as timestamp) , :timezone ) <*>AT TIME ZONE :timezone ) AS MY_RESULT from dual ... [download] This http://www.nntp.perl.org/group/perl.dbi.users/2007/11/msg32238.html is the code I use: use strict; use warnings; use DBI; my $sid='MYDB'; my $user='myuser'; my $pass='mypass'; my $dbh = DBI->connect("dbi:Oracle:$sid", $user, $pass, { AutoCommit => 0, RaiseError => 0, PrintErro +r => 1 } ); my $sth= $dbh->prepare(<
Sign in Pricing Blog Support Search GitHub This repository Watch 29 Star 127 Fork 61 darold/ora2pg Code https://github.com/darold/ora2pg/issues/168 Issues 4 Pull requests 0 Projects 0 Pulse Graphs New issue http://www.dba-oracle.com/t_ora_08103_object_no_longer_exists.htm Can not export full table #168 Closed alexign opened this Issue Feb 25, 2016 · 6 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants alexign commented Feb 25, 2016 Hello! ora2pg dbd error version 16.2 I have some error while exporting one table : CREATE TABLE "*****"."FGROUP" ( "I*" NUMBER(18,0) NOT NULL ENABLE, "VER**ON" NUMBER(15,0), "OBJ**T_NAME" VARCHAR2(255 BYTE) NOT NULL ENABLE, "BO**" CLOB, "ALGO**THM" VARCHAR2(30 BYTE), "CLAS**AME" VARCHAR2(255 BYTE), "FGROU**EADER_ID" NUMBER(18,0) NOT NULL ENABLE, "FG_VE**ION" NUMBER(18,0) NOT NULL ENABLE, "FG_**TE" TIMESTAMP (6) NOT NULL ENABLE, CONSTRAINT "UQ_FG**UP" dbd error ocistmtfetch UNIQUE ("FGROU**EADER_ID", "FG_VE**ION") CONSTRAINT "PK_FG**UP" PRIMARY KEY ("I*") CONSTRAINT "FK_FG**UP_FGROUPHEADER" FOREIGN KEY ("FGROU**EADER_ID") REFERENCES "*****"."FGROUPHEADER" ("I*") ENABLE ) After export : -- oracle select count(*) from *******.fg***up COUNT(*) ---------- 930 -- PG COUNT(*) ---------- 820 Here is the error(object and schema name masked by *): [root@ol7g1 ***_project]# ora2pg --namespace ******* --type COPY -a 'TABLE[FGROUP]' -u system -w oracle -s 'dbi:Oracle:host=localhost;port=1524;sid=***' -o FGROUP_data.sql -l FGROUP_data.log --nls_lang 'AMERICAN_AMERICA.UTF8' [========================>] 1/1 tables (100.0%) end of scanning. DBD::Oracle::db prepare failed: ORA-24338: statement handle not executed (DBD ERROR: OCIAttrGet OCI_ATTR_PARAM_COUNT) [for Statement "SELECT DISTINCT OBJECT_NAME,OWNER FROM DBA_OBJECTS WHERE OBJECT_TYPE='TYPE' AND OBJECT_NAME='TIMESTAMP(6)' AND GENERATED='N'AND OWNER='*******' ORDER BY OBJECT_NAME"] at /root/perl5/lib/perl5/Ora2Pg.pm line 8029. DBD::Oracle::db prepare failed: ORA-01002: fetch out of sequence (DBD ERROR: OCIStmtExecute/Describe) [for Statement "SELECT DISTINCT OBJECT_NAME,OWNER FROM DBA_OBJECTS WHERE OBJECT_TYPE='TYPE' AND OBJECT_NAME='TIMESTAMP(6)' AND GENERATED='N'AND OWNER='*******' ORDER BY OBJECT_NAME"] at /root/perl5/lib/perl5/Ora2Pg.pm line 8029. DBD::Oracle::db disconnect failed: ORA-01013: user requested cancel of current operation (DBD ERROR: OCISessionEnd) at /root/perl5/lib/perl5/Ora2Pg.pm line 9643. Aborting export... DBD::Oracle::s
SQL TuningSecurityOracle UNIXOracle LinuxMonitoringRemote supportRemote plansRemote servicesApplication Server ApplicationsOracle FormsOracle PortalApp UpgradesSQL ServerOracle ConceptsSoftware SupportRemote Support Development Implementation Consulting StaffConsulting PricesHelp Wanted! Oracle PostersOracle Books Oracle Scripts Ion Excel-DB Don Burleson Blog
ORA-08103: object no longer exists tips Oracle Error Tips by Stephanie F. Question: I am getting the ORA-08103 error when trying to create an index. How do I fix the ORA-08103 error? Answer: The Oracle docs note this on the ora-08103 error: ORA-08103 object no longer exists Cause: The object has been deleted by another user since the operation began. Or a prior incomplete recovery restored the database to a point in time during the deletion of the object Action: Remove references to the object or delete the object if this is the result of an incomplete recovery. Internet sources show that there are many bugs associated with ORA-08103. A description of the error per the documents is as follows: This error can occur, if the header block has an invalid block type or data_object_id (seg/obj) stored in the block is different than the data_object_id stored in the segment header. This error can be treated as a block corruption. There are several likely reasons for this error, and you should always check your alert log for details. This error often requires opening a service request with MOSC: 0: A software bug (see list below). 1: You are not signed-on as the table owner. 2: Database corruption of a header block.3: Accidental delete of the target table. (check the recyclebin) 4: Data file I/O error (check alert log) 5: corruption in UNDO log (drop and re-create) 6. An index is disabled or is offline. Possible solution include: 1: Set db_file_multiblock_read_count to 1. 2: Run dbv on all data files. 3: Run catalog.sql, catproc.sql and utlrp.sql to ensure no data dictionary corruption. 4: Purge recyclebin & dba_recyclebin. 5: When the ORA-08103 is on an index operation, place the index online or make index usable select index_name , status from user_indexes; INDEX_NAME STATUS ------------------------------ -------- IDX_CUST UNUSABLE alter index idx_cust rebuild online; Bugs and ORA-08103 Below are the twelve bugs which contain ORA-08103 in Oracle Enterprise Edition; version 11g Bug 13618170 ORA-8103 for