The best way to know if you a  data  in a table

hello
I have a doubt what 's the best way to know if you have a value in a table .For example I have a table called Vehicle , that have two rows id and name . Well I want to know before do somthing if the vehicle with mane '11111', exist or not .
Nowadays i do this operation with a : select count ( id ) into num from vehicle;
This is the best way ???
THANKS

Hello
Well here's an alternative that may help in your situation. The idea is that you put all of your values that you will be testing for the existence of, in a collection. Then use INTERSECT to find out which of those are already present in the table.
It may well turn out to be completely useless, but I'm trying to avoid working on what I am supposed to be working on, and I thought I'd try it out ;-)
CREATE TABLE dt_test_vehicle(veh_name     VARCHAR2(20));
INSERT INTO dt_test_vehicle values('1111');
INSERT INTO dt_test_vehicle values('2222');
INSERT INTO dt_test_vehicle values('4444');
INSERT INTO dt_test_vehicle values('5555');
INSERT INTO dt_test_vehicle values('6666');
CREATE TYPE dt_tt_varchar2 IS TABLE OF VARCHAR2(20)
set serveroutput on
DECLARE
     ltt_Params     dt_tt_varchar2;
     ltt_Result     dt_tt_varchar2;
BEGIN
     ltt_Params := dt_tt_varchar2();
     ltt_Params.EXTEND(4);
     ltt_Params(1) := '1111';
     ltt_Params(2) := '2222';
     ltt_Params(3) := '3333';
     ltt_Params(4) := '4444';
     SELECT
          veh_name
     BULK COLLECT INTO
          ltt_Result
     FROM
          (SELECT
               veh_name
          FROM
               dt_test_vehicle
          INTERSECT
          SELECT
               column_value
          FROM
               TABLE(CAST(ltt_Params AS dt_tt_varchar2))
     IF ltt_Result.COUNT > 0 THEN
          FOR li_Idx IN ltt_Result.FIRST..ltt_Result.LAST LOOP
               dbms_output.put_line(ltt_Result(li_Idx));
          END LOOP;
     ELSE
          dbms_output.put_line('Nothing there, everything is good to go');
     END IF;
END;Delete rows from the test table to see the changing results. The main reason I was thinking of this way of doing it was so you could handle your messages in one hit rather than having to have a separate exception for each parameter you are testing.
HTH
David
Sorry, I just re-read your post, and you need to know if these parameters are NOT there, in which case you should give an error. In that case, you could change the INTERSECT for MINUS. If you have anything in the resulting collection, these are the parameters that are missing from the table.
Message was edited by:
david_tyler

Similar Messages

  • I have a PPC iMac 10.4.11 and will shortly buy a new i Mac.  What is the best way to transfer all my HD date from old to new? Thank you!

    I have a PPC iMac 10.4.11 and will shortly buy a new i Mac.  What is the best way to transfer all my HD date from old to new? Thank you!

    Migrating from PPC Macs to Intel Macs:
    https://discussions.apple.com/docs/DOC-2295
    How to use Migration Assistant:
    http://support.apple.com/kb/HT4413?viewlocale=en_US
    http://support.apple.com/kb/TS1963
    Troubleshooting Firewire target disk mode:
    http://support.apple.com/kb/HT1661

  • My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

    My Mum( a pensioner) is wanting to purchase both an iPhone and iPad.  What is the best way for her to manage her data /calls/txt etc. obviously the cost needs to be as low as possible.  Currently does not have WiFi but uses dongle

  • What is the best way to transfer all of my data from my iPod touch 3rd generation to my iPhone 4s?

    I have a 3rd generation iPod touch, and now I am getting an iPhone 4s. What is the best way to transfer all of my data, including paid-for apps and music, from the iPod to the iPhone without losing anything? Can I just do it through iTunes or the iCloud? I have never used iCloud before.

    Follow the directions here:
    http://support.apple.com/kb/HT2109

  • What is the best way to know if a Mac is compromised?

    Recently, my mom got an email from Walmart that had said it had tracking information on something she had ordered. Now she had been doing a lot of holiday shopping and couldn't remember if she had shipped anything from Walmart. She clicked the link in the email and it took her to this site that looked like it belonged to a law firm, but had no navigation to anything.
    Now, I already think this sounds bad, but my computer knowledge barely extends to Macs. Does anyone here have a good way to tell if her Mac has been compromised? Also, if it does turn out she's being monitored what is the best way to go about fixing it?

    I use them mainly to make sure that something I send out does not cause a problem for a Windows user - though I prefer ClamXav. I've had it running on one mac or another for over six years and have never had a problem with it corrupting anything though, even the earlier versions. Both it and Sophos have caught a few parasites, but mainly with regards to exe and zipped files. Sophos, I'm newer to, and I am interested by your comment about it slowing the computer down - I will look into that for myself.
    I  download Windows software for friends, or for peecees that I'm fixing for others. If I do a search for software or drivers on a peecee, I get slammed with site after site of spam, ****, or anything else that can try to pretend it is a valid file. If I do on a Mac, I don't have hours of my time wasted trying to sift through garbage.

  • What is the best way to store and search 2D data

    Hi,
    There is a set of data (~10k records ) in 2D dimension.
    like this :
    Col 1, Col 2, Col3....
    What is the best way to store and search those records ?
    Thanks in advance
    Wilson

    Hi,
    Either userObjet[][] if you know how much data you have, and the data size is fixed, or use a list of lists. E.g. A Vector of Vectors (some will probably say that you should use an ArrayList instead, and that could be the case, but it sounds like you would want to display the data later on, and a DefaultTableModel (for JTables) uses a Vector as data holder).
    Kaj

  • What is the best way to write 10 channels of data each sampled at 4kHz to file?

    Hi everyone,
    I have developed a vi with about 8 AI channels and 2 AO channels... The vi uses a number of parallel while loops to acquire, process, and display continous data.. All data are read at 400 points per loop interation and all synchronously sampled at 4kHz...
    My questions is: Which is the best way of writing the data to file? The "Write Measurement To File.vi" or low-level "open/create file" and "close file" functions? From my understanding there are limitations with both approaches, which I have outlines below..
    The "Write Measurement To File.vi" is simple to use and closes the file after each interation so if the program crashes not all data would necessary be lost; however, the fact it closes and opens the file after each iteration consumes the processor and takes time... This may cause lags or data to be lost, which I absolutely do not want..
    The low-level "open/create file" and "close file" functions involves a bit more coding, but does not require the file to be closed/opened after each iteration; so processor consumption is reduced and associated lag due to continuous open/close operations will not occur.. However, if the program crashes while data is being acquired ALL data in the buffer yet to be written will be lost... This is risky to me...
    Does anyone have any comments or suggestions about which way I should go?... At the end of the day, I want to be able to start/stop the write to file process within a running while loop... To do this can the opn/create file and close file functions even be used (as they will need to be inside a while loop)?
    I think I am ok with the coding... Just the some help to clarify which direction I should go and the pros and cons for each...
    Regards,
    Jack
    Attachments:
    TMS [PXI] FINAL DONE.vi ‏338 KB

    One thing you have not mentioned is how you are consuming the data after you save it.  Your solution should be compatible with whatever software you are using at both ends.
    Your data rate (40kS/s) is relatively slow.  You can achieve it using just about any format from ASCII, to raw binary and TDMS, provided you keep your file open and close operations out of the write loop.  I would recommend a producer/consumer architecture to decouple the data collection from the data writing.  This may not be necessary at the low rates you are using, but it is good practice and would enable you to scale to hardware limited speeds.
    TDMS was designed for logging and is a safe format (<fullDisclosure> I am a National Instruments employee </fullDisclosure> ).  If you are worried about power failures, you should flush it after every write operation, since TDMS can buffer data and write it in larger chunks to give better performance and smaller file sizes.  This will make it slower, but should not be an issue at your write speeds.  Make sure you read up on the use of TDMS and how and when it buffers data so you can make sure your implementation does what you would like it to do.
    If you have further questions, let us know.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • What is the best way to implement default values stored in a DB table?

    [JHeadstart 10.1.3 build 78]
    [JDeveloper 10.1.3 SU4]
    We are struggling on how to best implement default values that are stored in a DB table. What we have is a database table with (CODE_TYPE, TABLE_NAME, COLUMN_NAME, DEFAULT_VALUE) as columns. This way the application administrator can administer default values himself/herself. Now we need to find the best way to set these table supplied default values in new rows. Globally we are aware of two ways:
    - override create() method on VO
    - probably create a View Object on top of the database table with default values (we are capable of transposing the table and return exactly one row with a column for each default value) and use JHeadstarts item property 'Default Value'.
    We prefer the latter, since this is more declarative, however we struggle with the EL expression needed to indicate the default value.
    If we have a VO named "DefaultValues" with a SELECT on a view on top of our database table (transposed) returning exactly one row, let us say:
    SELECT orglanguage, orgtype, orgstatus [...]
    FROM v_default_values
    --> returning exactly one row
    and we want an EL expression on an item that needs the value from orglanguage. What will the EL expression be? Something like:
    #{data.DefaultValuesPageDef.currentrow.orglanguage.inputValue}? We tried several things but they do not work. A static default value works, but every EL expression so far does not. We know that using "data" can be dangerous, but thought JHeadstart takes care of preparing the other Page Definitions, so it might be possible when you use JHeadstart.
    Or is overriding the create() method the preferred way? Or do we have to look at a Managed Bean for our default values that we refer to from EL (let us say MyAppDefaultValuesBean) and in that case: how do you associate a Managed Bean with a VO?
    Any help would be appreciated. Apart from these default values, things are going rather well in this first J2EE/JHS project for us!
    Toine

    Steven,
    Thanks for the reply. Unfortunately whatever we try, we cannot get it to work. We started looking at the second option (since we do need default values also in table lay-out new rows). We created a DefaultValues ViewObject, added it to the Application Module, added an EL expressiona to the Default Display Value property (replacing your ending ")" with a "}" offcourse ;-)), ran the JAG so that a page definition was generated for DefaultValues and we managed to get it prepared when loading for example the Organisation's jspx page. However no default value appears in a new row (not in Form, not in Table layout).
    I then created a quick application on top of the HR schema, added a DefaultValues ViewObject using one calculated attribute (set Salary fixed to 1000), added the EL expression to the Salary Default Display Value property in the Employees Group, made sure the DefaultValuesPageDef is prepared by adding it to the parameter section and I see it getting prepared. I also see a managed Bean is created in the Employees-bean.xml.
    In the Embedded OC4J log we see:
    16:01:01 DEBUG (JhsPageLifecycle) -executing onCreate
    16:01:01 DEBUG (JhsPageLifecycle) -CreateEmployeesDefaultValues bean found, applying default values to new row
    2006-08-02 16:01:01.825 WARNING [ADFc] Warning: No Method onCreateEmployees and no actionBinding CreateEmployees found.
    Is it this warning we should be worried about? Since no default value is created.
    The managed bean (Employees-beans.xml) looks like:
    <?xml version="1.0" encoding="windows-1252"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    <managed-bean>
    <managed-bean-name>CreateEmployeesDefaultValues</managed-bean-name>
    <managed-bean-class>oracle.jheadstart.controller.jsf.bean.DefaultValuesBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>iteratorBinding</property-name>
    <value>#{bindings.EmployeesIterator}</value>
    </managed-property>
    <managed-property>
    <property-name>defaultValues</property-name>
    <map-entries>
    <map-entry>
    <key>Salary</key>
    <value>#{data.DefaultValuesPageDef.DefaultValuesIterator.currentRow.Salary}</value>
    </map-entry>
    </map-entries>
    </managed-property>
    <managed-property>
    <property-name>actionResult</property-name>
    <value>CreateEmployees</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>searchEmployees</managed-bean-name>
    <managed-bean-class>oracle.jheadstart.controller.jsf.bean.JhsSearchBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>bindings</property-name>
    <value>#{data.EmployeesPageDef}</value>
    </managed-property>
    <managed-property>
    <property-name>searchBinding</property-name>
    <value>#{data.EmployeesPageDef.advancedSearchEmployees}</value>
    </managed-property>
    <managed-property>
    <property-name>searchAttribute</property-name>
    <value>EmployeeId</value>
    </managed-property>
    <managed-property>
    <property-name>dataCollection</property-name>
    <value>EmployeesView1</value>
    </managed-property>
    <managed-property>
    <property-name>autoquery</property-name>
    <value>true</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>EmployeesCollectionModel</managed-bean-name>
    <managed-bean-class>oracle.jheadstart.controller.jsf.bean.JhsCollectionModel</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>jhsPageLifecycle</property-name>
    <value>#{jhsPageLifecycle}</value>
    </managed-property>
    <managed-property>
    <property-name>bindings</property-name>
    <value>#{bindings}</value>
    </managed-property>
    <managed-property>
    <property-name>rangeBinding</property-name>
    <value>#{bindings.EmployeesTable}</value>
    </managed-property>
    <managed-property>
    <property-name>defaultValues</property-name>
    <value>#{CreateEmployeesDefaultValues.defaultValues}</value>
    </managed-property>
    </managed-bean>
    </faces-config>
    This is the DefaultValues.xml:
    <?xml version='1.0' encoding='windows-1252' ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <ViewObject
    Name="DefaultValues"
    BindingStyle="OracleName"
    CustomQuery="true"
    ComponentClass="hr.model.DefaultValuesImpl"
    UseGlueCode="false" >
    <DesignTime>
    <Attr Name="_version" Value="10.1.3.36.73" />
    <Attr Name="_codeGenFlag2" Value="Access|Coll|VarAccess" />
    </DesignTime>
    <ViewAttribute
    Name="Salary"
    IsUpdateable="false"
    IsPersistent="false"
    Precision="255"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    AliasName="SALARY"
    Expression="1000"
    SQLType="VARCHAR" >
    </ViewAttribute>
    </ViewObject>
    The PageDef for Defaultvalues is like:
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.3.36.73" id="DefaultValuesPageDef"
    Package="hr.view.pagedefs" EnableTokenValidation="false">
    <parameters/>
    <executables>
    <iterator id="DefaultValuesIterator"
    Binds="AppModuleDataControl.DefaultValues1"
    DataControl="AppModuleDataControl" RangeSize="10"/>
    </executables>
    <bindings>
    <attributeValues id="DefaultValuesSalary"
    IterBinding="DefaultValuesIterator">
    <AttrNames>
    <Item Value="Salary"/>
    </AttrNames>
    </attributeValues>
    <table id="DefaultValuesTable" IterBinding="DefaultValuesIterator">
    <AttrNames>
    <Item Value="Salary"/>
    </AttrNames>
    </table>
    <action id="FirstDefaultValues" IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="12"/>
    <action id="PreviousDefaultValues" IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="11"/>
    <action id="NextDefaultValues" IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="10"/>
    <action id="LastDefaultValues" IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="13"/>
    <methodAction RequiresUpdateModel="true" Action="999"
    id="advancedSearchDefaultValues"
    IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl"
    InstanceName="AppModuleDataControl.dataProvider"
    MethodName="advancedSearch"
    ReturnName="AppModuleDataControl.methodResults.AppModuleDataControl_dataProvider_advancedSearch_result"
    IsViewObjectMethod="false">
    <NamedData NDName="viewObjectUsage"
    NDValue="#{searchDefaultValues.dataCollection}"
    NDType="java.lang.String"/>
    <NamedData NDName="arguments" NDValue="#{searchDefaultValues.arguments}"
    NDType="java.util.ArrayList"/>
    <NamedData NDName="allConditionsMet"
    NDValue="#{searchDefaultValues.allConditionsMet}"
    NDType="java.lang.Boolean"/>
    </methodAction>
    <action id="setCurrentRowWithKeyDefaultValues"
    IterBinding="DefaultValuesIterator"
    InstanceName="AppModuleDataControl.DefaultValues1"
    DataControl="AppModuleDataControl" RequiresUpdateModel="false"
    Action="96">
    <NamedData NDName="rowKeyStr" NDValue="#{row.rowKeyStr}"
    NDType="java.lang.String"/>
    </action>
    <action id="CreateDefaultValues" IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="40"/>
    <action id="DeleteDefaultValues" IterBinding="DefaultValuesIterator"
    DataControl="AppModuleDataControl" RequiresUpdateModel="false"
    Action="30"/>
    <action id="Commit" RequiresUpdateModel="true" Action="100"
    DataControl="AppModuleDataControl"/>
    <action id="Rollback" RequiresUpdateModel="false" Action="101"
    DataControl="AppModuleDataControl"/>
    </bindings>
    </pageDefinition>
    We do not understand what is wrong and why the default values do not get created in the new rows (and it is taking us far too much time). Any chance the EL expression is still wrong? It is a shame that any syntax errors in EL expressions are not visible in some logfile. It looks like when EL expressions are wrong, they are ignored instead of raising an error...
    Toine

  • What is the best way to keep Drivers up to date?

    Hi Guys
    I am looking to keep a range of makes and models drivers up to date. I have done a bit of reading through a few blogs and wondering if DPInst.exe through a required task sequence is the best way?; if SCUP 2011 is useable?;
    or is there a better way?
    Thanking you in advance
    NN

    I have done a post on the subject myself. The blog is mainly for my own purpose, but I hope you get the basics of it:
    http://www.imab.dk/extending-hardware-inventory-in-sccm2012/
    Martin Bengtsson | www.imab.dk
    Thats very interesting, thanks you.
    NN
    Oh, you might need to know how to use regkeytomof, which is the tool that generates the .mof edits you need:
    http://be.enhansoft.com/post/2014/02/13/How-to-Use-RegKeyToMof.aspx
    Martin Bengtsson | www.imab.dk

  • What is the best way to read and manipulate large data in excel files and show them in Sharepoint

    Hi ,
    I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
    What is the best way to read the data form the excel file in fastest and most efficient way.
    2 nd Problem,
    I have one excel file that has many rows each row contain some data that has certain keywords.
    What I want is  to segregate the data of rows into respective sheets(tabs ) in the workbook.
    for example in rows have following data 
    1. Alfa
    2beta
    3 gama
    4beta
    5gama
    6gama
    7alfa
    in excel
    I want there to be 3 tabs now with each of the key words alfa beta and gamma.

    Hi,
    I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
    as there's size limitations (probably the default max size is 10MB).
    Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
    However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • What is the best way to move all of my data from an iPad 4 to an air?

    Santa brought an iPad Air and I need to transfer my data and apps from the old iPad I have had.  Help on the best way to do this since I played with the new machine yesterday and some of the things transfered but not all.
    Thanks!

    How to Transfer Everything from an Old iPad to New iPad
    http://osxdaily.com/2012/03/16/transfer-old-ipad-to-new-ipad/
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device
    http://support.apple.com/kb/HT2109
    Moving Content to a New iPad
    http://tinyurl.com/qzk2a26
    Transferring your prepaid cellular data account depends on your carrier. AT&T lets you move it yourself when you go to Cellular Data in Settings and log into your account with your previous AT&T user name and password. For iPads with Sprint service, you can set up an account on the new iPad and contact Sprint Customer Care (888-211-4727 and go through the menus) to deactivate the old plan and get credit for unused service. For Verizon, call the company’s customer service number for mobile broadband support (800-786-8419) and ask to have your account transferred.
     Cheers, Tom

  • What is the best way to re-install my apps data when changing the hard disk

    My MacBook (120Gb disk) is finally full and I have ordered a 500Gb disk to replace it.
    I am fine with changing over the disk but can anyone tell me the best way to reload all my apps and data from the present disk please?
    I have a Time Machine backup on a Network disk, a copy of SuperDuper and also my original 10.5 OSX install disks.
    Thanks

    Roger, since you have SuperDuper, I think the easiest thing to do would be to make a clone of your current hard drive to the new one when it arrives. You will need an external enclosure for the new drive; make sure it's formatted to Mac OS Extended (Journaled); Disk Utility will do this for you. Then connect that new drive via firewire or USB, and create the clone from your current drive using SuperDuper. Next, remove the internal drive from your Mac, insert the new drive and boot up. You can then place your older drive in the external enclosure to use for extra storage, though it won't be large enough to use as a cloned backup with SuperDuper.
    Good luck!

  • What's the best way to delete 2.4 million of records from table?

    We are having two tables one is production one and another is temp table which data we want to insert into production table. temp table having 2.5 million of records and on the other side production table is having billions of records. the thing which we want to do just simple delete already existed records from production table and then insert the remaining records from temp to production table.
    Can anyone guide what's the best way to do this?
    Thanks,
    Waheed.

    Waheed Azhar wrote:
    production table is live and data is appending in this table on random basis. if i go insert data from temp to prod table a pk voilation exception occured bcoz already a record is exist in prod table which we are going to insert from temp to prod
    If you really just want to insert the records and don't want to update the matching ones and you're already on 10g you could use the "DML error logging" facility of the INSERT command, which would log all failed records but succeeds for the remaining ones.
    You can create a suitable exception table using the DBMS_ERRLOG.CREATE_ERROR_LOG procedure and then use the "LOG ERRORS INTO" clause of the INSERT command. Note that you can't use the "direct-path" insert mode (APPEND hint) if you expect to encounter UNIQUE CONSTRAINT violations, because this can't be logged and cause the direct-path insert to fail. Since this is a "live" table you probably don't want to use the direct-path insert anyway.
    See the manuals for more information: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB
    Sample taken from 10g manuals:
    CREATE TABLE raises (emp_id NUMBER, sal NUMBER
       CONSTRAINT check_sal CHECK(sal > 8000));
    EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('raises', 'errlog');
    INSERT INTO raises
       SELECT employee_id, salary*1.1 FROM employees
       WHERE commission_pct > .2
       LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10;
    SELECT ORA_ERR_MESG$, ORA_ERR_TAG$, emp_id, sal FROM errlog;
    ORA_ERR_MESG$               ORA_ERR_TAG$         EMP_ID SAL
    ORA-02290: check constraint my_bad               161    7700
    (HR.SYS_C004266) violatedIf the number of rows in the temp table is not too large and you have a suitable index on the large table for the lookup you could also try to use a NOT EXISTS clause in the insert command:
    INSERT INTO <large_table>
    SELECT ...
    FROM TEMP A
    WHERE NOT EXISTS (
    SELECT NULL
    FROM <large_table> B
    WHERE B.<lookup> = A.<key>
    );But you need to check the execution plan, because a hash join using a full table scan on the <large_table> is probably something you want to avoid.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • What is the best way of persisting Web-application related data?

    My web-application needs to persist some data (a set of XML documents), i.e. save them so that they can survive server or application shutdowns. Saving those documents as files in server's filesystem does not seem to be convinient to me because the container may run the application directly form WAR and it is impossible (maybe I am wrong?) to modify files inside WAR archive. Forcing WAR extraction requires container reconfiguration and is container implementation dependent, which is not acceptable.
    What would be ideal is some individual persistent storage bound to an application which does not require any external enitites (external databases etc). And this storage should not depend on any particular implementation of servlet container.
    So is there a way to do something like this?

    Saving it to disk seems like your only alternative.
    Presuming you have at least some control over the machine where it is deployed to, you could specify a directory to save the xml documents to (ie not one under your web application structure) This would get around the limitations of the WAR file not being extracted.
    Make the directory an environment variable/init parameter in your web.xml file.
    All you need then is a directory on the server that you have write permissions to.
    Ok it requires more setup when deploying the web application, but I thinks its about the only way to accomplish what you want to do.

  • What's the best way to know whether an application is running for the first time? (C#)

    I seen suggestions like making a registry entry, or making an entry in the application specific settings file. But what's the best practice? I want to do some custom tasks if that is a first run.
    Also, I am deploying my application using per machine MSI installer. So un-installation not deleting the user specific config files that's get created under AppData.
    Thanks Prasad

    Hello,
    Whenever possible I prefer to avoid the registry. The following works once per user where we see if a specific folder exists or not, if it does not then do first time initialization work then set a setting in the project which causes a user config file to
    be written to the location for storing user settings per user. 
    You first need to create a setting in the project, in this case I did
    var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
    string configPath = config.FilePath.Replace("\\user.config", "");
    if (System.IO.Directory.Exists(configPath) )
    Console.WriteLine("This is not the first time");
    else
    // Do one time setup here
    Properties.Settings.Default.FirstTimeValue = "1";
    Properties.Settings.Default.Save();
    Console.WriteLine("This was the first time");
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

Maybe you are looking for

  • Trouble with Adobe dng converter and 5d mark iii

    I have recently downloaded the dng converter 6.7 to convert my cr2 files from my 5d mark iii, however it keeps on telling me i have no files to convert, is there anything i can do about this? i am using elements 10

  • Generating mapping documentation in BW

    Hi all, I am looking for a mapping documentation in BW, that shows me the data flow from cube to datasource in detail for every concerned info object in an overview. That must be more comfortable than the lists I get from the metadata repository and

  • How to serialize the txt file?

    HI, part of my program is as followings: FileInputStream f = new FileInputStream ("c:/test1.txt"); ObjectInputStream s =new ObjectInputStream (f); but,there is an exception when debugging when it runs to second line above.I think this is the problem

  • Revision level of material automatically assign to purchase order

    Hello all, when I create a new purchase order for a material, is it possible to assign the latest revision level of that material (material master - basic data 1) automatically to the Revision level field on item level - Material data for the materia

  • Entourage 2008 email sync with PocketPC WIndows Mobile 6

    Hi: Does anybody know a software or procedure for syncronize emails between Entourage 2008 and PocketPC? I´ve tried Missing Sync and PocketMac but unfortunately none can do it. They only include notes, tasks, contacts, calendar, but email isnt includ