Suggest a new SQL statement  feature.

Hi all:
I hope ORACLE has such a new feature, to reduce the client codes. We usually do that: Inserting a record to a table, if some columns have existed, then update it, else insert this new record. I assume this statement is:
INSERT INTO MYTABLE (A,B,C) VALUES (1, 2, 3) UPDATE EXISTS (A, B)
It's mean that if A and B is duplicated (exists a row that A=1 and B=2), then UPDATE column C value of these rows to 3 implicitly.
let me know your ideas about it. thanks!!!
Bob.yang

But MERGE is a 9i Feature with Insert & Update.
Thats what ur requriment is for no need for
delete.Your point being?
No harm in alerting people to new capabilities...

Similar Messages

  • How can I get an autogenerated value in Postgres within a new SQL statement?

    There are two possible ways that I could go about doing this. 
    The firstn the creation of a new record, my schema in Postgres automatically inserts a unique value into a given field.  However, whenever I run queries to get that value using Teststand, I get an error that states the value is null.  However, querying from psql, I am able to see the UUID.
    Note that the field itself is not problematic.  If ask for the UUID value in the previous record, it fetches the value from two records ago--which is a bit odd, but is better than recieving a null value.
    The second way to do this is to query the sequence which we use to generate the UUID.  In Postgres a sequence is simply an autoincrementing value.  Each time it is used, it increments by a given amount.  Further, the current value of the sequence can be queried as follows:
    SELECT last_value FROM *sequence_name_goes_here*
    However, running this query and then trying to get that value and store it also returns a null error.  To be fair though, the sequence is not viewable within the Teststand Database Viewer. 
    For reference, I'm using Teststand 2.0.  For the driver I'm using the Microsoft OLE DB Provider for ODBC Drivers.  I'm using Postgres 8.0.12.
    I'd appreciate any thoughts or suggestions on how to make this work.  Does anyone here have Postgres experience?
    Note that the same Teststand code that we're running now worked fine in Access, but causes the aforementioned errors in Postgres.
    Thanks,
    Tim

    Brandon,
    Thanks for getting back to me.
    I'm not quite sure what you mean.  I'm using Teststand's sequence editor.  Within this there are options for running SQL queries.
    For connecting to Postgres, I'm using a .udl file that relies on a Postgres ANSI driver, which I believe came with my install of Postgres.
    In any event, I think I've narrowed down my question a bit (now that I understand more how Teststand works).
    When one runs an SQL query within Teststand you have the options of "Fetch previous," "Current," etc.  This was connected to the default Access schema (UUT_RESULT) and a RUN_ID was generated on every "CREATE NEW RECORD." 
    I think the problem is that, when you run a "SELECT" query with the parameter set to "Create new record" Access will generate the RUN_ID before returning the results.  With Postgres, it won't generate the RUN_ID until one inserts the "default values."  Here is the SQL log of what Teststand is sending Postgres:
    Mar 26 14:01:37 [postgres] [12-1] <46081865.1bcd>LOG:  statement: SELECT uut_result.run_id, uut_result.station_id, uut_result.start_date_time  FROM uut_re
    sult
    Mar 26 14:01:37 [postgres] [13-1] <46081865.1bcd>LOG:  statement: INSERT INTO uut_result DEFAULT VALUES
    To do this, I just have to run "set" and then "put" without setting or putting any specific values.
    So here is my updated question:
    If I run a new select query(over a new statement) and choose "Fetch next", each time I call that it will iterate through the select query, starting with the very first record.  My question is, how can I tell it to stop when it gets to the last record, since there is no telling what the last record is?  Or, in general, how can I get the values in the final record?  We've changed the RUN_ID to simply be an incrementing integer, so if a MAX aggregate function can be run, that might work.
    Any ideas?
    Thanks,
    Tim

  • Suggestion for new OVI Maps feature: Friend(s)

    Hi!
    I have a suggestion to make OVI Maps better.
    I have seen in computer games teammates/enemies on maps or  radars.
    Hence I came up with a very nice idea:
    Let's say I'm in a forest picking berries or fishing or just searching my friend.
    Now why not have a feature, so that I can "pair" with my friend, so that both of us will have dots on maps, which will show friend(s) location...
    The possible utilization could be by bluetooth or/and by network.
    The problem I see is, that with bluetooth the connection usually ends about 8-10 meters, especially in forests. The network on the other hand will make data costs go pretty high. I don't know, if you can use phone as a wifi adapter, but that also has pretty limited range and is hence useless.
    Now Iets post some ideas about how to implement connection between two (or more) phones. It will be very nice to hear
    Attachments:
    Image112x.jpg ‏39 KB

    bump

  • 30EA1: New SQL History?

    Hi,
    The SQL History from previous versions is not retained, but luckily not physically deleted either. It seems 3.0 has a new system? (If so, please remember to include it in the migration process before release!)
    Thanks,
    K.

    In my case I can see what looks like migrated SQL History (based on dates and content) but none of the new SQL statements are being shown. I could live without the migrated statements if I could get new statements to show up.

  • Question regarding suggestion of new features

    I'm probably going to touch on a sensitive topic, but please hear me out. In working with some legacy systems and I have the need to deal with unsigned values. Needless to say this is difficult to do in Java. There are some work around solutions, but they are hardly ideal. I would like to suggest this feature be added to the language. The question I have is how do I go about suggesting a new feature and get the ball rolling? Is it as simple as forking and developing it all yourself hoping it gets merged in or does it mean you have to go through the JCP?
    Thoughts?

    TuringPest wrote:
    you still havent shown that you NEED unsigned ints.
    That's kind of an odd statement. Let me see if I'm hearing you right. I don't NEED unsigned ints because I can always cast them up to longs, etc and handle them that way? Does the fact that one is not the other play a role? Say like I were to commit that back to a database (or worse, a binary file). I'd have to always do some conversion and handle an overflow possibility because I'm treating it as a long...
    also, there might be another good reason beyond the fact that they arent really necessary:
    the java opcodes were made to fit into a byte.
    as it is now, a lot of those opcodes are used
    for primitive conversions and every permutation of primitive arithmetic.
    if they added 4 more primitives to the existing 6...Couldn't that statement apply to any language addition? "I'm sorry I shouldn't do it because I've only got a byte and need to save it for more useful stuff."

  • How to a make a suggestion about new features i'd like to see in itunes

    how to a make a suggestion about new features i'd like to see in itunes?
    I can't find any link to do this. I found a page where you can request songs or an album to be added, but i can't find a page to submit my suggestions for itunes i have for new features i'd like to see

    As of now there is no good, direct link for feedback on iTunes itself. Writing Apple might be the best option, with the website feedback page perhaps the next best.

  • I would suggest a new feature:The possibilty to change the mouse pointer icon when you hover on an a

    I would suggest a new feature:The possibilty  to change the mouse pointer icon when you hover on an active link by any other one icon I select.

    Current Firefox versions have a feature called tear-off tabs.<br />
    You can detach a tab from the current window and open it in a new window by dragging a tab in the browser window.<br />
    You can drag that tab back to the tab bar in the original window to undo that detaching.
    bug489729 (Disable detach and tear off tab):
    * https://addons.mozilla.org/firefox/addon/bug489729-disable-detach-and-t

  • TopLink does not generate SQL statements for inserting new objects

    TopLink does not generate SQL statements for inserting new objects. Why?
    Thanks in advance...

    Please see the response in
    Why does not unitofwork.commit write data to the database?
    Regards,
    Chris

  • New sessions every time an sql statement is issued

    Hi, I have a problem with using oraoledb (v 10.1.0) with VB6 accessing an Oracle database 9i (v 9.2.0.6). Every time an sql statement is issued in the client side, a new session is started in the server side (seen in Enterprise Manager). I don´'t know why. Is an oraoledb parameter or a database parameter? How can I avoid this? The big problem behind this behaviour is controling row locking. If I issue a "select field from table where conditions for update nowait(or wait n)", this creates a lock that belongs to a session. If a few sentences after I issue an "update the-same-table set the-same-field = value where the-same-condition" as this one creates a new session, an ORA-00054 is raised telling the row(s) is blocked.
    any idea?
    thanks

    I'm a DBA and I encountered the same problem with a system developed for our company. We reported that to the company that developed the application and they sey then close the conections, but they remain in the database.
    Could anyone find a solution for this? I believe is a problem in the VB code, but I do not know anything from VB.
    thanks,
    Lisandro

  • Creating a conditional index? How to suggest a new feature?

    How can I suggest a new feature in Oracle?
    Imagine a table of service requests to be processed, where a column named STATUS can be: 'N': New, 'C': Canceled or 'P': Processed. This will result in a biased distribution where 'P' will represent more than 99% of rows.
    I know that Oracle accept indexes created using functions and I can create an index on decode(STATUS,'P',null,STATUS) to make index small. But it will not help a query on STATUS = 'N' condition.
    I would like to create a conditional index like:
    create index idx01 on service_requests (status) where status <> 'P';
    In this example, only status 'N' and 'C' will be indexed resulting in a very small index that can resolve filters like STATUS = 'N'.
    Or this:
    create index idx01 on some_tables (column1 including null values); to resolve COLUMN1 is NULL
    Is there a way to suggest new features like this?

    How can I suggest a new feature in Oracle?
    Imagine a table of service requests to be processed, where a column named STATUS can be: 'N': New, 'C': Canceled or 'P': Processed. This will result in a biased distribution where 'P' will represent more than 99% of rows.
    I know that Oracle accept indexes created using functions and I can create an index on decode(STATUS,'P',null,STATUS) to make index small. But it will not help a query on STATUS = 'N' condition.
    I would like to create a conditional index like:
    create index idx01 on service_requests (status) where status <> 'P';
    In this example, only status 'N' and 'C' will be indexed resulting in a very small index that can resolve filters like STATUS = 'N'.
    Or this:
    create index idx01 on some_tables (column1 including null values); to resolve COLUMN1 is NULL
    Is there a way to suggest new features like this?
    A new feature isn't needed. Oracle provides the equivalent of that 'conditional index' by allowing you to create, and index, VIRTUAL columns.
    This code uses a VIRTUAL column and then creates an index on it.
    drop table test_status
    create table test_status (col1 number,
         status varchar2(1),
         special_status generated always as (decode(STATUS,'P',null,STATUS)
    create index idx01 on test_status (special_status)

  • Adding a field to an sql statement in Oracle Reports error ORA-00933

    We have been requested to add a field that already exists in the table referred to by the sql statement in Oracle Reports Builder. The report was set up by a consultant about 3 yrs ago and we don't really have much skill in this area. What is happening when I try to modify the SQL statement, either adding a field or deleting a field to the SELECT statement, causes an error message preventing the statement from being saved. The only way out of the error message is to click Cancel. The error message is
    ORA-00933:SQL command not properly ended
    ORDER BY Program ==> NAME
    Even adding or deleting a space anywhere in the SQL statement causes the error (not adding any new fields). A coworker found that if we comment out the ORDER BY, the statement will accept the new field in the SELECT section, however then we lose the order by functionality. I would like to add one additional field before the FROM. Not sure if any additional data are needed. Thank you.
    SELECT p.person_uid PIDM_KEY, p.id_number ID,
                   p.full_name_lfmi name,            
                    p.BIRTH_DATE, p.GENDER Sex,
                    Decode(a.residency,'D',p.Primary_ethnicity,'F')  Ethn,
                    a.academic_period TERM,        
                    CASE WHEN :p_group_by = 'PROGRAM' THEN a.program
                                 ELSE ' '
                    END AS Program,
                    a.COLLEGE, a.degree, a.major, ' ' rule,
                    a.STUDENT_POPULATION,a.STUDENT_LEVEL,    a.application_status Status,  a.application_status_date app_sts_dte,
                    ad.decision_date1 Last_Dec_Date,
                    ad.decision1||' '||ad.decision2||' '|| ad.decision3||' '|| ad.decision4||' '|| ad.decision5 Decisions,
                    /*  Deposit Date uses the last term entered in :p_term parameter string */
                    (SELECT MAX(deposit_effective_date) FROM usf_as_deposit WHERE account_uid = a.person_uid &term_clause group by account_uid)   AS "DEPOSIT DATE",     
                    ph.phone as PHONE,
                    CASE WHEN PS.FIRST_CONTACT IN ('NET','PAP','COM','COP') THEN PS.First_Contact
                     ELSE CASE WHEN ps.latest_contact IN ('NET','PAP','COM','COP') THEN PS.Latest_Contact
                                ELSE '  '
                                END
                    END AS FIRST_CONTACT,
                    DECODE(:p_address,'Y',REPLACE(adr.street1||' '||adr.street2||' '||adr.street3||' '||adr.city||','||adr.state||' '||adr.nation||' '||adr.zip,'  ',' '),' ') as  address, adr.nation, adr.state,
                    goremal_email_address email, a.residency, a.application_date, p.primary_ethnicity, c.cohort
    FROM MST_ADMISSIONS_APPLICATION A,
               MST_PERSON p,mst_pre_student PS,  Admissions_Cohort c, usf_v_phone_pr_ma ph,
               MST_admissions_decision_slot AD, usf_v_email, usf_v_address_dr_lr_ma_pr adr
    WHERE a.PERSON_UID = p.person_uid
            AND a.curriculum_priority  = 1
            AND a.person_uid = ps.person_uid
           AND a.person_uid = ad.person_Uid(+)
           AND a.person_uid = goremal_pidm(+)
           AND a.person_uid = adr.pidm(+)
           AND a.person_uid = ph.pidm(+)
           AND ph.rnum(+) = 1
           AND a.person_uid = c.person_uid(+)
           AND a.academic_period = c.academic_period(+)
      &Where_Clause
           /*    TAKE OUT FOLLOWING LINE AFTER DATA IS CLEANED UP  */
            AND NOT(p.id_number = '00000000'   OR SUBSTR(p.id_number,1,1) = 'B'  OR UPPER(p.full_name_lfmi)  LIKE '%TESTING%')
           AND  a.application_status_date >= NVL(:p_as_of_date,sysdate-8000)
           AND a.academic_period = ad.academic_period(+)
            AND a.application_number = ad.application_number(+)
            AND a.degree <> 'ND'    /*   AND a.college <> 'LW'                         --  Does not need non-degree and law students    */
           &Cohort_Clause 
    ORDER BY Program  &ORDER_CLAUSE

    Hi Denis,
    I tried your suggestion. The good thing is that adding the comma allowed me to be able to add a.campus to the select statement, unfortunately, another error message happened.
    ORA-00936: missing expression SELECT p . person_uid PIDM_KEY ,
    p . id_number , p . full_name_lfmi name , p . BIRTH_DATE , p . GENDER Sex ,
    Decode ( a . residency , 'D' , p . Primary_Ethnicity , 'F' ) Ethn , a . academic_period TERM ,
    CASE WHEN : P_group_by = 'PROGRAM THEN a I started over and tried only putting in the comma and get the same message even though I didn't add campus. After that, removed the comma which led to the ORA-00933 error message. So once again, I had to close the file without saving, in order for the report to run at all.

  • Microsoft DPM 2010 no longer works for WSS 3.0 SP3 farm since moving farm to new SQL cluster

    Hi,
    I've had Microsoft DPM (first 2007, then 2010) backing up my WSS 3.0 SP3 farm since 2009.  This weekend, I had to migrate the WSS farm to a new SQL 2008 SP1 cluster.  I am using a SQL alias after the move.  I mean, I set the alias up several
    weeks before the move, but the alias name and server name were the same - SQL01.  Now the alias name is SQL01 and the server name is SQL02.  I know, that's exactly the way you shouldn't do it, but this farm is just months away from being decommissioned,
    so I don't want to rock the boat. 
    So, here's the problem.  Right after the SQL migration, I get a warning in DPM at the start of a recovery point creation session that states that all of the content databases have been deleted from the farm and are no longer protected.  I thought
    the best thing to do would be to delete and recreate the protection group.  Big mistake.  I deleted the protection group, that was just protecting the farm, and kept the replica data (14 weeks worth).  When I try to create a new protection group,
    I can expand the SharePoint farm underneath the assigned WFE, but I get the dreaded pop-up: "DPM cannot protect this SharePoint farm as it cannot detect the configuration of the dependent SQL databases. (ID: 32008)"  I've verified that the three
    suggested items in the error message are indeed functioning correctly, but I cannot get past this error.  The WFE appears to be configured correctly, as I have run the enablesharepointprotection command using an account that is both a farm admin and a
    local admin on the WFE.  When I run resolveallsqlaliases, it does show all of my content databases with the appropriate alias name and logical path.  On the SQL server, both the SQL Server VSS writer and Volume Shadow Copy services are up and running,
    as well as the DPMRA service, which I manually started when trying to create the protection group.  I have the SQL Server VSS Writer service running as the same farm admin account that I configured on the WFE. 
    So, I'm not sure where to go next.  It appears that the issue doesn't lie with the WFE since it can enumerate all of the content databases correctly.  Is there something I'm missing on the SQL server?  Oh, and I have the VSS and DPMRA services
    set up the same on both nodes.  I've been working on this since yesterday and I'm at my wits end! 
    Any help or suggestions would be much appreciated!
    Thanks,
    Mike

    How much content is in the farm and when are you planning to decommission it? 
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • How can we suggest a new DBA OCE certification for very large databases?

    How can we suggest a new DBA OCE certification for very large databases?
    What web site, or what phone number can we call to suggest creating a VLDB OCE certification.
    The largest databases that I have ever worked with barely over 1 Trillion Bytes.
    Some people told me that the results of being a DBA totally change when you have a VERY LARGE DATABASE.
    I could guess that maybe some of the following topics of how to configure might be on it,
    * Partitioning
    * parallel
    * bigger block size - DSS vs OLTP
    * etc
    Where could I send in a recommendation?
    Thanks Roger

    I wish there were some details about the OCE data warehousing.
    Look at the topics for 1Z0-515. Assume that the 'lightweight' topics will go (like Best Practices) and that there will be more technical topics added.
    Oracle Database 11g Data Warehousing Essentials | Oracle Certification Exam
    Overview of Data Warehousing
      Describe the benefits of a data warehouse
      Describe the technical characteristics of a data warehouse
      Describe the Oracle Database structures used primarily by a data warehouse
      Explain the use of materialized views
      Implement Database Resource Manager to control resource usage
      Identify and explain the benefits provided by standard Oracle Database 11g enhancements for a data warehouse
    Parallelism
      Explain how the Oracle optimizer determines the degree of parallelism
      Configure parallelism
      Explain how parallelism and partitioning work together
    Partitioning
      Describe types of partitioning
      Describe the benefits of partitioning
      Implement partition-wise joins
    Result Cache
      Describe how the SQL Result Cache operates
      Identify the scenarios which benefit the most from Result Set Caching
    OLAP
      Explain how Oracle OLAP delivers high performance
      Describe how applications can access data stored in Oracle OLAP cubes
    Advanced Compression
      Explain the benefits provided by Advanced Compression
      Explain how Advanced Compression operates
      Describe how Advanced Compression interacts with other Oracle options and utilities
    Data integration
      Explain Oracle's overall approach to data integration
      Describe the benefits provided by ODI
      Differentiate the components of ODI
      Create integration data flows with ODI
      Ensure data quality with OWB
      Explain the concept and use of real-time data integration
      Describe the architecture of Oracle's data integration solutions
    Data mining and analysis
      Describe the components of Oracle's Data Mining option
      Describe the analytical functions provided by Oracle Data Mining
      Identify use cases that can benefit from Oracle Data Mining
      Identify which Oracle products use Oracle Data Mining
    Sizing
      Properly size all resources to be used in a data warehouse configuration
    Exadata
      Describe the architecture of the Sun Oracle Database Machine
      Describe configuration options for an Exadata Storage Server
      Explain the advantages provided by the Exadata Storage Server
    Best practices for performance
      Employ best practices to load incremental data into a data warehouse
      Employ best practices for using Oracle features to implement high performance data warehouses

  • Using arrays in sql statement

    Hello,
    I would like to use integer array( say..int count[] = new int[3];) on my sql statement to retrieve some values. Is there a way to use int array variable in sql statement?. If yes, how should I approach doing that?.
    Thank You in Advance.
    Regards,
    Pinal.

    I'm going to be honest, I'm not so sure there is such a thing in standard SQL syntax so it would depend upon the database you were using as to whether this option was available as part of the SQL language.
    My suggestion would be to cheat, naughty I know:String arrayString = "";
    for (int i = 0; i < arrayInt.size(); i++) {
      arrayString += "**" + arrayInt;
    arrayString = arrayString.substring(2, arrayString.length());Then just parse arrayString in to an SQL VARCHAR or TEXT field.
    Obviously when you return it just use StringTokenizer to split the string up using your deliminator (in this case **) and then convert the values back into an int array.
    I'm not sure how efficient that code would be but it should do the job.

  • HOW do I create a href to an sql statement?

    Answer to query:
    “You sould create a href to an sql statement ( create new user / passwd : and insert in a table (C_user,C_PASSWD), to have a list of users registred at your application)
    A htp page can manage this
    you should create roles that be granted to users,
    1- create &user dientified by &passwd;
    2- create role1....;
    3- grant &role1 to &user1;
    :user will be added by user if he chooses registration href.
    then he must add information in order to continue registration or push OK to confirm registration and let oracle grant previleges to the new user, a trigger can insert the new informations to the user_table_traces.”
    MY QUESTION:
    HOW do I create a href to an sql statement?
    Thank You

    Hello,
    I have an application written in PL/SQL that sits on top of an Oracle database. I want to know how add a password/login feature to the application. In other words the user can go to a certain URL to access and use the application. However when the user clicks on a certain link that is restricted, then the webpage displays fields so that the user has to enter a username and password. In order to access restricted features of the application such as ADD, UPDATE and DELETE.
    Thanks

Maybe you are looking for

  • Failed iOS5 update now 3gs stuck in recovery

    every time I try to update it in itunes it gives error 37. Has done it on 3 different computers (imac, snow leopard/macbook pro, lion, dell/windows 7). please help!

  • NEW FORMAT FOR DISCUSSIONS

    does anyone else wish that apple would stop reinventing the wheel and leave a good thing alone? i used to solve every problem thru the great posts on this site. now i cant find anything. this new format is the most user unfriendly i have ever experie

  • BO 4.0 Recommended Hardware Requirements

    Hi all, Now I run the BO 4.0 SP4 base on these requirements:      Processor --> 2.0 GHz with 4 Cores      RAM --> 11 GB      OS --> Windows Server 2008 R2 Enterprise (VMWare) However, I would like to upgrade the hardware specification to increase the

  • HT4946 my ipad display a message that it is disabled

    my ipad display a message that it is disabled

  • Vsftpd: How to mix virtual and local users for pam?

    Hello, I've been stumped on this for many days, hope someone could shed some light for me. vsftpd.conf pam_service_name=ftp local_enable=YES chroot_local_user=YES guest_enable=YES guest_username=virtual virtual_use_local_privs=YES /etc/pam.d/ftp auth