Mixing sun-database-binding with Oracle sequences
Hello,
I wish to insert rows inside the database, for instance rows representing persons, and rows representing their addresses. Primary keys for both person and address are Oracle sequence based.
My question is, if I insert a person, then one of her address, how can I retrieve the person ID for the address row to reference it.
The insert statement for the person is (for the moment) as follow
insert into Person (PERSON_ID, FIRST_NAME, LAST_NAME) values (PERSON_SEQ.nextval, ?, ?)The problem with this approach is that I never know the person ID, and am unable to make any references to it in the address row.
I tried to add an operation in the NetBeans generated person table WSDL. This operation would execute this statement:
select PERSON_SEQ.nextval from dualBut, for the moment, it's a failure.
Could you provide me with some hints?
Hi,
First I would advise you to register and post on the [email protected] alias - you can find the details of how to do this on the OpenESB site..... you'll reach a larger audience this way.
Second, you need a Stored Procedure in Oracle to do this, then use this from the DB BC, here's one I created which does something similar, i.e. returns a value I'm interested in after an "Update" statement....
CREATE OR REPLACE PROCEDURE "NEXTAPPNUMFINDER" (nextAppNum OUT NUMBER)
IS
BEGIN
UPDATE ACTIVE_APPLICATION_NUMBER
SET APPLICATION_NUMBER_NEXT = APPLICATION_NUMBER_NEXT + 1
RETURNING APPLICATION_NUMBER_NEXT
INTO nextAppNum;
END;
Hope this helps
Mark
Similar Messages
-
Bind variable with Oracle sequence
can we insert oracle sequence with the bind varaible
some thing like
seq number(5);
begin
select myseq.nextval
into seq from dual;
dbms_sql.parse( l_cursor,insert into mytable (c1,c2,c3) values (seq,:1,:2),dbms_sql.native );
dbms_sql.bind_variable( l_cursor, :1,58);
dbms_sql.bind_variable( l_cursor, :2,9);
l_status := dbms_sql.execute( l_cursor );
end;
Thanks!What are you trying there..
Why dynamic SQL?
Where is the exception block?
you have to use 'using ' to work with these kind of dynamic variables. Something like this (ugly code below)
CREATE SEQUENCE myseq;
create table mytable (c1 number,c2 number, c3 number;
DECLARE
seq NUMBER (5);
A number;
b NUMBER;
BEGIN
SELECT myseq.NEXTVAL INTO seq FROM DUAL;
a := 1;
b := 58;
EXECUTE IMMEDIATE 'insert into mytable (c1,c2,c3) values (:seq,:1,:2)'
USING seq, a, b;
a := 1;
b := 100;
EXECUTE IMMEDIATE 'insert into mytable (c1,c2,c3) values (:seq,:1,:2)'
USING seq, a, b;
COMMIT;
END; --- Check you need to have proper exception block.
Cheers,
Manik. -
CCX7.0 Database Integration with Oracle 10g through ODBC
Good Day…
We are up to integrate CCX7.0 with Oracle 10g, CCX7.0 documents show the way to integrate the CCX7.0 with SQL server, but mention nothing about Oracle 10g, anyway...
I tried to check the ODBC options, there were many options, I tried to select any Oracle related choice, just to find out Oracle should supply the driver for it. In the forums, people say it’s an Oracle Client, but what will this client do? Am I going to connect though it to the oracle database server or is it going to query the database to my CCX server? What am I going to use in this case, user DSN or system DSN?
If there any tips or recommendations I will be grateful, as it is my first database integration.
Thanks
ATHi Aaron
Thanks Aaron for the information, and yes you are right, I am not a database person.
I have here some questions, sorry if some of them sounds silly
1) Is there a certain Oracle Client version? or and Oracle Client will work for me?
2) Do you recommend system DSN on user DSN?
3) “…. available to any device on the system” as you said in your reply, what do you mean by "device" and "system"? Sorry, but this will help to clear the picture to me
4) What will this Oracle Client exactly do? Is it going to build an SQL table on my CCX server that query the information from the Oracle Server?
5) My customer has already implemented database integration with IPCC3.5, how can I check the current configuration of the Oracle Client, and what things else should I check before proceeding with the integration?
The reason I want to understand this because there is a lot of database integration is requested from us, the CCX scripts can be used to query data from SQL tables, I read a lot about this –waiting for the implementation phase- the lucky me, the first integration I faces is with Oracle.
Anyway, who said learning is easy.
Thanks Aaron for your time, waiting your answers.
AT -
Database Service Name or Global Database Name with Oracle 10G, when Oracle
I have an old installation of Oracle 9i (SID=ORCL) and now have installed Oracle 10G (SID=ORC2). I can get connection to Oracle 10G if i define it as an Oracle 8 compatible identification (ie I access to a SID, and don´t provide a Service Name.
Now I want to install Oracle HTML DB, and succeeded to install the SQL-script that came with the download, but when I install Apache and HTML DB from the Oracle Companion CD I am asked to give the Database Service Name (in the Help it is explained as the Global Database Name).
When i give the Net Service Name I get error messages (incomprehensible).
When I look in Net Manager, the Net Service Name does not have a Service Name, but only points to a SID (ie ORC2).
Where can I find the Database Service Name (or Global Database Name), OR define it if it is not defined??
Thanks for your help,create a net service for oracle10g and provide the name of this service during HTML DB installation it is required for installation.
-
On Sun fire v490 - Solaris 10 with Oracle 8.1.7.4 & Sybase 12.0
Hi,
We are going to upgrade our server with this configuration -
Sun Fire V490 2 x 1.05 GHz UltraSPARC IV CPU
8096MB RAM 2 x73GB local disk
2x FC 2GB Sun/QLogic HBAs
DAT72
On one machine we will have Sun Solaris v10 with
Oracle DB v8.1.7.4 & Second one will be Sun Solaris v10 with Sybase DB v12.0.0.6.
Now our question is - Sun fire have Hyper-thread CPUs ��� will the O/S and databases (Oracle and Sybase) view the proposed system as a true 4 CPU platform? Will parameters used to tune the database such as Sybase max online engines still operate in the same manner as before?
Our old machine configuration was - Sun E450 4x400MHz CPU 1024MB RAM 2 x18; 8x36GB disksQuestions on Oracle and Sybase should be directed to a database forum, this forum is for Sun hardware support.
Here is a link to a DB forum I look at from time to time:
http://www.dbforums.com/index.php
The topic of tuning Oracle or Solaris is way beyond the scope of this forum, I have attempted to go into it before but didn't get any feedback and I would only like to spend lots of time on it if I was being paid!!! On the memory side, keep in mind that Oracle 9i 64-bit can address a maximum of 2 ^ 64 ( 16777216 TB ) memory, prior to that the DBA had to define memory parameters in init.ora. To be honest the last time I worked with a Oracle 8 database I shut a HP K class server down permanently that had been migrated to Oracle 9i on Solaris by an Oracle consultant and I can't remember all the tuning trick etc. -
How can we achive active/active cluster setup with Oracle
Hi Experts,
How can we achieve active/active database setup with oracle WITHOUT USING RAC.. As far as I know it's impossible (unless I'm wrong)..
We are using Oracle 11.2.0.1 64bit on Windows 2008 server. We deployed Oracle FailSafe but that's more of an active/passive solution based on a windows cluster.
The other solution we were thinking about is to use DataGuard and replication.. two servers.. the oracle instance running on one server generating logs, and the other server receive the logs and apply them to the physical standby db.. Still, this is not a real active/active setup.
So, is it possible to run 2 servers in an active/active cluster and have the oracle database in an active/active setup or have the instance running on multiple nodes (at the same time)?
ThanksLet me give you a brief explanation of what the situation is and you can be the judge..
My client have four databases with the smallest one being 20GB and the biggest around the 35gb (SGA 750mb to 1.4gb (Tiny by DB standards) and probably on a normal day, you can run all four of them on a decent desktop).. The DBs are used to keep track of people information. Through out the year, the databases are almost sitting idle, and by idle I mean, the odd update here and there, the odd report..etc. No hard real processing of any sort. Two days of the year (end of year) we have all the operators consolidating records and what's not and they will be pounding away entering data and updating the tables - with hourly reports that goes to 3rd parties. The client expects a 99.99 up time and availability during those 2 days.
Now, tell me, How can I justify using RAC and spending hundreds of thousands of dollars in licensing and what ever extra costs introduced by the complexity of the environment for the above scenario knowing that I don't have any real use for RAC for 363 days of the year; and we MIGHT need it for 2 days of the year? This is the dilemma we're facing.
Thanks
Edited by: rsar001 on Sep 3, 2010 9:42 AM -
Webinar Replay URL: Situational Analysis at OnStar with Oracle Spatial
A free replay is now available for the Directions webinar Situational Analysis at OnStar with Oracle Spatial, which was held on Feb. 22.
To view the replay, visit https://www2.gotomeeting.com/register/237138906
OnStar is the largest telematics solution provider on the globe, with 6 million subscribers in North America and abroad. OnStar uses situational awareness and real-time analysis to deliver fast, accurate emergency services to its customers. At the core of this solution is an Oracle Spatial-based analytical server that supports Google Earth visualization and NAVTEQ data. With this system, OnStar gains better understanding of customer use and behavior and better insight during emergency situations. In hurricanes, wildfires and other disasters, OnStar has developed early warning capabilities for use in near real-time. It can then manage call center resources based on anticipated call volumes and ultimately develop more effective new processes and services.
Learn from OnStar how the company uses Oracle Spatial to deliver insight, performance and scalability.
Key learning points include:
* How OnStar’s Oracle Spatial analytical server supports its real-time call center Advisor application in an environment using Google Earth visualization and NAVTEQ data
* How spatial analysis allows OnStar to obtain better insight into disaster situations, develop early warning capabilities, and improve call center coverage
* How Oracle Database 11g (with Oracle Spatial, Real Application Clusters, Partitioning) provides scalability and performance required to process and query OnStar’s large amounts of transactional data
Speakers include:
* Jeff Joyner, Emergency Strategy and Outreach, GM OnStar and Injury Research Fellow, University of Michigan Program for Injury Research and Education
* James Steiner, Vice President, Product Management, Oracle Server Technologies
Who should attend:
This webinar is appropriate for CIOs, business and technical managers and analysts involved in the design and management of enterprise systems where spatial analysis can add insight and value to business processes.Nice to have a EXPERT in this FORUM...!!
Hi Dan, if you look at my reply I mentioned that I had loaded loc_updates.sql
From my previous reply:
execute loc_updates.sql which doenot update any of the rows since if you look at the syntax in loc_updates.sql file it shows update the table customers whose customer_id=344.
Where is this customer_id=344 coming from?
Also the datatype is a number.
Dan, were you able to get the results as desired?
or may be I am missing something...
Thanks and Regards,
Nandakishore. -
Free Webinar - Situational Analysis at OnStar with Oracle Spatial Feb. 22
Join us for the next Directions webinar: Situational Analysis at OnStar with Oracle Spatial
When: Wednesday, February 22nd, 2:00 PM - 3:00 PM EST
Register now: https://www2.gotomeeting.com/register/237138906
OnStar is the largest telematics solution provider on the globe, with 6 million subscribers in North America and abroad. OnStar uses situational awareness and real-time analysis to deliver fast, accurate emergency services to its customers. At the core of this solution is an Oracle Spatial-based analytical server that supports Google Earth visualization and NAVTEQ data. With this system, OnStar gains better understanding of customer use and behavior and better insight during emergency situations. In hurricanes, wildfires and other disasters, OnStar has developed early warning capabilities for use in near real-time. It can then manage call center resources based on anticipated call volumes and ultimately develop more effective new processes and services.
Learn from OnStar how the company uses Oracle Spatial to deliver insight, performance and scalability.
Key learning points include:
* How OnStar’s Oracle Spatial analytical server supports its real-time call center Advisor application in an environment using Google Earth visualization and NAVTEQ data
* How spatial analysis allows OnStar to obtain better insight into disaster situations, develop early warning capabilities, and improve call center coverage
* How Oracle Database 11g (with Oracle Spatial, Real Application Clusters, Partitioning) provides scalability and performance required to process and query OnStar’s large amounts of transactional data
Speakers include:
* Jeff Joyner, Emergency Strategy and Outreach, GM OnStar and Injury Research Fellow, University of Michigan Program for Injury Research and Education
* James Steiner, Vice President, Product Management, Oracle Server Technologies
Who should attend:
This webinar is appropriate for CIOs, business and technical managers and analysts involved in the design and management of enterprise systems where spatial analysis can add insight and value to business processes.
Register now: https://www2.gotomeeting.com/register/237138906Markus,
Sorry for my late reply it had been awhile since I was here at SDN
I did it manually in the 'old' way and at that time it did work.
Kulvir,
I did get it from SAPnet but when I downloaded it it contained the proper file.But I did had the same with an add-on for the business connector which only contained an empty file.
Thanks for your answers and again sorry for my late reply back to you all -
How to synchronize with Oracle 11 g
Hi @ all,
since a longer time I try to synchronize a Oracle Database Lite with Oracle 11 g over Mobile Server. But I still hadn't any success. I wanna use C# 3.5 and ADO.NET. Oracle Lite documentation is very bad, did not helped me. I cannot understand how to design a mobile sync application. Is it neccessary to use Mobile Database Workbench and Packaging Wizzard and to publish my mobile application to Mobile Server? Is too complex, I don't need/want this. All I wanna do is to use offline Oracle Lite Database on my PDA and synchronize the data during ActiveSync-connection with a Oracle 11 g data base. I tried also OracleSync classe and OracleEngine.Synchronize() and BGSyncControl, but nothing worked. I talked to our oracle support but they only send me links to tuorials sites I already read. I'm very unhappy about synchronization in Oracle Lite.
Has anyone successfully done synchronization with Oracle Lite and Oracle 11 g on a mobile device and can give me some hints or sample code? Or is there any mobile database which is better for synchronization?
Thank you very much for your answers or your code examples.
AnessWhen attempting to synchronize Oracle Lite with the Windows Mobile emulator, ActiveSync is not able to establish a connection with the emulator device after the emulator device is set to emulate being cradled with the Device Emulator Manager.
Cause
The SERDMAAsPlugin.dll is not registered on the host system.
Solution
1. Open a Command Prompt.
Start, Run, cmd
2. Navigate to the C:\Program Files\Microsoft Device Emulator\1.0\ directory.
3. Register the SERDMAAsPlugin.dll.
regsvr32 SERDMAAsPlugin.dll
4. Reset the emulator device.
5. Open Microsoft ActiveSync.
6. Select File, Connection Settings.
7. Ensure that "Allow connections to one of the following" is checked and that the DMA connection type is listed within the drop down box. -
Hello All,
I am using Oracle 11gR2 on AIX 7.1.
My question is about memory_target parameter with RAC, what I usually do is to put this parameter equal to 40% of the RAMs on the database server in single instance database.
With Oracle RAC, should it be 40% of the summation of RAM on all nodes? for ex if I have 2 nodes with 40 GB RAM on each node, so i can put my memory_target= 40% of (40+40)= 32 G ?? is that correct or it will be 40 % of the RAM on 1 node?? is it by Instance or by database ?
How do i know if a parameter is at the database level or instance level?
Regards,NB wrote:
Hello All,
I am using Oracle 11gR2 on AIX 7.1.
My question is about memory_target parameter with RAC, what I usually do is to put this parameter equal to 40% of the RAMs on the database server in single instance database.
With Oracle RAC, should it be 40% of the summation of RAM on all nodes? for ex if I have 2 nodes with 40 GB RAM on each node, so i can put my memory_target= 40% of (40+40)= 32 G ?? is that correct or it will be 40 % of the RAM on 1 node?? is it by Instance or by database ?
How do i know if a parameter is at the database level or instance level?
Regards,Its _40 % of the RAM on 1 node_ recommended approach. Since Memory_target wil consume the memory of server, so rest 60% is available to OS to do his work. If you put 40% of (40+40) = 32 GB on each node then there is very little memory left for OS(you can see decrease in performance).
Its 2 node RAC, so each instance has its own set of parameter in pfile/spfile. So we can say its instance specific. Each node can have same of different values of memory_target parameter
Edited by: 909592 on Mar 7, 2012 7:04 PM -
Oracle sequence problem in CMP Entity EJB
I have a problem with Oracle sequence when I am using from the CMP entity EJB in WebLogic
6.1:
The problem is when the WebLogic server starts it acquires the correct sequence number
from Oracle, but during the runtime, when I open a new sqlplus window and increment
the sequence number, the container is not picking up from the new incremented value
instead it is still continuining by incrementing the old sequence number it has acquired
when it fetched from Oracle last time.
The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xml are exactly
same
Any help would be greatly appreciated.Change the key-cache-size to 1 in weblogic-cmp-rdbms-jar.xml and then try
your experiment again.
-- Anand
"Satya" <[email protected]> wrote in message
news:3d06274c$[email protected]..
>
I have a problem with Oracle sequence when I am using from the CMP entityEJB in WebLogic
6.1:
The problem is when the WebLogic server starts it acquires the correctsequence number
from Oracle, but during the runtime, when I open a new sqlplus window andincrement
the sequence number, the container is not picking up from the newincremented value
instead it is still continuining by incrementing the old sequence numberit has acquired
when it fetched from Oracle last time.
The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xmlare exactly
same
Any help would be greatly appreciated. -
TOAD 8.5 with Oracle Instant Client 10: ORA-03134
Hi,
I have tried TOAD 8.5.0.50 and also TOra 1.3.16 to connect to the database via Oracle Instant Client 10, but I am restricted with this error message:
"ORA-03134: Connections to this server version are no longer supported."
Does anyone have any idea what is wrong? Earlier version of TOAD works alright. We are using Oracle 8i. Are there any compatibility issues between Oracle database version with Oracle Instant Client version?
Thanks.Just want to share with everyone. This is a reply that I got from another forum:
this is a oracle bug!
connections with the 10g client are supported to 8.1.7.0 and above.
the bug in the client causes this error.
you are only able to connect to 8.1.7.4 and above.
i made a service request but oracle is not able to patch the
instant client.
you have to use 10.1.0.3 client or above
Regards. -
CD LISTS AVAILABLE WITH ORACLE FINANCIALS
Dear All,
Our company is palnning to Purchase Oracle 10g Database along with Oracle Financials. May I know what all prodiucts we get with this. I need to know what all CD list available with this product.
Thanks
Deepakcheck edelivery.oracle.com for financals (ebusiness), and download.oracle.com (10g db) and check the cds.
fadi
http://oracle-magic.blogspot.com -
Cd Details available with Oracle Financials
Dear All,
Our company is palnning to Purchase Oracle 10g Database along with Oracle Financials. May I know what all prodiucts we get with this. I need to know what all CD list available with this product.
Thanks
Deepakcheck edelivery.oracle.com for financals (ebusiness), and download.oracle.com (10g db) and check the cds.
fadi
http://oracle-magic.blogspot.com -
Installation BOBJ XI 3 on UNIX ( Sun Solaris ) with Oracle database
Hi All,
I want to deploy and install BOBJ XI Enterprise 3.1 on Sun Solaris with oracle database.
My question is, do we need to add some oracle licenses stuff in BOBJ XI Enterprise server or we just using a connection from Sun Solaris to oracle database ?
Pls Advise,
Rgds,
DennyHi Denny,
the risk is the same whatever DB server you are using. Once you have a setup where more than one application access the server, overload caused by one application can influence the performance of the other ones. You have to check if your DB vendor offers tools to monitor and limit the load on your DB server. But we are talking hypothetically now. I would recommend to check what's the actual load on your oracle DB server. If the server is not working at the limit (let's over 80% all the time), then I think that you can try to install BOBJ also in an existing oracle instance on the oracle server. You can reduce the risk and make the maintenance easier if you setup a dedicated oracle instance on your DB server just for the BOBJ repository.
Regards,
Stratos
Maybe you are looking for
-
File name for append processing mode with time stamp
Hi Experts we are doing file to file scenario using the processing mode as Append. the requirement for us to append the files and we need to have new file name with time stamp added to the appended file.but in the processing mode of the file adapter
-
I am going to be creating a slide show and then burning it to a couple of DVDs. I have used PPT in the past for simple slide shows for speaking engagements, but I am interested in adding music to this slide show. What is the best/easiest applicatio
-
please help me how to authorize my computer as it always say The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.
-
Safari 8.0.2 won't open
Safari kept going to MacKeeper and another site. Found a solution on this site to remove some malware. (Yes, unfortunately, I loaned this Macbook to a college kid, and he apparently must have downloaded things he should not have.) I got halfway th
-
What function name to use when calling an XI RFC Sender adapter?
Hello experts, I need some help please... We are trying to setup an RFC Sender adapter in XI 3.0 for the first time. We followed Michal's <a href="/people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step on how to se