VARCHAR problem with ORAData
Hello,
I am trying to implement Object functionilities of Oracle.
My ORAData implementation is now working correctly, well at least working correctly for integer values. For VARCHAR fields I am getting garbage.
The query that I am using for ORAData is giving correct values at SQLPlus but when I query inside the Java application I am getting garbage.
So is there something, is an encoded string is coming from Database????
Thx in advance.
MS
Add nls_charset12.jar to your runtime classpath or characters will display in hexadecimal.
Similar Messages
-
Problem with JDBC and VARCHAR-Columns
Hi,
i have a problem handling VARCHAR-Columns via JDBC.
I.e. by using the JDBC-components of <SunONE Community Edition Update 1> any attempt to store any other then numeric values (like "0", "01", "999" etc.) in a column of type VARCHAR results in an error.
After entering the string "test" in a JTextArea or JTextField (which is linked by its document to the VARCHAR-column) i will receive:
"java.lang.NumberFormatException: For input string: "st"/For input string: "st". I also tried the javax.sql. rowSet methods like updateString() with the same result.
Are there any knwon issues corresponding to this behaviour?
<b>Configuration details:</b>
<i>JDBC-Driver:</i>
package com.sap.dbtech.jdbc, MaxDB JDBC Driver, MySQL MaxDB, 7.5.1 Build 000-000-002-750 on Java 1.4.2
<i>Database-version:</i>
7.5.00.16 on WindowsXP Pro SP1
<i>JRE:</i>
1.4.1_02
The <i>trace-file</i> only show this statements:
[email protected] (UPDATE NOTARZTEINSATZPROTOKOLL_1 SET NEUROLOGISCHER_ERSTBEFUND = ? WHERE NAP_ID = ? AND EP_ID = ? AND BEMERKUNG IS NULL AND SOZ_ID IS NULL AND PSYZ_ID IS NULL AND ERSTBEFUND_ZEITPUNKT IS NULL AND GCSAO_ID_EB IS NULL AND GCSBVR_ID_EB IS NULL AND GCSBMR_ID_ARMLINKS_EB IS NULL AND GCSBMR_ID_ARMRECHTS_EB IS NULL AND GCSBMR_ID_BEINLINKS_EB IS NULL AND GCSBMR_ID_BEINRECHTS_EB IS NULL AND BWSL_ID_EB IS NULL AND EXTB_ID_ARMLINKS_EB IS NULL AND EXTB_ID_ARMRECHTS_EB IS NULL AND EXTB_ID_BEINLINKS_EB IS NULL AND EXTB_ID_BEINRECHTS_EB IS NULL AND PUPW_ID_LINKS_EB IS NULL AND PUPW_ID_RECHTS_EB IS NULL AND EJN_ID_FEHLTLICHTR_LI_EB IS NULL AND EJN_ID_FEHLTLICHTR_RE_EB IS NULL AND EJN_ID_MENINGISMUS_EB IS NULL AND NEUROLOGISCHER_ERSTBEFUND IS NULL AND TEMPERATUR_EB IS NULL AND RR_SYSTOLISCH_EB IS NULL AND RR_DIASTOLISCH_EB IS NULL AND HERZFREQUENZ_EB IS NULL AND EJN_ID_HF_REGELM_EB IS NULL AND BLUTZUCKER_EB IS NULL AND ATEMFREQUENZ_EB IS NULL AND SPO2_EB IS NULL AND CO2_EB IS NULL AND SCHM_ID_EB IS NULL AND ERH_ID_COR_EB IS NULL AND EELS_ID_COR_EB IS NULL AND EJN_ID_EKG_EMENTKOPPEL_EB IS NULL AND EERBST_ID_COR_EB IS NULL AND EHA_ID_COR_EB IS NULL AND ESVES_ID_COR_EB IS NULL AND EVES_ID_COR_EB IS NULL AND EKG_BEMERKUNG_EB IS NULL AND ATRH_ID_EB IS NULL AND EJN_ID_ZYANOSE_EB IS NULL AND EJN_ID_SPASTIK_EB IS NULL AND EJN_ID_RASSELGER_EB IS NULL AND EJN_ID_STRIDOR_EB IS NULL AND EJN_ID_VERLEGATEMW_EB IS NULL AND BEAM_ID_UEBERNAHME IS NULL AND ATMUNG_FREITEXT_EB IS NULL AND VERLM_ID IS NULL AND SCHWV_ID_SCHAEDELHIRN IS NULL AND SCHWV_ID_GESICHT IS NULL AND SCHWV_ID_HWS IS NULL AND SCHWV_ID_THORAX IS NULL AND SCHWV_ID_ABDOMEN IS NULL AND SCHWV_ID_BWSLWS IS NULL AND SCHWV_ID_BECKEN IS NULL AND SCHWV_ID_OEXTREMITAET IS NULL AND SCHWV_ID_UEXTREMITAET IS NULL AND SCHWV_ID_WEICHTEILE IS NULL AND VBRT_ID IS NULL AND TRT_ID IS NULL AND UHG_ID IS NULL AND SICHTK_ID IS NULL AND UNFALLZEITPUNKT IS NULL AND SAPS_2 IS NULL AND TISS_28 IS NULL AND NACA_ID IS NULL AND ZBV IS NULL )
=> com.sap.dbtech.jdbc.CallableStatementSapDB@11daf60
<at this position the trace-file ends?!; "NEUROLOGISCHER_ERSTBEFUND ist defined as
"NEUROLOGISCHER_ERSTBEFUND" Varchar (1000) ASCII; i also encountered this problem while handling shorter VARCHAR-columns with JComboBox-components...>
Any information would be very helpfully!!!
Greetings,
Arnd
Message was edited by: Arnd Benninghoff
Message was edited by: Arnd BenninghoffHi Arnd,
if I understand right you are trying to insert/update value into a Varchar(1000) column. And if you set a non numeric value you get an exception "java.lang.NumberFormatException", Right?
Of course this should work with MaxDB. The exception you get doesn't come from MaxDB's JDBC driver. The driver will only throw exceptions that are derived from java.sql.Exception.
So, I guess the error comes from a layer above the JDBC layer, possibly from the JDBC-components of <SunONE Community Edition Update 1>. This would also explain why you don't see any exception in the JDBC trace.
Did you have defined any constraints for the input field (JTextArea or JTextField)?
Hope that helps.
regards,
Marco -
Problem with varchar keycolumn
Hi
I am configuring an unidirectional replication from Oracle to Oracle, but i get the following error on my replicat process
when updating a row on the source database which primary key is a varchar value.
2012-09-20 17:11:37 WARNING OGG-01004 Aborted grouped transaction on 'SCH.TABLE', Database error 1403 (O
CI Error ORA-01403: no data found, SQL <UPDATE "SCH"."TABLE" SET "SOME_DATE" = :a1 WHERE "ID_VALUE" = :b0>).
I issue the following command on source database and it works fine:
UPDATE "SCH"."TABLE" SET "SOME_DATE" = sysdate+10 WHERE ID_VALUE = '001031';
But on target database the replicat process throws that error "ORA-01403" and then ABENDS, even that the row does exist on the
target database.
I have tried using a deffile with the same result, and i don't want to discard the row because i need both databases to be sync.
Is this happening because the keyvalue has "0" characters at the begging?
Is there any parameter that i should use to indicate the replicat this kind of values is spected?
Thankyou.The error was due to i didn't execute the command ADD TRANDATA on my table
i thought that it was enough with adding SUPPLEMENTAL LOG DATA to the database.
I configured a discard file and here is what is show:
Discarded record from action ABEND on error 1403
OCI Error ORA-01403: no data found, SQL <UPDATE "SCH"."TABLE" SET "SOME_DATE" = :a1 WHERE "VALUE_ID" = :b0>
Aborting transaction on /u01/ogg/dirdat/rc beginning at seqno 4 rba 1855
error at seqno 4 rba 1855
Problem replicating SCH.TABLE to SCH.TABLE
Record not found
Mapping problem with compressed update record (target format)...
VALUE_ID =
SOME_DATE = 2012-10-10 16:16:27
The error of no data found is due to the keycolumn is null because of the lack of the tranddata. -
Problem with exp/imp transport_tablespace=y & CLOBs
All,
I am having a problem with values in a CLOB column when exporting/importing a database using "transport_tablespace" command line option.
Some background:
Origin: 9i Windows
Destination: 10g Windows
Export/import work without warnings. But this SQL command:
SELECT DUMP(CAST(TEXT_VALUE AS VARCHAR(4000)), 1017)
FROM SE_PSOI.SEPROPTEXT
WHERE TEXT_ID = 316161
Gives me from the 9i database:
Typ=1 Len=18 CharacterSet=UTF8: U,n,d,e,r, ,C,o,n,s,t,r,u,c,t,i,o,n
But the following from the 10g database:
Typ=1 Len=54 CharacterSet=UTF8: e5,94,80,e6,b8,80,e6,90,80,e6,94,80,e7,88,80,e2,80,80,e4,8c,80,e6,bc,80,e6,b8,80,e7,8c,80,e7,90,80,e7,88,80,e7,94,80,e6,8c,80,e7,90,80,e6,a4,80,e6,bc,80,e6,b8,80
It appears as if there is some sort of charset issue to me. I've tried working with the environment NLS_LANG value when I export and import (and other text values come through OK - just the CLOB is the problem). After Googling and searching the forums here I am unable to find an answer.
Can someone help me or point me in the right direction?
Regards,
Matthew Leskoi got an error:
IMP-00003: ORACLE ERROR 1565 encountered
ORA-01565: error in identified file '/u01/app/oracle/oradata/test201.dbf'
my question can we import transport_tablespaces=y with two tablespaces and four datafiles ???
First Check, What is the status of the datafiles.
SQL> select file_name,online_status from dba_data_files where file_name like '%test201%';
also
$ ls -ltr /u01/app/oracle/oradata/test201.dbf -
I have a problem with JDBC Realm in Tomcat/Oracle/Win XP
I have a problem with JDBC Realm in Tomcat.
I have attached my server.xml file located in the
C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml
The Problem is that when I login I get the user name and password prompt but it does not resolve.
When I enter in the tomcat-users.xml password with memory realm uncommented it works fine.
C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml
Is there a cache or something I need to reset for the JDBC Realm to work?
I have attached my tables and contents as well...
Did I miss something????
Thanks
Phil
server.xml
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
</GlobalNamingResources>
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina">
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector
port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost">
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@localhost:1521:orcl"
connectionName="testName" connectionPassword="testPass"
userTable="users"
userNameCol="user_name"
userCredCol="user_pass"
userRoleTable="user_roles"
roleNameCol="role_name" />
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
</Server>
Tables
create table users
user_name varchar(15) not null primary key,
user_pass varchar(15) not null
create table roles
role_name varchar(15) not null primary key
create table user_roles
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key( user_name, role_name )
select * from users;
----------------------+
| user_name | user_pass |
----------------------+
| tomcat | tomcat |
| user1 | tomcat |
| user2 | tomcat |
| user3 | tomcat |
----------------------+
select * from roles;
| role_name |
| tomcat |
| role1 |
select * from user_roles;
-----------------------+
| role_name | user_name |
-----------------------+
| tomcat | user1 |
| role1 | user2 |
| tomcat | tomcat |
| role1 | tomcat |
-----------------------+Jan 2, 2008 11:49:35 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 2, 2008 11:49:35 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 734 ms
Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
Jan 2, 2008 11:49:35 AM org.apache.catalina.realm.JDBCRealm start
SEVERE: Exception opening database connection
java.sql.SQLException: oracle.jdbc.driver.OracleDriver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:684)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:758)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1004)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jan 2, 2008 11:49:36 AM org.apache.catalina.core.StandardContext resourcesStart -
Problem with dynamic LOV and function
Hello all!
I'm having a problem with a dynamic lov in APEX 3.0.1.00.08. Hope you can help me!
I have Report and Form application. On the Form page i have a Page Item (Popup Key LOV (Displays description, returns key value)).
When i submit the sql code in the 'List of vaules defention' box. I get the following message;
1 error has occurred
LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
When i excecute the code below in TOAD or in the SQL Workshop it returns the values i want to see. But somehow APEX doesn't like the sql....
SELECT REC_OMSCHRIJVING d, REC_DNS_ID r FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
returns_dns_lov_fn is a function, code is below;
CREATE OR REPLACE FUNCTION DRSSYS.return_dns_lov_fn (p2_dns_id number)
RETURN dns_table_type
AS
v_data dns_table_type := dns_table_type ();
BEGIN
IF p2_dns_id = 2
THEN
FOR c IN (SELECT dns_id dns, omschrijving oms
FROM d_status dst
WHERE dst.dns_id IN (8, 10))
LOOP
v_data.EXTEND;
v_data (v_data.COUNT) := dns_rectype (c.dns, c.oms);
END LOOP;
RETURN v_data;
END IF;
END;
and the types;
CREATE OR REPLACE TYPE DRSSYS.dns_rectype AS OBJECT (rec_dns_id NUMBER, rec_omschrijving VARCHAR2(255));
CREATE OR REPLACE TYPE DRSSYS.dns_table_type AS TABLE OF dns_rectype;
I tried some things i found on this forum, but they didn't work as well;
SELECT REC_OMSCHRIJVING display_value, REC_DNS_ID result_display FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
SELECT REC_OMSCHRIJVING display_value d, REC_DNS_ID result_display r FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
SELECT a.REC_OMSCHRIJVING display_value, a.REC_DNS_ID result_display FROM
TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) a order by 1
Edited by: rajan.arkenbout on 8-mei-2009 14:41
Edited by: rajan.arkenbout on 8-mei-2009 14:51I just had the same problem when I used a function in a where clause.
I have a function that checks if the current user has acces or not (returning varchar 'Y' or 'N').
In where clause I have this:
where myFunction(:user, somePK) = 'Y'
It seems that when APEX checked if my query was valid, my function triggered and exception.
As Varad pointed out, check for exception that could be triggered by a null 'p2_dns_id'
Hope that helped you out.
Max -
Hi
I am using Flex to insert data through remoteobject and using
SAVE method generated from CFC Wizard.
My VO contains the following variables where id has a default
value of 0 :
public var id:Number = 0 ;
public var date:String = "";
public var accountno:String = "";
public var debit:Number = 0;
public var credit:Number = 0;
id is set as the primary key in my database.
I have previously used MySQL which automatically generates a
new id if I either omitted the id value in my insert statement or
use 0 as the default value.
However, now I am using MS SQL Server and the insert
generated this error:
Unable to invoke CFC - Error Executing Database Query.
Detail:
[Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert
explicit value for identity column in table 'Transactions' when
IDENTITY_INSERT is set to OFF.
Strange thing is that I dont see this problem with another
sample application. I compared with that application (it has the
same VO with default value of 0 for id) and everything looks
similar so I can't understand why I have this error in my
application.
This is SQL used to create the table:
USE [Transactions]
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
CREATE TABLE [dbo].[Transactions](
[id] [int] IDENTITY(1,1) NOT NULL,
[date] [datetime] NULL,
[accountno] [varchar](100) NULL,
[debit] [int] NULL,
[credit] [int] NULL,
CONSTRAINT [PK_Transactions] PRIMARY KEY CLUSTERED
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE =
OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Has anyone encountered this problem before with insert
statements dealing with a unique id (with MS SQL Server)?Change "addRecords =
connection.prepareStatement("
to "addRecords =
connection.preparedStatement("
-BIGD -
Problem with BigInteger and MySql
Hi !!
I've a problem with BigInteger and MySql.
I've a BigInteger object (suppose that value is 0.02270412445068359375).
I must store that value in a database (MySql).
The value of BigInteger object must be stored in a column of type Decimal.
Stored value is 0.022704124450683594. Why ??
My target is to store 0.02270412445068359375
Can anyone help me?
Thanks.Hi !!
I've a problem with BigInteger and MySql.
I've a BigInteger object (suppose that value is
0.02270412445068359375).
I must store that value in a database (MySql).
The value of BigInteger object must be stored in a
column of type Decimal.if this is the case I fear you are SOL. a decimal is the same size as a double but with a fixed max number of decimal places. if it isn't big enough then you have no real choice other than to VARCHAR it.
Stored value is 0.022704124450683594. Why ??
My target is to store 0.02270412445068359375
Can anyone help me?
Thanks. -
Problem with procedure in package
Problem with procedure in package:
create table accounts
(acno number(10),
name varchar2(20),
balance number(10,2));
create package banking is
procedure new_acct(acno NUMBER, name IN VARCHAR);
procedure acct_dep(acno IN NUMBER, amount IN NUMBER);
procedure acc_wdr(acno IN NUMBER, amount IN NUMBER);
procedure acc_bal(acno IN NUMBER, bal OUT NUMBER);
function acc_drwn(acno IN NUMBER) RETURN BOOLEAN;
end banking;
create or replace package body banking is
procedure new_acct ( acno IN number,
name IN varchar) is
begin
insert into accounts
(acno, name, balance)
values
(acno, name,0);
end;
procedure acct_dep(acno IN NUMBER,
amount IN NUMBER) is
begin
update accounts
set balance = balance + amount
where acno = acno;
end;
procedure acc_wdr(acno IN NUMBER,
amount IN NUMBER) is
begin
update accounts
set balance = balance - amount
where acno = acno;
end;
procedure acc_bal(acno IN NUMBER,
bal OUT NUMBER) is
begin
declare cursor c_balance(i_acno IN accounts.acno%type) is
select balance
from accounts
where acno = i_acno;
acc_bal accounts.balance%type;
begin
if c_balance%isopen then
close c_balance;
end if;
open c_balance(acno);
fetch c_balance into acc_bal;
close c_balance;
end;
end;
function acc_drwn(acno IN NUMBER) RETURN BOOLEAN is
begin
declare cursor c_balance(i_acno IN accounts.acno%type) is
select balance
from accounts
where acno = i_acno;
bal accounts.balance%type;
begin
if c_balance%isopen then
close c_balance;
end if;
open c_balance(acno);
fetch c_balance into bal;
close c_balance;
if bal < 0 then
return true;
else
return false;
end if;
end;
end;
end banking;
begin
banking.new_acct(123,'FRANKS');
end;
execute banking.acct_dep(123,100);
execute banking.acc_wdr(123,50);
Works fine up to this point, however when running the balance check the balance amount is not visible?
SQL> set serveroutput on
SQL> begin
2 declare
3 bal accounts.balance%type;
4 begin
5 banking.acc_bal(123,bal);
6 dbms_output.put_line('Franks balance is '||bal);
7 end;
8 end;
9 /procedure acc_bal(acno IN NUMBER,
bal OUT NUMBER)
is
cursor c_balance(i_acno IN accounts.acno%type) is
select balance
from accounts
where acno = i_acno;
l_acc_bal accounts.balance%type;
begin
open c_balance(acno);
fetch c_balance into l_acc_bal;
close c_balance;
bal := l_acc_bal;
end; -
Hi guys, I'm having problem with Amarok 2. When I start it the notification says "The audio playback device HDA Intel (CONEXANT Analog) does not work. Falling back to HDA NVidia, HDMI 0 (HDMI Audio Output) ". Amarok starts normally but can't open any song. The same thing happens when I try to open a video with Dragon player(but I don't use so this doesn't matter).
VLC, MPlayer and Youtube have no problem playing videos or sounds, so I could play music with VLC but you'd agree it's not really a music player.
(I tried installing Clementine, but it has it's own problems, saying "Your GStreamer installation is missing a plug-in." (but I don't like Clementine anyway))
Another thing that bothers me is that the hardware sound buttons don't affect these programs.
Could someone help me with this?there are these errors (several times):
amarok: [CollectionDB] [ERROR!] [virtual QStringList SqliteConnection::query(const QString&)] sqlite3_compile error:
amarok: [CollectionDB] [ERROR!] no such table: directories
amarok: [CollectionDB] [ERROR!] on query: SELECT dir, changedate FROM directories;
amarok: [void CollectionDB::createTables(DbConnection*)]
amarok: [CollectionDB] [ERROR!] [virtual QStringList SqliteConnection::query(const QString&)] sqlite3_compile error:
amarok: [CollectionDB] [ERROR!] table amazon already exists
amarok: [CollectionDB] [ERROR!] on query: CREATE TABLE amazon ( asin VARCHAR(20), locale VARCHAR(2), filename VARCHAR(33), refetchdate INTEGER );
amarok: [CollectionDB] [ERROR!] [virtual int SqliteConnection::insert(const QString&, const QString&)] sqlite3_compile error:
amarok: [CollectionDB] [ERROR!] no such table: directories
amarok: [CollectionDB] [ERROR!] on insert: INSERT INTO directories SELECT * FROM directories_temp;
QDom: saving invalid character , the document will not be well-formed
and when I try to create a playlist it looks normal:
amarok: [PlaylistBrowser] Creating playlist
amarok: [PlaylistBrowser] Saving Playlist to: /home/matej/.kde/share/apps/amarok/playlists/Untitled.m3u
amarok: Loading playlist
amarok: [ThreadWeaver] Job completed: PlaylistReader. Jobs pending: 0
and also load one:
amarok: Loading playlist
amarok: [ThreadWeaver] Job completed: PlaylistReader. Jobs pending: 0
There are also some errors of GUI (QT, KDE), but these are I think a little bit off-topic. -
Problem with JPA Implementations and SQL BIGINT in primary keys
I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
Here is the case:
Table definition:
/*==============================================================*/
/* Table: CmdQueueIn */
/*==============================================================*/
create table MTRACKER.CmdQueueIn
CmdQueueInId bigint not null global autoincrement,
Type int,
Cmd varchar(2048),
CmdState int,
MLUser bigint not null,
ExecutionTime timestamp,
FinishTime timestamp,
ExecutionServer varchar(64),
ScheduleString varchar(64),
RetryCount int,
ResultMessage varchar(256),
RecordState int not null default 1,
CDate timestamp not null default current timestamp,
MDate timestamp not null default current timestamp,
constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
The java class for this table has the following annotation for the primary key field:
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "CmdQueueInId", nullable = false)
private BigInteger cmdQueueInId;
When using hibernate 3.2.1 as JPA provider I get the following exception:
avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
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:585)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
at $Proxy16.persist(Unknown Source)
at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
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:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at
Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
... 34 more
This means, that their ID generator does not support java.math.BigInteger as datatype.
But the code works if I take TopLink essentials as JPA Provider.
Looking at the spec shows the following:
In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
Many thanks for your input and feedback.
TomNot sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
"I select a value from LOV and this value don't refresh in the view"
If you mean ViewObject, check if autoSubmit property is set to true.
Amit -
Another problem with updating in ms access
Hello there,
Me too has a problem with the update statement and ms access (using 2003).
I've read many other problems, but a way to the solution that worked for I didn't found :S
The strange thing with my problem is that i'm able to update integer fields in the database, but not varchar/text fields.
I'm not getting any exception back, the database is closed (i'm very sure), so HELP! :)
I'll show you the code i'm connecting with the database:
public void openDatabaseConnection() {
// Eerst controleren of de DatabaseDriver wel aanwezig is.
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch (Exception e) {
System.out.println("Looking for Class: " + e.toString());
// Nu kan de connectie met de database opgezet worden.
try {
theDatabaseConnection = DriverManager.getConnection("jdbc:odbc:Shawa","","ShaBaMa");
catch (SQLException ex) {
System.out.println("openDatabaseConnection: SQLException: " + ex.getMessage());
System.out.println("openDatabaseConnection: SQLState: " + ex.getSQLState());
System.out.println("openDatabaseConnection: VendorError: " + ex.getErrorCode());
}The code for updating an integer field (wich is working!) is like this:
public Customer cashCustomer(Customer aCustomer){
PreparedStatement pstmt;
ResultSet result;
try{
openDatabaseConnection();
pstmt = theDatabaseConnection.prepareStatement("UPDATE customer SET aantal_bier = aantal_bier + ?, aantal_fris = aantal_fris + ? WHERE id=?");
pstmt.setInt(1, aCustomer.getCashBeer());
pstmt.setInt(2, aCustomer.getCashSoda());
pstmt.setInt(3, aCustomer.getId());
theDatabaseConnection.setAutoCommit(false);
pstmt.executeUpdate();
theDatabaseConnection.commit();
pstmt.close();
theDatabaseConnection.close();
catch (SQLException eSql){
System.out.println("Cash Customer: " + eSql.toString());
System.out.println("Cash Customer: SQLException: " + eSql.getMessage());
System.out.println("Cash Customer: SQLState: " + eSql.getSQLState());
System.out.println("Cash Customer: VendorError: " + eSql.getErrorCode());
return aCustomer;
}Now the code for updating Varchar/text fields (wich is not working):
public Customer editCustomer(Customer aCustomer){
PreparedStatement pstmt;
ResultSet result;
try{
openDatabaseConnection();
pstmt = theDatabaseConnection.prepareStatement("UPDATE customer SET name=? , lastname=?, onderdeel=?, aantal_bier=?, aantal_fris=?, op_kaart=? WHERE id=?");
pstmt.setString(1, aCustomer.getName());
pstmt.setString(2, aCustomer.getLastname());
pstmt.setString(3, aCustomer.getSection());
pstmt.setInt(4, aCustomer.getBeer());
pstmt.setInt(5, aCustomer.getSoda());
pstmt.setInt(6, aCustomer.getId());
pstmt.setString(7, aCustomer.getAddCash());
theDatabaseConnection.setAutoCommit(false);
pstmt.executeUpdate();
theDatabaseConnection.commit();
pstmt.close();
theDatabaseConnection.close();
catch (SQLException eSql){
System.out.println("Updating Customer: " + eSql.toString());
System.out.println("Updating Customer: SQLException: " + eSql.getMessage());
System.out.println("Updating Customer: SQLState: " + eSql.getSQLState());
System.out.println("Updating Customer: VendorError: " + eSql.getErrorCode());
return aCustomer;
}I can add and delete from the database. The thing with the ' ' didn't work for me too.
Anybody a solution for me??? plz plz plz!You are updating zero records. Because you are filling in the parameter ofWHERE id=?with this code:pstmt.setString(7, aCustomer.getAddCash());The executeUpdate() method returns the number of records affected, if you wish to check that.
-
I have one problem with Data Guard. My archive log files are not applied.
I have one problem with Data Guard. My archive log files are not applied. However I have received all archive log files to my physical Standby db
I have created a Physical Standby database on Oracle 10gR2 (Windows XP professional). Primary database is on another computer.
In Enterprise Manager on Primary database it looks ok. I get the following message Data Guard status Normal
But as I wrote above the archive log files are not applied
After I created the Physical Standby database, I have also done:
1. I connected to the Physical Standby database instance.
CONNECT SYS/SYS@luda AS SYSDBA
2. I started the Oracle instance at the Physical Standby database without mounting the database.
STARTUP NOMOUNT PFILE=C:\oracle\product\10.2.0\db_1\database\initluda.ora
3. I mounted the Physical Standby database:
ALTER DATABASE MOUNT STANDBY DATABASE
4. I started redo apply on Physical Standby database
alter database recover managed standby database disconnect from session
5. I switched the log files on Physical Standby database
alter system switch logfile
6. I verified the redo data was received and archived on Physical Standby database
select sequence#, first_time, next_time from v$archived_log order by sequence#
SEQUENCE# FIRST_TIME NEXT_TIME
3 2006-06-27 2006-06-27
4 2006-06-27 2006-06-27
5 2006-06-27 2006-06-27
6 2006-06-27 2006-06-27
7 2006-06-27 2006-06-27
8 2006-06-27 2006-06-27
7. I verified the archived redo log files were applied on Physical Standby database
select sequence#,applied from v$archived_log;
SEQUENCE# APP
4 NO
3 NO
5 NO
6 NO
7 NO
8 NO
8. on Physical Standby database
select * from v$archive_gap;
No rows
9. on Physical Standby database
SELECT MESSAGE FROM V$DATAGUARD_STATUS;
MESSAGE
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC4: Archival started
ARC5: Archival started
ARC6: Archival started
ARC7: Archival started
ARC8: Archival started
ARC9: Archival started
ARCa: Archival started
ARCb: Archival started
ARCc: Archival started
ARCd: Archival started
ARCe: Archival started
ARCf: Archival started
ARCg: Archival started
ARCh: Archival started
ARCi: Archival started
ARCj: Archival started
ARCk: Archival started
ARCl: Archival started
ARCm: Archival started
ARCn: Archival started
ARCo: Archival started
ARCp: Archival started
ARCq: Archival started
ARCr: Archival started
ARCs: Archival started
ARCt: Archival started
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC1: Becoming the heartbeat ARCH
Attempt to start background Managed Standby Recovery process
MRP0: Background Managed Standby Recovery process started
Managed Standby Recovery not using Real Time Apply
MRP0: Background Media Recovery terminated with error 1110
MRP0: Background Media Recovery process shutdown
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[1]: Assigned to RFS process 2148
RFS[1]: Identified database type as 'physical standby'
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 2384
RFS[2]: Identified database type as 'physical standby'
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[3]: Assigned to RFS process 3188
RFS[3]: Identified database type as 'physical standby'
Primary database is in MAXIMUM PERFORMANCE mode
Primary database is in MAXIMUM PERFORMANCE mode
RFS[3]: No standby redo logfiles created
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[4]: Assigned to RFS process 3168
RFS[4]: Identified database type as 'physical standby'
RFS[4]: No standby redo logfiles created
Primary database is in MAXIMUM PERFORMANCE mode
RFS[3]: No standby redo logfiles created
10. on Physical Standby database
SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;
PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
ARCH CONNECTED 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 0 0 0 0
RFS IDLE 1 9 13664 2
RFS IDLE 0 0 0 0
10) on Primary database:
select message from v$dataguard_status;
MESSAGE
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC4: Archival started
ARC5: Archival started
ARC6: Archival started
ARC7: Archival started
ARC8: Archival started
ARC9: Archival started
ARCa: Archival started
ARCb: Archival started
ARCc: Archival started
ARCd: Archival started
ARCe: Archival started
ARCf: Archival started
ARCg: Archival started
ARCh: Archival started
ARCi: Archival started
ARCj: Archival started
ARCk: Archival started
ARCl: Archival started
ARCm: Archival started
ARCn: Archival started
ARCo: Archival started
ARCp: Archival started
ARCq: Archival started
ARCr: Archival started
ARCs: Archival started
ARCt: Archival started
ARCm: Becoming the 'no FAL' ARCH
ARCm: Becoming the 'no SRL' ARCH
ARCd: Becoming the heartbeat ARCH
Error 1034 received logging on to the standby
Error 1034 received logging on to the standby
LGWR: Error 1034 creating archivelog file 'luda'
LNS: Failed to archive log 3 thread 1 sequence 7 (1034)
FAL[server, ARCh]: Error 1034 creating remote archivelog file 'luda'
11)on primary db
select name,sequence#,applied from v$archived_log;
NAME SEQUENCE# APP
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00003_0594204176.001 3 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00004_0594204176.001 4 NO
Luda 4 NO
Luda 3 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00005_0594204176.001 5 NO
Luda 5 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00006_0594204176.001 6 NO
Luda 6 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00007_0594204176.001 7 NO
Luda 7 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\IRINA\ARC00008_0594204176.001 8 NO
Luda 8 NO
12) on standby db
select name,sequence#,applied from v$archived_log;
NAME SEQUENCE# APP
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00004_0594204176.001 4 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00003_0594204176.001 3 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00005_0594204176.001 5 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00006_0594204176.001 6 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00007_0594204176.001 7 NO
C:\ORACLE\PRODUCT\10.2.0\ORADATA\LUDA\ARC00008_0594204176.001 8 NO
13) my init.ora files
On standby db
irina.__db_cache_size=79691776
irina.__java_pool_size=4194304
irina.__large_pool_size=4194304
irina.__shared_pool_size=75497472
irina.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0\admin\luda\adump'
*.background_dump_dest='C:\oracle\product\10.2.0\admin\luda\bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\oracle\product\10.2.0\oradata\luda\luda.ctl'
*.core_dump_dest='C:\oracle\product\10.2.0\admin\luda\cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='luda','irina'
*.db_name='irina'
*.db_unique_name='luda'
*.db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=irinaXDB)'
*.fal_client='luda'
*.fal_server='irina'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(irina,luda)'
*.log_archive_dest_1='LOCATION=C:/oracle/product/10.2.0/oradata/luda/ VALID_FOR=(ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME=luda'
*.log_archive_dest_2='SERVICE=irina LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME=irina'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=30
*.log_file_name_convert='C:/oracle/product/10.2.0/oradata/irina/','C:/oracle/product/10.2.0/oradata/luda/'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0\admin\luda\udump'
On primary db
irina.__db_cache_size=79691776
irina.__java_pool_size=4194304
irina.__large_pool_size=4194304
irina.__shared_pool_size=75497472
irina.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0/admin/irina/adump'
*.background_dump_dest='C:\oracle\product\10.2.0/admin/irina/bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\oracle\product\10.2.0\oradata\irina\control01.ctl','C:\oracle\product\10.2.0\oradata\irina\control02.ctl','C:\oracle\product\10.2.0\oradata\irina\control03.ctl'
*.core_dump_dest='C:\oracle\product\10.2.0/admin/irina/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='luda','irina'
*.db_name='irina'
*.db_recovery_file_dest='C:\oracle\product\10.2.0/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=irinaXDB)'
*.fal_client='irina'
*.fal_server='luda'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(irina,luda)'
*.log_archive_dest_1='LOCATION=C:/oracle/product/10.2.0/oradata/irina/ VALID_FOR=(ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME=irina'
*.log_archive_dest_2='SERVICE=luda LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME=luda'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=30
*.log_file_name_convert='C:/oracle/product/10.2.0/oradata/luda/','C:/oracle/product/10.2.0/oradata/irina/'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0/admin/irina/udump'
Please help me!!!!Hi,
After several tries my redo logs are applied now. I think in my case it had to do with the tnsnames.ora. At this moment I have both database in both tnsnames.ora files using the SID and not the SERVICE_NAME.
Now I want to use DGMGRL. Adding a configuration and a stand-by database is working fine, but when I try to enable the configuration DGMGRL gives no feedback and it looks like it is hanging. The log, although says that it succeeded.
In another session 'show configuration' results in the following, confirming that the enable succeeded.
DGMGRL> show configuration
Configuration
Name: avhtest
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
avhtest - Primary database
avhtestls53 - Physical standby database
Current status for "avhtest":
Warning: ORA-16610: command 'ENABLE CONFIGURATION' in progress
It there anybody that experienced the same problem and/or knows the solution to this?
With kind regards,
Martin Schaap -
Problems with date in procedure on Oracle 11g
Hi gurus,
I have some problems with the date format on Oracle 11g.
Let me explain the situation:
When I am starting a request like
select to_number(to_char(to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'))
from sys.dual
I got as result 2009 as number.
When I do the same in a procedure of a package like this
my_year := to_number(to_char(to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'));
the variable my_year contains the value 9 instead of 2009.
Can someone explain me what's going wrong?
I have just tested with changing the environment variable nls_date_format for the session and for the complete database with no success.
Regards,
BjörnThank you all for your replies so far:
@Alex: You are right, using your short script in sqlplus gives me also 2009 as result
So, I am now posting the essential excerpts of the procedure because the whole one is to large:
function insert_szrl (my_fremd_name varchar, my_elementadresse varchar,
my_zeitstempel varchar, my_wert float,
my_status varchar, my_zyklus varchar,
my_offset integer,
my_quelle varchar, my_nzm_daten integer) return integer is
begin
my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
if my_zyklus = 'mm' then
my_zeitstempeldate := add_months(to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy'),-1) +1 + (my_tageswechsel+1/24);
my_days := to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy') - add_months(to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy'),-1);
my_year := to_number(to_char(to_date(my_date,'dd.mm.yyyy'), 'yyyy'));
ptime.umschalttage_tuned (my_year, my_ws, my_sw);
end if;
While debugging the complete procedure I see since the start only a date which looks like '01.04.2009 07:00:00'
Edited by: user10994305 on 19.05.2009 15:58
Edited by: user10994305 on 19.05.2009 15:58 -
When trying to generate C-Code of the sample programs with the Pro*C compiler on a Redhat 9 Linux and Oracle 8.1.7, I have a problem with typedef __builtin_va_ as shown below. The $ORACLE_HOME/precomp/admin/pcscfg.cfg contains the following entries:
sys_include=(/usr/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include)
include=(/usr/include/linux)
include=(/usr/lib/gcc-lib/i386-redhat-linux7/2.96/include)
include=(/usr/local/oracle/product/8.1.7/precomp/public)
include=/usr/local/oracle/product/8.1.7/precomp/syshdr
include=/usr/local/oracle/product/8.1.7/rdbms/public
include=/usr/local/oracle/product/8.1.7/rdbms/demo
ltype=short
================
Pro*C/C++: Release 8.1.7.0.0 - Production on Mon Jun 7 13:26:06 2004
(c) Copyright 2000 Oracle Corporation. All rights reserved.
System default option values taken from: /usr/local/oracle/product/8.1.7/precomp/admin/pcscfg.cfg
Syntax error at line 43, column 9, file /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h:
Error at line 43, column 9 in file /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/incl
ude/stdarg.h
typedef __builtin_va_list __gnuc_va_list;
........1
PCC-S-02201, Encountered the symbol "__builtin_va_list" when expecting one of th
e following:
auto, char, const, double, enum, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
union, unsigned, utext, uvarchar, varchar, void, volatile,
a typedef name,
The symbol "enum," was substituted for "__builtin_va_list" to continue.Sorry! I have not explain it clearly.
To solve it , you do following :
1. locate stdarg.h ( or find /usr -name stdarg.h ), assume you find a stdarg.h in /usr/lib/gcc-lib/XXX/XXX/include/stdarg.h
2.ln -s /usr/lib/gcc-lib/XXX/XXX/include/stdarg.h /usr/include/stdarg.h or cp /usr/lib/gcc-lib/XXX/XXX/include/stdarg.h /usr/include
( above 2 step was to make Pro*C can find stdarg.h in /usr/include )
3. for file stddef.h do like step 1,2
4. append a line in your Pro*C config file:
CODE=ANSI_C
null
Maybe you are looking for
-
To video editors: What's the best software video encoder?
I'm relatively new to the encoding world, outside of .m2v for DVD. I have a Mac Pro Dual Quad-Core 2.4 Ghz Intel Xeon system with 14 GB of RAM and running OS X 10.7.2. I have the latest version of Final Cut Studio, which includes Final Cut Pro 7 an
-
Slow start up of iTunes 10.6 on Windows 7 & Network issues connecting iPhone via WiFi
Ever since I updated to iTunes 10.6 and iOS 5.1 both my computer don't want to open iTunes quickly and my Phone doesn't get noticed on iTunes via WiFi on my network. When I go to start iTunes from the icon on my desktop it doesn't pop up on screen ri
-
I have been trying to install Itunes for 3 days to my computer. MY eyes burn and I want to smash this computer at this point!!!! HELP ME!!! I receive this message when I run the diagnostic on my iphone Microsoft Windows Vista Ultimate Edition (Build
-
Problem in assigning custom role to a user
Hi everyone, Can anyone tell me how to assign a custom role to a user? I have created a set of IViews which are assigned to a workset and the workset is assigned to a new role. I assign this new role to my user account. But, I am not getting the role
-
As a new user of Aperture i do not understand the issues relating to transfer of an existing iPhoto library to Aperture. I do understand that Aperture does use an existing iPhoto library without the need for migration, but i did a test and migrated t