I need help with oracle
Hi,
I need some help... if someone can help its great.
I need to make a statement in Oracle SQL that read data from a file and insert in a Oracle Database ... if someone can show me the syntax of it i appreciate..
Thanks
Okay, I see you followed the advice in that other thread and started a new post for you question. Congratulations. Your next lesson in forum etiquette is to give your posts a more relevant subject. Pretty much everybody who posts here needs help with oracle; if they need help with cooking catfish they've come to the wrong place.
It that other thread I suggested using SQL*Loader or External Tables might be a more suitable solution. Find out more.
Cheers, APC
Similar Messages
-
Need help with ORACLE ADMIN, NETWORKING CONCEPTS and SQL, ASAP!
Hey everyone. Basically my major is going to be computer science, however I haven't started the course yet. However I got a job offering to the position as a SEO. A friend told me as long as I can answer the questions, the job will be no problem, I mainly just google oracle commands to put in all day. So I'm really needing someone who knows about this stuff, that could help me with some of these questions. If you can help, and have the time, my skype ID is drakkarnc
I greatly appreciate this, thank you. :)841784 wrote:
Hey everyone. Basically my major is going to be computer science, however I haven't started the course yet. However I got a job offering to the position as a SEO. What is "SEO"?
A friend told me as long as I can answer the questions, the job will be no problem, I mainly just google oracle commands to put in all day. So I'm really needing someone who knows about this stuff, that could help me with some of these questions. If you can help, and have the time, my skype ID is drakkarnc
I greatly appreciate this, thank you. :)YOu think you can learn this stuff in a few days? Think again.
Re: What to learn first for DBA/DEV? -
Power Query for Excel - Need Help with Oracle SQL Syntax
Hello everyone,
I am new to Power Query and am not able to figure this out. I am trying to pull in data into my Excel spreadsheet using a specific Oracle SQL query. While in query editor, how do I take the Oracle.Database function and add my SQL statement?
I already know what I want, I don't want it to download all the table names. According to the help page, I should be able to do this but it does not provide a syntax example
Also, I don't understand what "optional options as nullable record" means.
Below is what function and arguments the help page notes. How do I use this?
Oracle.Database(server as text, optional options as nullable record) as table
Any help is greatly appreciated.
Thank you,
JessicaWhen I try this, I get an error
DataSource.Error: Oracle: Sql.Database does not support the query option 'Query' with value '"Select * from Owner.View_Name"'. Details: null
I'm trying to download oracle data from a view into power query - Power Query navigator does not list th eviews from my source, it lists only the tables. When I try write sql statements, it throws me the above
error. This is what I tried
Oracle.Database("Source/Service",[Query="Select * from Owner.View_Name"])
Any ideas how to fix this? -
Need help with Oracle reports 10g
Hi
we have a requirement in a oracle 10g application
this application is on the unix server
the requirement is such that the user must be able to print a report directly to the default printer
when the user clicks on the button a report must be printed on the users default printer
can u help us understand that how can we configure the local printer of the user on the unix server?hi, piyush9010
Check this following link...
Oracle reports 10g output directly to printer
Oracle reports 10g output directly to printer
Make your printer as shared printer then try.
Use DESTYPE=PRINTER.
http://qamarsyed.blogspot.com/2011/02/how-to-print-oracle-report-to-network.html
http://docs.oracle.com/cd/E14571_01/bi.1111/b32121/pbr_cla005.htm#i637246
Hope this helps
If someone's response is helpful or correct, please mark it accordingly. -
Need help with Oracle Service Registry HTTPS configuration
I have installed the Oracle Service Registry on a separate OC4J instance called registry without errors. I have also done the following steps to configure HTTPS given in the user guide.
1. Delete the file <OC4J_HOME>/j2ee/home/keystore if it exists.
2. Generate the server identity into <OC4J_HOME>/j2ee/home/keystore using the Java keytool as follows:
keytool -genkey -keyalg RSA -alias oracle -keystore <OC4J_HOME>/j2ee/home/keystore -storepass
<PASSWORD>
3. Enabling SSL in the Oracle Application Server Standalone
4. Copy <OC4J_HOME>/j2ee/home/config/http-web-site.xml to <OC4J_HOME>/j2ee/home/config/secure-website.
xml.
5. Edit <OC4J_HOME>/j2ee/home/config/secure-web-site.xml by changing the port and adding the parameter secure="
true" to the <web-site> element; for example:
<web-site port="4443" ... secure="true">
6. Add the following element into the into the <web-site> element, use absolute path to keystore file, for example:
<ssl-config keystore="<OC4J_HOME>/j2ee/home/keystore" keystore-password="<PASSWORD>"/>
7. Add the path reference to secure-web-site.xml into the file server.xml; for example:
<web-site path="./secure-web-site.xml" />
8. You have to change the <web-app> definition for the OracleAS Service Registry n both files, http-web-site and
secure-web-site, so the OracleAS does not create independent instances for each of the websites. Add a
shared="true" attribute to the <web-app> elements for the OracleAS Service Registry application.
After following these steps, I restarted OPMN. I am able to get the Oracle Service Registry console. When I click on the Publish link, it shows the Security Alert Window. After I click on Yes in the security alert window, it just shows "Page cannot be displayed". The same happens for all the secure links such as login. I even tried exporting the certificate through the Security Alert window, but still it does not work. All the HTTP links in the Service Registry console are working and the HTTPS links are all not working. I believe this should be an SSL configuration issue. Please let me know whether I have missed any steps in the security configuration.
Thanks,
SathishAny replies to this please?
Has anyone successfully installed and configured the Oracle Service Registry with all the links in the service registry console working fine? Is any one able to publish web services into the oracle service registry?
Thanks. -
Need Help with Oracle Designer Install!
When I attempt to install Oracle designer, it asks me to choose an Oracle Home. I choose "OraHome81" from the drop down menu, but it gives me the following error:
"The location specified: C:\Oracle\Ora81 is already used as an Oracle Home for 'Oracle 815 Production'
It can not be used as an Oracle Home for 'nt' "
PLEASE HELP!!!
my email address is [email protected]As you would have seen if reading the documentation, this is probably a DB home, in which you cannot/should not install Designer. Type another name in there....
....when you are done reading your install guide. -
CREATE TABLE PMS_EMPLOYEE
EMPLOYEECODE VARCHAR2(15 BYTE) NOT NULL
, NAME VARCHAR2(100 BYTE)
, DEPARTMENTCODE VARCHAR2(10 BYTE)
, CONSTRAINT PK_PMS_EMPLOYEE PRIMARY KEY
, EMPLOYEECODE
ENABLE
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 1
STORAGE
INITIAL 3145728
MINEXTENTS 1
MAXEXTENTS 2147483645
BUFFER_POOL DEFAULT
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05611','Khan','01');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05612','chan','02');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05613','tina','03');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05614','bety','04');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05615','brad','04');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05616','kuty','03');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05617','rose','02');
Insert into PMS_EMPLOYEE (EMPLOYEECODE,NAME,DEPARTMENTCODE) values ('05618','jack','01');
CREATE TABLE PMS_DEPARTMENT
DEPARTMENTCODE VARCHAR2(10 BYTE) NOT NULL
, DESCRIPTION VARCHAR2(50 BYTE)
, CONSTRAINT PK_PMS_DEPARTMENT PRIMARY KEY
, DEPARTMENTCODE
ENABLE
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 1
STORAGE
INITIAL 65536
MINEXTENTS 1
MAXEXTENTS 2147483645
BUFFER_POOL DEFAULT
Insert into PMS_DEPARTMENT (DEPARTMENTCODE,DESCRIPTIOND) values ('01','HR');
Insert into PMS_DEPARTMENT (DEPARTMENTCODE,DESCRIPTIOND) values ('02','IT');
Insert into PMS_DEPARTMENT (DEPARTMENTCODE,DESCRIPTIOND) values ('03','MA');
Insert into PMS_DEPARTMENT (DEPARTMENTCODE,DESCRIPTIOND) values ('04','FN');
CREATE TABLE TAS_EMPBOOKINGS
EMPLOYEECODE VARCHAR2(10 BYTE) NOT NULL
, TRXTYPE VARCHAR2(2 BYTE)
, TRXDATE DATE
, TRXTIME FLOAT(126)
, CONSTRAINT PK_TAS_EMPBOOKINGS PRIMARY KEY
EMPLOYEECODE
ENABLE
LOGGING
TABLESPACE "USERS"
PCTFREE 10
INITRANS 1
STORAGE
INITIAL 233832448
MINEXTENTS 1
MAXEXTENTS 2147483645
BUFFER_POOL DEFAULT
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05611','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),6.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05611','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),15.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05612','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),7.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05612','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),10.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05612','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),12.36);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05613','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),7.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05613','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),10.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05613','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),12.25);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05613','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),13.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05613','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),13.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05613','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),14.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),7.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),10.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),12.25);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),13.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),13.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),15.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05614','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),15.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05615','IN',to_timestamp('24-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),11.16);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05616','IN',to_timestamp('24-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),10.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05616','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),8.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05617','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),7.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05617','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),12.30);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05617','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),14.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05618','IN',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),7.00);
Insert into TAS_EMPBOOKINGS (EMPLOYEECODE,TRXTYPE,TRXDATE,TRXTIME) values ('05618','OU',to_timestamp('25-JAN-11 00.00.00.000000000',
'DD-MON-RR HH24.MI.SS.FF'),16.30);
I need to count the number of employees inside the office in each department wise.
In case of employee 05611 he is In and out - no count
In case of employee 05612 he is In,out and In - need to count him as he is in at 12.36 still inside the office.
In case of employee 05613 he is In,out,In,out and In - need to count him as he is in at 14.16 still inside the office.
In case of employee 05614 he is In,out,In,out and In - need to count him as he is in at 15.16 still inside the office.
In case of employee 05615 he is In at yesterday but still in the office - need to count him as he is in at 11.16. Query should bring today and previous day
employee who are still inside the office in each department.
In case of employee 05616 he is In and out - in was 24 jan and out at next day so no count.
In case of employee 05617 he is In,out and In - need to count him as he is in at 14.00 still inside the office.
Note: Here they can swipe the card multiple times in or out. we need to find the last swipe in and last swipe out to make them countable and not countable.
In this sample data my output should be like this
Here don't show the Department if the count is 0 (no employee are inside the office) only count greater or equal to 1.
Our output case dept HR will not be shown in output data
Description(that is DepartmentName) InCount
02 2 ( as both chan and rose are inside the office need to count)
03 1 ( tina is in and kutty out. need to count tina only )
04 2 ( as both betty and brad are inside the office need to count then but brad was inside the office from
yesterday not gone out we need to consider him in the count as well)
if the create or insert does not run please correct it and then run.
ThanksNote the name of this forum is SQL Developer *(Not for general SQL/PLSQL questions)* (so only for issues with the SQL Developer tool). Please post these questions under the dedicated SQL And PL/SQL forum (you've posted there before).
Regards,
K. -
Hello,
I have the following table:
create table table1(col1 clob)
In columns COL1 I store some XML with the following structure:
<ROW>
<NAME>....</NAME>
<COL1><VAL>...</VAL><VAL>....</VAL></COL1>
<COL2>....</COL2>
</ROW>
So I compare two indexes:
1. Simple index:
create index myindex on table1(col1)
indextype is ctxsys.context
parameters ('datastore ctxsys.default_datastore
filter ctxsys.null_filter
section group ctxsys.auto_section_group')
2. Another index with stop sections, I think it will allow to increase performance and decrease index's size as I will index only NAME tag.
begin
ctx_ddl.create_section_group('xmldatagroup', 'AUTO_SECTION_GROUP');
ctx_ddl.add_stop_section('xmldatagroup', 'VAL');
ctx_ddl.add_stop_section('xmldatagroup', 'COL1');
ctx_ddl.add_stop_section('xmldatagroup', 'COL2');
end;
create index myindex on table1(col1)
indextype is ctxsys.context
parameters ('datastore ctxsys.default_datastore
filter ctxsys.null_filter
section group xmldatagroup')
But when I compared these indexes I found that sizes are the same and the token's table DR$MYINDEX$I for the second index contains tokens from tags from stop sections however in documentation I see:
Stop sections, empty tags, processing instructions, and comments are not indexed.
Is anybody know what's wrong with my code or stop section is just logical declaration for using on the query's execution step?I'm not sure why your stop sections aren't working, but if you know the layout of the document I would recoomend using explcitly-defined field sections rather than auto_section_group.
This will be a lot more efficient for querying.
It will still index the data outside of the <NAME> section, though as part of the "default" section. If you don't want to index that, you could use a user_datastore to remove all the stuff apart from what you want to index.
- Roger -
Need help with Berkeley XML DB Performance
We need help with maximizing performance of our use of Berkeley XML DB. I am filling most of the 29 part question as listed by Oracle's BDB team.
Berkeley DB XML Performance Questionnaire
1. Describe the Performance area that you are measuring? What is the
current performance? What are your performance goals you hope to
achieve?
We are measuring the performance while loading a document during
web application startup. It is currently taking 10-12 seconds when
only one user is on the system. We are trying to do some testing to
get the load time when several users are on the system.
We would like the load time to be 5 seconds or less.
2. What Berkeley DB XML Version? Any optional configuration flags
specified? Are you running with any special patches? Please specify?
dbxml 2.4.13. No special patches.
3. What Berkeley DB Version? Any optional configuration flags
specified? Are you running with any special patches? Please Specify.
bdb 4.6.21. No special patches.
4. Processor name, speed and chipset?
Intel Xeon CPU 5150 2.66GHz
5. Operating System and Version?
Red Hat Enterprise Linux Relase 4 Update 6
6. Disk Drive Type and speed?
Don't have that information
7. File System Type? (such as EXT2, NTFS, Reiser)
EXT3
8. Physical Memory Available?
4GB
9. Are you using Replication (HA) with Berkeley DB XML? If so, please
describe the network you are using, and the number of Replica’s.
No
10. Are you using a Remote Filesystem (NFS) ? If so, for which
Berkeley DB XML/DB files?
No
11. What type of mutexes do you have configured? Did you specify
–with-mutex=? Specify what you find inn your config.log, search
for db_cv_mutex?
None. Did not specify -with-mutex during bdb compilation
12. Which API are you using (C++, Java, Perl, PHP, Python, other) ?
Which compiler and version?
Java 1.5
13. If you are using an Application Server or Web Server, please
provide the name and version?
Oracle Appication Server 10.1.3.4.0
14. Please provide your exact Environment Configuration Flags (include
anything specified in you DB_CONFIG file)
Default.
15. Please provide your Container Configuration Flags?
final EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setAllowCreate(true); // If the environment does not
// exist, create it.
envConf.setInitializeCache(true); // Turn on the shared memory
// region.
envConf.setInitializeLocking(true); // Turn on the locking subsystem.
envConf.setInitializeLogging(true); // Turn on the logging subsystem.
envConf.setTransactional(true); // Turn on the transactional
// subsystem.
envConf.setLockDetectMode(LockDetectMode.MINWRITE);
envConf.setThreaded(true);
envConf.setErrorStream(System.err);
envConf.setCacheSize(1024*1024*64);
envConf.setMaxLockers(2000);
envConf.setMaxLocks(2000);
envConf.setMaxLockObjects(2000);
envConf.setTxnMaxActive(200);
envConf.setTxnWriteNoSync(true);
envConf.setMaxMutexes(40000);
16. How many XML Containers do you have? For each one please specify:
One.
1. The Container Configuration Flags
XmlContainerConfig xmlContainerConfig = new XmlContainerConfig();
xmlContainerConfig.setTransactional(true);
xmlContainerConfig.setIndexNodes(true);
xmlContainerConfig.setReadUncommitted(true);
2. How many documents?
Everytime the user logs in, the current xml document is loaded from
a oracle database table and put it in the Berkeley XML DB.
The documents get deleted from XML DB when the Oracle application
server container is stopped.
The number of documents should start with zero initially and it
will grow with every login.
3. What type (node or wholedoc)?
Node
4. Please indicate the minimum, maximum and average size of
documents?
The minimum is about 2MB and the maximum could 20MB. The average
mostly about 5MB.
5. Are you using document data? If so please describe how?
We are using document data only to save changes made
to the application data in a web application. The final save goes
to the relational database. Berkeley XML DB is just used to store
temporary data since going to the relational database for each change
will cause severe performance issues.
17. Please describe the shape of one of your typical documents? Please
do this by sending us a skeleton XML document.
Due to the sensitive nature of the data, I can provide XML schema instead.
18. What is the rate of document insertion/update required or
expected? Are you doing partial node updates (via XmlModify) or
replacing the document?
The document is inserted during user login. Any change made to the application
data grid or other data components gets saved in Berkeley DB. We also have
an automatic save every two minutes. The final save from the application
gets saved in a relational database.
19. What is the query rate required/expected?
Users will not be entering data rapidly. There will be lot of think time
before the users enter/modify data in the web application. This is a pilot
project but when we go live with this application, we will expect 25 users
at the same time.
20. XQuery -- supply some sample queries
1. Please provide the Query Plan
2. Are you using DBXML_INDEX_NODES?
Yes.
3. Display the indices you have defined for the specific query.
XmlIndexSpecification spec = container.getIndexSpecification();
// ids
spec.addIndex("", "id", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
spec.addIndex("", "idref", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// index to cover AttributeValue/Description
spec.addIndex("", "Description", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_SUBSTRING, XmlValue.STRING);
// cover AttributeValue/@value
spec.addIndex("", "value", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// item attribute values
spec.addIndex("", "type", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// default index
spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// save the spec to the container
XmlUpdateContext uc = xmlManager.createUpdateContext();
container.setIndexSpecification(spec, uc);
4. If this is a large query, please consider sending a smaller
query (and query plan) that demonstrates the problem.
21. Are you running with Transactions? If so please provide any
transactions flags you specify with any API calls.
Yes. READ_UNCOMMITED in some and READ_COMMITTED in other transactions.
22. If your application is transactional, are your log files stored on
the same disk as your containers/databases?
Yes.
23. Do you use AUTO_COMMIT?
No.
24. Please list any non-transactional operations performed?
No.
25. How many threads of control are running? How many threads in read
only mode? How many threads are updating?
We use Berkeley XML DB within the context of a struts web application.
Each user logged into the web application will be running a bdb transactoin
within the context of a struts action thread.
26. Please include a paragraph describing the performance measurements
you have made. Please specifically list any Berkeley DB operations
where the performance is currently insufficient.
We are clocking 10-12 seconds of loading a document from dbd when
five users are on the system.
getContainer().getDocument(documentName);
27. What performance level do you hope to achieve?
We would like to get less than 5 seconds when 25 users are on the system.
28. Please send us the output of the following db_stat utility commands
after your application has been running under "normal" load for some
period of time:
% db_stat -h database environment -c
% db_stat -h database environment -l
% db_stat -h database environment -m
% db_stat -h database environment -r
% db_stat -h database environment -t
(These commands require the db_stat utility access a shared database
environment. If your application has a private environment, please
remove the DB_PRIVATE flag used when the environment is created, so
you can obtain these measurements. If removing the DB_PRIVATE flag
is not possible, let us know and we can discuss alternatives with
you.)
If your application has periods of "good" and "bad" performance,
please run the above list of commands several times, during both
good and bad periods, and additionally specify the -Z flags (so
the output of each command isn't cumulative).
When possible, please run basic system performance reporting tools
during the time you are measuring the application's performance.
For example, on UNIX systems, the vmstat and iostat utilities are
good choices.
Will give this information soon.
29. Are there any other significant applications running on this
system? Are you using Berkeley DB outside of Berkeley DB XML?
Please describe the application?
No to the first two questions.
The web application is an online review of test questions. The users
login and then review the items one by one. The relational database
holds the data in xml. During application load, the application
retrieves the xml and then saves it to bdb. While the user
is making changes to the data in the application, it writes those
changes to bdb. Finally when the user hits the SAVE button, the data
gets saved to the relational database. We also have an automatic save
every two minues, which saves bdb xml data and saves it to relational
database.
Thanks,
Madhav
[email protected]Could it be that you simply do not have set up indexes to support your query? If so, you could do some basic testing using the dbxml shell:
milu@colinux:~/xpg > dbxml -h ~/dbenv
Joined existing environment
dbxml> setverbose 7 2
dbxml> open tv.dbxml
dbxml> listIndexes
dbxml> query { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }
dbxml> queryplan { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }Verbosity will make the engine display some (rather cryptic) information on index usage. I can't remember where the output is explained; my feeling is that "V(...)" means the index is being used (which is good), but that observation may not be accurate. Note that some details in the setVerbose command could differ, as I'm using 2.4.16 while you're using 2.4.13.
Also, take a look at the query plan. You can post it here and some people will be able to diagnose it.
Michael Ludwig -
Need help with my usecase based on transient ViewObject
I am using 11.1.1.4.0 Jdev version. I need help with my usecase.Been trying it for 2 days but couldn't figure out the issue.
I have a transientVO . In this VO Rows will be populated programmatically. CountryId is an attribute of this VO. I have created a viewAccessor "CountriesVA" from Country VO of HR schema.
I have a LOV for the countryId which is based on this VA ,getting countries from CountryTable.
This is the model part which works fine.
Before the page load i have called a method to create a row for this transientVO.Once the row is created i can see the SOC in my page which i have created as below.
Now i want to insert a row in the transientVO if user selects a country and restrict duplicate entry . (As One row is already created 1st time there will be no rows created.after that rows will be inserted)
The issue is :: Suppose there are 2 countries. A & B .When user does the following actions :
Insert A . Done //as 1st entry
Insert B . Done //as 1st time entry
Insert A . duplicate not inserted
Insert B . getting inserted // the bug.
<af:selectOneChoice value="#{bindings.CountryId.inputValue}"
label="#{bindings.CountryId.label}"
required="#{bindings.CountryId.hints.mandatory}"
shortDesc="#{bindings.CountryId.hints.tooltip}" id="soc1"
immediate="true" autoSubmit="true"
valueChangeListener="#{pageFlowScope.managedBean.countryIdVC}">
public void countryIdVC(ValueChangeEvent valueChangeEvent) {
// Add event code here...
String oldValue=null;
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
boolean duplicate=true;
if(oldValue!=null){
rsi.getCurrentRow().setAttribute("CountryId", oldValue);
// Row row= rsi.findByKey(new Key(new Object[] { newValue}), 1)[0];
Key key =new Key(new Object[] { newValue});
Row row=rsi.getRow(key);
if(row==null){
System.err.println(duplicate);
duplicate=false;
}else{
rsi.setCurrentRow(row);
if(!duplicate){
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
//create a new row
Row newRow = rsi.createRow();
newRow.setAttribute("CountryId", newValue);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);I read the reply from Andrejus Baranovskis and thought of studying and implementing that in my useCase.Well it worked . I implemented the same Logic but rowIteration was done in AppModule.
Con-Fusion, Bugs, Facts &amp; Workarounds: Iterating through View Object RowIterator Bug.(NOT ADF BUG, Development B…
http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcservices.htm#sm0206
9.7.6 What You May Need to Know About Programmatic Row Set Iteration
The problem is solved ,the above links helped me solve the problem.
what i did is i have created a method in appmodule to iterate rows and all the method y operation bindings and my logic works fine ....
MY Advice to all Adf developers ,though i am not an expert but i can assure you to follow the above process for rowIteration.If you use the iterator binding in the manage bean to navigate the rows u'll face issues which are unexpected.
In AppModule :::::
public boolean createRow(String oldValue,String newValue){
System.err.println(oldValue+""+newValue);
ViewObjectImpl vo=getViewObj1();
boolean duplicate=false;
if(oldValue!=null){
RowSetIterator iter = vo.createRowSetIterator(null);
System.err.println("iterating rows ");
while (iter.hasNext()) {
Row r = iter.next();
System.err.println(iter.getRangeIndexOf(r)+" row is "+r.getAttribute("CountryId"));
if(r.getAttribute("CountryId").toString().equals(newValue)){
duplicate=true;
break;
// Do something with the current row.
// close secondary row set iterator
iter.closeRowSetIterator();
return duplicate;
In ManageBean :::::
public void countryIdVC(ValueChangeEvent valueChangeEvent) {
// Add event code here...
String oldValue=null;
System.err.println("Old Value"+valueChangeEvent.getOldValue());
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to. Its "allDepartmentsIterator"
//in this sample
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
if(oldValue!=null){
rsi.getCurrentRow().setAttribute("CountryId", oldValue);
OperationBinding operation = bindings.getOperationBinding("createRow");
operation.getParamsMap().put("oldValue", oldValue);
operation.getParamsMap().put("newValue", newValue);
if(!(Boolean)operation.execute()){
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
//create a new row
Row newRow = rsi.createRow();
newRow.setAttribute("CountryId", newValue);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
System.err.println("Inserting row at index "+lastRowIndex+1);
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
else{
System.err.println("Data found So not inserting,only setting current Row");
Key key =new Key(new Object[] { newValue});
rsi.setCurrentRow(rsi.getRow(key)); -
Help with oracle 11g pivot operator
i need some help with oracle 11g pivot operator. is it possible to use multiple columns in the FOR clause and then compare it against multiple set of values.
here is the sql to create some sample data
create table pivot_data ( country_code number , dept number, job varchar2(20), sal number );
insert into pivot_data values (1,30 , 'SALESMAN', 5000);
insert into pivot_data values (1,301, 'SALESMAN', 5500);
insert into pivot_data values (1,30 , 'MANAGER', 10000);
insert into pivot_data values (1,301, 'MANAGER', 10500);
insert into pivot_data values (1,30 , 'CLERK', 4000);
insert into pivot_data values (1,302, 'CLERK',4500);
insert into pivot_data values (2,30 , 'SALESMAN', 6000);
insert into pivot_data values (2,301, 'SALESMAN', 6500);
insert into pivot_data values (2,30 , 'MANAGER', 11000);
insert into pivot_data values (2,301, 'MANAGER', 11500);
insert into pivot_data values (2,30 , 'CLERK', 3000);
insert into pivot_data values (2,302, 'CLERK',3500);
using case when I can write something like this and get the output i want
select country_code
,avg(case when (( dept = 30 and job = 'SALESMAN' ) or ( dept = 301 and job = 'SALESMAN' ) ) then sal end ) as d30_sls
,avg(case when (( dept = 30 and job = 'MANAGER' ) or ( dept = 301 and job = 'MANAGER' ) ) then sal end ) as d30_mgr
,avg(case when (( dept = 30 and job = 'CLERK' ) or ( dept = 302 and job = 'CLERK' ) ) then sal end ) as d30_clrk
from pivot_data group by country_code;
output
country_code D30_SLS D30_MGR D30_CLRK
1 5250 10250 4250
2 6250 11250 3250
what I tried with pivot is like this I get what I want if I have only one ( dept,job) for one alias name. I want to call (30 , 'SALESMAN') or (301 , 'SALESMAN') AS d30_sls. any help how can I do this
SELECT *
FROM pivot_data
PIVOT (SUM(sal) AS sum
FOR (dept,job) IN ( (30 , 'SALESMAN') AS d30_sls,
(30 , 'MANAGER') AS d30_mgr,
(30 , 'CLERK') AS d30_clk
this is a simple example .... my real life scenario is compliated with more fields and more combinations .... So something like using substr(dept,1,2) won't work in my real case .
any suggestions get the result similar to what i get in the case when example is really appreciated.Hi,
Sorry, I don't think there's any way to get exactly what you requested. The values you give in the PIVOT ... IN clause are exact values, not alternatives.
You could do something like this to map all alternatives to a common value:
WITH got_dept_grp AS
SELECT country_code, job, sal
, CASE
WHEN job IN ('SALESMAN', 'MANAGER') AND dept = 301 THEN 30
WHEN job IN ('CLERK') AND dept = 302 THEN 30
ELSE dept
END AS dept_grp
FROM pivot_data
SELECT *
FROM got_dept_grp
PIVOT ( AVG (sal)
FOR (job, dept_grp)
IN ( ('SALESMAN', 30)
, ('MANAGER' , 30)
, ('CLERK' , 30)
;In your sample data (and perhaps in your real data), it's about as easy to explicitly define the pivoted groups individually, like this:
WITH got_pivot_key AS
SELECT country_code, sal
, CASE
WHEN job = 'SALESMAN' AND dept IN (30, 301) THEN 'd30_sls'
WHEN job = 'MANAGER' AND dept IN (30, 301) THEN 'd30_mgr'
WHEN job = 'CLERK' AND dept IN (30, 302) THEN 'd30_clrk'
END AS pivot_key
FROM pivot_data
SELECT *
FROM got_pivot_key
PIVOT ( AVG (sal)
FOR pivot_key
IN ( 'd30_sls'
, 'd30_mgr'
, 'd30_clrk'
;Thanks for posting the CREATE TABLE and INSERT statements; that really helps! -
Need help on Oracle Report format
Hi,
I need help on Oracle Reports. I am generating a report in excel sheet. I have a column which is 13 digit number (In database it is CHAR datatype). In excel sheet it showing some thing like 9.78381E+12. I want to show complete number like 9783805591331.
Also sometimes leading zero's are not showing when my column values is something like 0098794859583. I need to show the leading zero's as well in excel without losing them.
Below are the parameters i am using for the report
DESFORMAT=SPREADSHEET AND DESTYPE=FILE
My Oracle 9i developer version.
Any help on this would be much appreciated.
Thanks
KishoreAn additional quote string ' character with the number field will solve this problem but if u want to display this field in report then it will look ugly
'''||yourfield from table; check ur regional settings also
plz mark it helpful correct if it is -
Need help with Pivoting rows to columns
Hi,
I need help with pivoting rows to columns. I know there are other posts regarding this, but my requirement is more complex and harder. So, please give me a solution for this.
There are two tables say Table 1 and Table 2.
Table1
name address email identifier
x e g 1
f s d 2
h e n 3
k l b 4
Table2
identifier TRno zno bzid
1 T11 z11 b11
1 T12 z12 b12
1 T13 z13 b13
2 T21 z21 b21
2 T22 z22 b22
As you can see the identifier is the column that we use to map the two tables. The output should be like below
output
name address email identifier TRno1 zno1 bzid1 TRno2 zno2 bzid2 TRno3 zno3 bzid3
x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
f s d 2 T21 z21 b21 t22 z22 b22
Also we do not know exactly how many TRno's, zno's, etc each value in the identifier will have. There may be only 1 TRNO, zno and bzid, or there may be four.
All the values must be in separate columns, and not be just comma delimitted. There are also other conditions that i have to add to restrict the data.
So, can you please tell me what is should use to get the data in the required format? We are using Oracle 10g. Please let me know if u need any more informationSomething like this ?
SCOTT@orcl> ed
Wrote file afiedt.buf
1 select a.name,
2 a.address,
3 a.email,
4 b.* from (
5 select distinct identifier
6 ,max(trno1) trno1
7 ,max(zno1) zno1
8 ,max(bzid1) bzid1
9 ,max(trno2) trno2
10 ,max(zno2) zno2
11 ,max(bzid2) bzid2
12 ,max(trno3) trno3
13 ,max(zno3) zno3
14 ,max(bzid3) bzid3
15 ,max(trno4) trno4
16 ,max(zno4) zno4
17 ,max(bzid4) bzid4
18 from (select identifier
19 ,decode(rn,1,trno,null) trno1
20 ,decode(rn,1,zno,null) zno1
21 ,decode(rn,1,bzid,null) bzid1
22 ,decode(rn,2,trno,null) trno2
23 ,decode(rn,2,zno,null) zno2
24 ,decode(rn,2,bzid,null) bzid2
25 ,decode(rn,3,trno,null) trno3
26 ,decode(rn,3,zno,null) zno3
27 ,decode(rn,3,bzid,null) bzid3
28 ,decode(rn,4,trno,null) trno4
29 ,decode(rn,4,zno,null) zno4
30 ,decode(rn,4,bzid,null) bzid4
31 from (select identifier,
32 trno,bzid,zno,
33 dense_rank() over(partition by identifier order by trno,rownum) rn
34 from table2)
35 order by identifier)
36 group by identifier) b,table1 a
37* where a.identifier=b.identifier
SCOTT@orcl> /
NAME ADDRESS EMAIL IDENTIFIER TRNO1 ZNO1 BZID1 TRNO2 ZNO2 BZID2 TRNO3 ZNO3 BZID3 TRNO4 ZNO4 BZID4
x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
f s d 2 T21 z21 b21 T22 z22 b22
SCOTT@orcl> select * from table1;
NAME ADDRESS EMAIL IDENTIFIER
x e g 1
f s d 2
h e n 3
k l b 4
SCOTT@orcl> select * from table2;
IDENTIFIER TRNO ZNO BZID
1 T11 z11 b11
1 T12 z12 b12
1 T13 z13 b13
2 T21 z21 b21
2 T22 z22 b22
SCOTT@orcl>Regards
Girish Sharma -
<p>Need help with the following error.....what does it mean....</p><p>28943 3086739136 XML-240304 3/7/07 7:13:23 PM |SessionNew_Job1<br /><font color="#ff0000">28943 3086739136 XML-240304 3/7/07 7:13:23 PM XML parser failed: Error <An exception occurred! Type:UnexpectedEOFException, Message:The end of input was not expected> at</font><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM line <7>, char <8> in <<?xml version="1.0" encoding="WINDOWS-1252" ?><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfigurations><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfiguration default="true" name="Configuration1"><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <case_sensitive>no</case_sensitive><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <database_type>Oracle</database_type><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_alias_name1>ODS_OWNER</db_alias_name1><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_ali>, file <>.<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM |SessionNew_Job1<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM XML parser failed: See previously displayed error message.</p><p>Any help would be greatly appreciated. It's something to do with my datasource and possibly the codepage but I'm really not sure.</p><p>-m<br /></p>
please export your datastore as ATL and send it to support. Somehow the internal language around configurations got corrupted - never seen before.
-
Please, need help with a query
Hi !
Please need help with this query:
Needs to show (in cases of more than 1 loan offer) the latest create_date one time.
Meaning, In cases the USER_ID, LOAN_ID, CREATE_DATE are the same need to show only the latest, Thanks!!!
select distinct a.id,
create_date,
a.loanid,
a.rate,
a.pays,
a.gracetime,
a.emailtosend,
d.first_name,
d.last_name,
a.user_id
from CLAL_LOANCALC_DET a,
loan_Calculator b,
bv_user_profile c,
bv_mr_user_profile d
where b.loanid = a.loanid
and c.NET_USER_NO = a.resp_id
and d.user_id = c.user_id
and a.is_partner is null
and a.create_date between
TO_DATE('6/3/2008 01:00:00', 'DD/MM/YY HH24:MI:SS') and
TO_DATE('27/3/2008 23:59:00', 'DD/MM/YY HH24:MI:SS')
order by a.create_dateTake a look on the syntax :
max(...) keep (dense_rank last order by ...)
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions056.htm#i1000901
Nicolas.
Maybe you are looking for
-
Hi everyone, Ive got an iphone 3gs running the latest iphone software 3.x.x. and I had a first generation Iphone. When I first got my 3GS in September I noticed an email bug. if you are reading an email horizontally, and flip the phone to vertical an
-
Is Adobe Elements 13 compatable with Windows 8.1?
I get the error message cannot initilaze Directx when try to open Elements 13 Orginazor.
-
Best way to lay out this scrapbook
I need some advice about the best way to go about this. I have a client who basically want me to publish her scrapbook. It's full of all sorts of color and b/w photos, drawings, newspaper clippings, you name it. I was thinking I should scan each page
-
Is it possible to develop online interactive adobe form using abap?
Hi , We don't want to use webdypro for java or webdypro for abap to develop the online interactive form.but I'm not sure whether abap only is enough to achieve it?
-
Laptop stuck on blue loading screen!
hi folks! i am in serious need of HELP! any advice wud be appreciated! I updated the software on my laptop to 10.4.9 about 3-4 days ago and it worked fine, however 2 days later my laptop crashes and then when i go to start it up again it doesnt stop