Sql query question! about insert and select

i kinda wanna know if i can do something like this
INSERT INTO "table1" ("column1", "column2", ...) SELECT "column3"+1, "column4", ... FROM "table2"
since i wanna make the column increase by one, can i just do something like ++ or +1?
please help

hi
ya u can do this
this is i tried n its working fine
insert into emp1(empno,sal) Select empno,sal+1 from emp
wats ur column data type?
regds
Ashish

Similar Messages

  • Database - Show SQL Query question..

    Greetings:
        I am helping a co-worker with Crystal. I don't use crystal but I am able to explain the problem. My co worker is currently using crystal reports 8.5. If he pulls a query and the report is generated he can then click on Database menu then click on Show SQL Query. From there he is able to edit, add, remove fields. Now we want to place him on Crystal V10. When he does the same task, instead of being able to edit the Show SQL query he can only view it. Is there a way around this so that he can Edit the sql query in version 10 or did that feature go away in versions 9 and above. Also we are going to Purchase Crystal 2008, is this feature available in 08? Any help would be appreicated..

    Hi there!
    I have the same problem as described above.  I have been asked to figure out what is wrong with one of the reports that used to work when we used MAS 4.05.  We are now on MAS 4.20 with Crystal Reports v.10 and the report fails to run.  I loaded the report into Crystal to see if I could see the problem and I discovered that the report is still trying to access a table from the old MAS database.  The SQL code as shown in the Show SQL Query window is as follows:
    SELECT "AR_InvoiceHistoryHeader"."InvoiceNo", "AR_InvoiceHistoryDetail"."ItemCodeDesc", "AR_InvoiceHistoryDetail"."ItemCode", "AR_InvoiceHistoryDetail"."ExtensionAmt"
    FROM   "AR_InvoiceHistoryHeader" "AR_InvoiceHistoryHeader", "AR_InvoiceHistoryDetail" "AR_InvoiceHistoryDetail"   
    WHERE  "AR_InvoiceHistoryHeader"."InvoiceNo"="AR_InvoiceHistoryDetail"."InvoiceNo" AND "AR_InvoiceHistoryHeader"."HeaderSeqNo"="AR_InvoiceHistoryDetail"."HeaderSeqNo" AND "AR_InvoiceHistoryHeader"."CommissionAmt"="AR_InvoiceHistoryDetail"."CommissionAmt" AND      ARO_InvHistoryDetail."SOItemNumber" <> 'COMMENT' AND      ARN_InvHistoryHeader."InvoiceDate" = {d '2007-09-21'}  
    ORDER BY "AR_InvoiceHistoryHeader"."InvoiceNo"
    The problem is that ARN_InvHistoryHeader needs to be AR_InvoiceHistoryHeader and SOItemNumber needs to be ItemCode.
    When I go into the Database Expert, I can only see the tables in the FROM clause.  I don't know how to modify the WHERE clause.  It kind of looks like this report was only partially converted to the new version.  Is there a way to changed these attributes without rebuilding the whole report?
    By the way, I apologize for not setting my SQL off in a code box, but I tried that and it caused the page to be very wide with no horizontal scroll bar.
    Edited by: Jason Schill on Oct 27, 2008 11:30 PM

  • One question about Pricing and Conditions puzzle me for a long time!

    One question about Pricing and Conditions puzzle me for a long time.I take one example to explain my question:
    1-First,my sale order use pricing procedure RVAA01.
    2-Next,the pricing procedure RVAA01 have some condition type,such as EK01(Actual Costs),PR00(Price)....,and so on.
    3-Next,the condition type PR00 define the Access Sequences PR00 as it's Access Sequences.
    4-Next,the Access Sequences PR00 have some Condition tables,such as:
         table 118 : "Empties" Prices (Material-Dependent)
         table 5 : Customer/Material
         table 6 : Price List Type/Currency/Material
         table 4 : Material
    5-Next,I need to maintain Condition tables's Records.Such as the table 5(Customer/Material).I guess the sap would supply one screen for me to input the data of table 5.At this screen,the sap would ask me to select one table,such as table 5.When I select the table 5,the sap would go to the screen to let me input the data of table 5.But when I use the T-CODE VK31 or VK32 to maintain Condition tables's Record,I found it's total different from my guess:
    A-First,I can not found one place for me to open the table,such as table 5,to let me input the data?
    B-Second,For example,when I select the VK31->Discounts/Surcharges->By Customer/Material,the sap show the grid view at the right side.At the each line of the grid view,you need to select the Condition Type at the first field.And this make me confused very much.Why the sap need me to select one Condition Type but not the Condition table?To the normal logic,it ought not to select Condition table but not the Condition Type!
    Dear all,I'm a new one in sd.May be this is a very stupid question.But it did puzzle me for a long time.If any one can  explain this question in detail and let me understand the concept,I will appreciate him/her very much.Thank you.

    Hi,
    You said that you are using the T.codes VK31 or VK32.
    These transaction codes are used to enter condition records for standard condition types. As you can see a grid left side having all the standard condition types like price, discounts, taxes, frieghts.
    Pl check using T.code VK11 OR VK12 (change mode)
    Here you can enter the required condition type, in the intial screen. (like PR00, MWST, K004, K005 .....etc)
    After giving the condition type, press enter or click on Combinations icon on top of the screen. Then you can see all the condition tables which you maintained for that condition type. Like as you said table 118, table 5, table 6 and table 4.
    You can select any table and press enter, then you can go into the screen in which you have all the field cataglogues you maintained for that table. For example you selected combination of Customer/Material (table 5) then after you press enter then you can see customer field on top, and material fields.
    You can give all the required values and save the conditon record.
    Hope this is clear.
    REWARD IF HELPFUL.
    Regards,
    praveen

  • Inserting and Selecting LONG with PRO*C

    Is there any special hints in order to use
    the LONG datatype with pro*c ? Can I insert
    and select this kind of type like any other
    CHAR/VARCHAR/VARCHAR2, even if this field
    has a length of about 65536 chars ?

    Well, random because it is not always the same nor the error code.
    - Sometimes I get segmentation fault on "sqlcxt";
    - "ORA-01024: invalid datatype in OCI call" on queries that usually work
    - "ORA-03114: not connected to ORACLE" on queries that usually work
    I have run valgrind and the only "place" where there could be an issue is reported to be caused by oracle libs:
    ==27055== 8,214 bytes in 1 blocks are possibly lost in loss record 193 of 206
    ==27055== at 0x40046FF: calloc (vg_replace_malloc.c:279)
    ==27055== by 0x43E2975: nsbal (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x42F04E6: nsiorini (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x4300FD2: nsopenalloc_nsntx (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x42FFD73: nsopenmplx (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x42F91FD: nsopen (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x42BDAFE: nscall1 (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x42BB0D7: nscall (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x435F653: niotns (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x43F9E40: nigcall (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x436AD4B: osncon (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)
    ==27055== by 0x41EAA31: kpuadef (in /home/oracle/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1)

  • URGENT !! Capture the insert and select on database

    Hi,
    I need to capture the inserts and selects on the database.
    What are the options available on 9i?
    Thanks in advance!

    I don;t know how many times I've had to say this, but since I've had to say it to my boss, it bears repeating here:
    The SPFILE makes absolutely zero, null, nought difference to whether or not something is changeable dynamically or not. Not one bit, one whit or one iota.
    Parameters are as static or as dynamic as they were when init.oras rules the roost. Check in V$PARAMETER: if the thing says ISSYSMODIFIABLE is TRUE, then the parameter can be altered with an alter system command -and that's true whether you're using an init.ora or an spfile. If it says ISSYSMODIFIABLE=FALSE, then the parameter CANNOT be altered with an alter system command, and that's true whether you're using an init.ora or an spfile.
    Now comes the subtlety: if you add SCOPE=SPFILE to your alter system command then you aren't actually altering the system at all. All you're doing is asking the instance to edit the spfile. So an alter system set db_block_size=67238 scope=spfile will work, because you're not actually asking to alter the current block size at all. You're merely asking the instance to do what you would otherwise have done with notepad or gedit to a traditional init.ora.
    Only if you SCOPE=MEMORY is your alter system command actually trying to change the currently running instance.
    Of course, the trouble starts when you miss off a SCOPE clause, because then you get SCOPE=BOTH, which means MEMORY+SPFILE. But try that on a parameter which is SYSMODIFIABLE=FALSE: it won't work, because the MEMORY bit trips over the fact that the parameter is not system (dynamically) modifiable. Which just goes to prove that the existence of an SPFILE changes ABSOLUTELY NOTHING about whether a parameter can be dynamically modified or not.
    So no, the sentence "my database is using spfile and I have option to use alter system command" makes zero sense if, by it, you mean "I'm using an spfile so can I change things dynamically which I wouldn't be allowed to if I was stuck using a boring old init.ora"
    The answer is always and forever, "NO"!
    I blame a certain bouffant-haired so-called expert for first promulgating this myth that all parameters suddenly became dynamic in the presence of an spfile. It was never true when he wrote it. It isn't true now. It never will be true. It just happens to be the case that "alter system..scope=spfile" is Oracle's equivalent of "vi init.ora" as far as spfiles are concerned.

  • Insert and select in one statement

    using MS Sql server and VB i can execute two queries Insert and select in one statement e.g. (insert into (....) values (...) Select @@Identity).
    how can i do the same thing using Oracle and VB. ???
    It gives error. here's what i want to do.
    (insert into table1 (...) values (...) Select table1_sequence.currval from dual )
    Khurram

    Here's how you can achieve the same Oracle :-
    Test Db>desc tmp1;
    Name Null? Type
    EMP_NO VARCHAR2(10)
    EID NUMBER
    Test Db>insert into tmp1 (emp_no, eid)
    2 select '123', 1
    3 from dual;
    1 row created.
    Shailender Mehta

  • A question about grub and USB

    Hi All
    I have a quick question about grub and USB that I can't quite find the answer to by searching.   Most of the FAQs discuss booting a full linux dristribution from USB. My situation is this.  I am getting a new computer with two drives, the second will be arch and the first will be Vista (for my wife).  I want the computer to boot the same way that my wife's machine boots at work so I don't want to install grub on the MBR.  So, is there a way to have all of the grub config files and kernels installed on the second drive and simply install to grub boot loader to the MBR of a USB stick?  My goal would be to simply plug the USB stick into the new PC and boot arch from the second drive. 
    Thanks
    Kev

    i cant say for hp's
    havent worked on any in a while
    recent machines have been coupleof dell's , vaio & emachine
    which dells do offer it at least the ones i tried , my laptop does(dell)
    all home pc's are built by me which do offer to boot individual drives
    what hp you getting it may tell in specs
    are both discs sata? if so it might not offer this option with 2 drives of same interface
    check your power supply alot of these preconfigured machines put cheap under reated power supplies in there
    & will burn your motherboard i just replaced PS(250 watt) & mobo(845gvsr) in an emachines <cheap stuff<
    i hope you researched the pc before buying ie : mobo, power supply are the biggest concerns
    i find it much more benificial to build my own machine gives me peace at mind. the cost is sometimes more in $ but not always , your biggest expense is time researching hardware
    if you live in usa the best places to start looking are bensbargains.net & pricewatch.com
    i am not affiliated with either & niether sell the hardware they are just advertisers a place to buy
    for costomized machines that i would trust is unitedmicro.com theyll asemble & test before shipping
    i have gotten 2 machines so far from them with NO PROBLEMS with hardware (knock knock)
    you may want to consider this in your next venture for pc

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

  • A few questions about MacBooks and Parallels Desktop.

    I have a few questions about MacBooks and Parallels Desktop.
    1) I understand I need at least 1GB of RAM to run Parallels Desktop but what about the hard drive, is the stock 60GB drive big enough?
    2) Related to question 1, even if it was big enough to allow me to install and run Windows would the 60GB drive be enough if I wanted to install a Linux distribution as well?
    3) This has nothing to do with Parallels Desktop but thought I'd ask it here anyway, do Apple Stores carry just the stock MacBooks, or do they carry other configurations?
    Thanks
    Keith

    1. Depend on how intensive you use that HD for saving data on both Mac OS and XP. For standard installation on both OS X and XP, the space of 60 Gb is enough.
    2. Same answer as no 1. You can install all three on that HD space, but the extra spacce available will be less and less for your data. You can save your data on external or back up on cd/dvd and erase it from the HD to keep the free space.
    Remember to leave at least 2 or 3 Gb for virtual memory usage.
    3. Just call them, maybe they don't have it in store stock, but by appointment they might configure one for you before your pick-up date.
    Good Luck

  • Need to run a sql query in the background and display the output in HTML

    Hi Guys,
    I have a link in my iprocurement webpage, when i click this link, a query (sql query) should be run and the output should be displayed in a HTML page. Any ideas of how this can be done. Help appreciated.
    We dont have OA Framework and we r using 11.5.7.
    help needed
    thanx

    Read Metalink Note 275880.1 which has the link to developer guide and personalization guide.

  • 2 question about GPU and Lens correction ,cs5

    Hi
    i have 2 questions about Gpu and lens correction in Cs5
    1)Filter->lens correction->search online
    i get often and almost every connection time out at the first click on search online , at the second click i get no online profile
    is it normal?
    2) question is about Gpu
    it run faster , but talking about ajustament layer
    like saturation or vibrance for example
    i found with the gpu on , a light slow refresh compared with gpu off
    i have set cache  levels 6 ,history 20
    i guess are the defaul
    well i add a saturation layer and move the saturation slide ,increase o decrease saturation
    with Gpu Off , the changes are immedially , i mean i can see in real time the increase o decrease of saturation
    with Gpu On it takes a few(very few) time more
    again is normal ?
    don't be angry , i'm going to buy cs5 and i'm unsecure ... the price make a big role
    thanks

    For what it's worth, I also see a timeout on the first [ Search Online ] click, after about half a minute delay.  Second click turns up results immediately.  This happens each time Lens Correction is started, even without restarting Photoshop, and in both 32 and 64 bit versions.  Also note that I started with one profile listed by default (though from the wrong camera) for my 40D with 28-135 zoom.
    I alsow noticed that I was seeing progress bar activity in the Lens Correction dialog while I was typing this (even though Lens Correction was NOT the active window) every time I hit the 'L' key.  Strange.
    Windows 7 x64.
    -Noel

  • Three questions about Java and Ftp

    Hello, i've the following questions about Java and Ftp:
    1- .netrc file is in $HOME directory but i can't access to this directory from java code. The following line producesan Exception (directory doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");
    2- .netrc file must have the following permissions: -rw- --- --- but when i create the .netrc file the following permissions are on default: -rw- r-- r--, how can i change this permissions? (In java code, i can't use chmod.....)
    3- Are there any way to pass parameters to a .netrc file? If i get to do this i needn't change the permissions because i can't modify or create/destroy this file.
    Thanks in advanced!!!
    Kike

    1- .netrc file is in $HOME directory but i can't
    access to this directory from java code. The
    following line producesan Exception (directory
    doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");$HOME would have to be replaced by a shell, I don't
    think you can use it as part of a legal path.
    Instead, use System.getProperty("user.home");
    Ok, thanks
    2- .netrc file must have the followingpermissions:
    -rw- --- --- but when i create the .netrc file the
    following permissions are on default: -rw- r--r--,
    how can i change this permissions? (In java code,i
    can't use chmod.....)Yes, you can: Runtime.exec("chmod ...");
    I need to use estrictly the .netrc with -rw- --- --- permissions
    Yes, i can use Runtime.exec ("chmod ..."); but i don't like very much this solution because is a slow solution, am i right?
    3- Are there any way to pass parameters to a.netrc
    file? If i get to do this i needn't change the
    permissions because i can't modify orcreate/destroy
    this file.I don't think so. Why do you need the .netrc file in
    Java at all? Writing a GUI frontend?I want to use automatic ftp in a java program and FTP server, the files and path are not always the same, so i can:
    - modify .netrc (for me is the complex option)
    - destroy and create a new .netrc (is easier but i have permissions problem)
    - use .netrc with parameters but i haven't found any help about it
    Thanks for your prompt reply!!!!
    Kike

  • Basic question about storage and safety in iMovie '11

    A very basic question about storage and safety:
    I want to keep a backup of my raw footage on my external hard drive prior to begin working on the movie in iMovie. I want to do this:
    1. Upload the digital files from my camcorder to my Desktop *(as opposed to iMovie)*
    2. Duplicate that footage/clips.
    3. Put the duplicate clips/footage into a folder labeled with the name of that footage (like "Fun At the Dentist" or "Jimmy Learns How to Yodel").
    4. Drag the folder with the footage/clips into my external hard drive into a pre-existing folder titled "Backups/duplicates of all of my raw footage/clips." This big granddaddy folder will house all of the child folders of different movies.
    5 Then, open up iMovie '11 and import the raw footage/clips from my Desktop rather than from my camcorder.
    6. Then I want to make a duplicate of my finished movie and put it in my external hard drive in a "Finished Movies" folder.
    I know that the original raw unedited footage will always be in iMovies '11 but I want the original to also exist immediately accessible in my external hard drive.
    QUESTION:
    Is this viable? Is it wise? (I know it goes an extra unnecessary step, but aside from that.)
    *Do you have any precautionary advice?* Should I do something in my iMovies '11 preferences? What?
    In earlier years with iMovie '04 or '06 (cannot recall) I made many novice errors and ended up losing audio to my finished movie. I also lost footage.
    This time around with iMovie '11 I don't to make such novice, ignorant errors.
    Thanks so much for any comments to this question.
    -L

    Yes I'm sure it will work great for you.
    The iFrame format is something Apple has come up with. The reason for its existence is unknown to me so I can only speculate. But it seems to me that Apple "invented" this format in order to have devices such as Ipod/Ipad/Iphone/Ixxx create clips that are editable on consumer hardware such as already mentioned devices but also standard Mac computers, without the need for format conversion.
    iMovie converts most input formats during import, which takes a lot of time, and this need for conversion often comes as a surprise to most people new to home video editing.
    iFrame has a resolution of 960x540 which is long way from the common standards of 1920x1080 and 1280x720. If your end target is YouTube however, this may not be too bad though. However if you intend to go with YouTube HD, you may find iFrame footage to look wrong since they are effectively upscaled to a higher resolution.
    Technically iFrame uses the H.264 algorithm, a smaller frame size (960x540) and a rather low compression scheme. This will result in large files, but the plus side is that the files are ready for editing without the need for any conversion and iMovie will natively edit the files.

  • 2 time zones during inserting and selecting the data.

    we have applied DST patch and DST JAVA patch sucessfuly on oracle 10.1.0.3 version database . After that we have problem
    It was noticed that it failing for the following 2 time zones during inserting and selecting the data.
    MST7
    HST10
    Please help me to solve this

    Try MetaLink. Lots of hits on ORA-1882.
    Specifically, Note 414590.1 "Time Zone IDs for 7 Time Zones Changed in Time Zone Files Version 3 and Higher, Possible ORA-1882 After Upgrade" sounds promising.
    -Mark

  • Question about RAC and ASM

    Hi,
    We are thinking about build RAC using ASM for OEM database. It'll have two nodes, oracle 10g and Hitachi san with solaris ( or linux ). I've few questions about RAC and ASM.
    1) Do I need to have ASM instance running on each node ? ( most likely yes... but want to make sure )
    2) can I share oracle_home between ASM instance and database instance ? what is the best choice ?
    3) I'm planning to use shared disks for all files, all databases.... what are the pros/cons ?
    4) what should be the installation procedure ? Meaning, first create ASM instance on each node, then install cluster software, build RAC databases...... can someone explain..
    5) I believe RMAN is the only option for backup since I'm using ASM, correct ?
    I'm a newbie to RAC and ASM..
    Thanks,

    user4866039 wrote:
    1) Do I need to have ASM instance running on each node ? ( most likely yes... but want to make sure )yes.
    2) can I share oracle_home between ASM instance and database instance ? what is the best choice ?in 10g you can, in 11gr2 you cannot. and it might be better to seperate them because it will give you more flexibility with patching.
    3) I'm planning to use shared disks for all files, all databases.... what are the pros/cons ?if you share your oracle_home you won't be able to do rolling updates. so i recommend to keep oracle_homes local.
    4) what should be the installation procedure ? Meaning, first create ASM instance on each node, then install cluster software, build RAC databases...... can someone explain..follow the install guide for your respective version. for 10g you'd install clusterware first, then asm and database is last.
    5) I believe RMAN is the only option for backup since I'm using ASM, correct ?pretty much. you could stop your database and dump the raw devices or use asmcmd/asmftp but rman is definitely the best choice
    Bjoern

Maybe you are looking for