Help me with TRUNCATE command

1 begin
2 TRUNCATE TABLE atrd.revrec;
3* eND;
SQL> /
TRUNCATE TABLE atrd.revrec;
ERROR at line 2:
ORA-06550: line 2, column 11:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "TABLE" to continue.

Check out this procedure. i think your problem will solve your all problems.
declare
mcount int;
my_drop varchar2(500):='drop table emp';
my_create varchar2(500):='create table emp as select * from LG_TYPES';
my_trunc varchar2(200):='truncate table emp';
begin
select count(*) into mcount from tab where UPPER(LTRIM(RTRIM(TNAME)))='ABC#';
if mcount>0 then
delete from abc#;
execute immediate my_drop;
end if;
execute immediate my_create;
execute immediate my_trunc;
end;

Similar Messages

  • Can anyone help me with the commands to import and restore  backup from  another administrative server

    Dear all.
                         Can anyone help me with the commands to import and restore  backup from  another administrative server

    I tried, even with code tags it looks the same since the 2500 character limit is exceeded.
    Please post just the relevant parts inside tags as mentioned, and choose a descriptive subject line.
    I'm locking this thread.
    Thomas

  • Help needed with DATAEXPORT command

    Hello,
    I'm looking for some help with the DATAEXPORT command. It was working for us previously and recently it started giving us problems. Now when I run a DATAEXPORT within a calcscript in order to get a subset of the data, the exported file contains 13, sometimes 14 data columns rather than 12 data columns (one for each month)
    When I perfom a full data export the export file is perfect (select the database, right click and select “Export”, enter file path and name, select ‘Level 0 data blocks” and “Export in column format” and click ok.)
    Here's the Calc script that I'm using:
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    SET CALCPARALLEL 3;
    SET DATAEXPORTOPTIONS
    DataExportLevel LEVEL0;
    DataExportDynamicCalc OFF;
    DataExportColFormat ON;
    DataExportDimHeader ON;
    DataExportOverwriteFile ON;
    FIX(
    @Relative("Clients",0),
    @Relative("TOTLOC",0),
    @Relative("LOB",0),
    @Relative("Project",0),
    @Relative("Entities",0),
    @Relative("Dept",0),
    "USD",
    "SCN_Actual",
    "SCN_Plan",
    "Ver_Final",
    @Relative("ACC_GAAPPL",0),
    @Relative("ACC_MGMTPL",0),
    "FY08",
    Jan:Dec
    DATAEXPORT "File" "!" "X:\Hyperion_Share\Hyperion_PRD\Planning\exp_rpts_test3.txt" "#MI" ;
    ENDFIX
    I'm hoping someone has seen this before and suggest a solution.
    Thanks,
    Chris

    Hi Chris
    I noticed something similar when I first tested the DATAEXPORT calc script command but couldn't get to the bottom of the cause.
    It seemed to be an issue where the first month(s) were #Mi but later months had data, e.g. Jan:Mar = #Mi, Apr = 10, May = 20 etc.
    After a certain point in the export file data didn't align correctly when compared to the export in column format as you mention, in fact a number of rows that should have had data returned nothing and some rows existed where there was no corresponding data in the database. I remember noticing that I never had more than 13 data columns. This happened to correspond to the number of level0 time periods I had (I had 'BegBalance' as well as Jan:Dec).
    I did a test on exporting all level0 time periods, forcing it to have 13 columns one for each level0 time period and it worked and matched the export in column format.
    Fortunately for me the client changed the requirement and only wanted the total for the year exported so I never quite got to the bottom of it but hope that it helps you.
    Stuart Game
    www.analitica.co.uk

  • Truncate command

    With truncate command the default option is drop ,how about reuse ?
    truncate table table_name reuse ;
    What does reuse mean here .
    With regards

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_107a.htm#2067573

  • Could someone help me with comparing the contents of 2 folders?

    I'm trying to compare my iTunes music folder which is located in it's default location with a external USB hard drive. I was reading this article on how to do it using Terminal but I have NO CLUE on what to type in the command line. I'm clueless on this! Could someone help me with the commands I need to compare the 2 folders? I've included the link about what I'm trying to accomplish.
    http://www.macworld.com/article/132219/2008/02/termfoldercomp.html

    I tell you how. But remember that Terminal isn't a good place to be kicking around if you're not sure of what your doing. You can issue many commands as root that are irreversible. Tread very carefully, or get yourself a good GUI utility that can do that.
    It's asking you to cd (change directory to the folder that your files for comparison are in.
    So, you type, cd (leave a space) then you can just drag the folder to the Terminal and it will fill in the rest of the path.
    Then press Return
    Then type this at the prompt:
    diff -rq folder1 folder2
    (replacing "folder1 folder2 with the name of your folders. Leave spaces where indicated.
    Press return.
    -mj

  • Can anyone help with Double Command issues. This a specific keyboard question and they do not seem to know.

    Before I go into a lengthy explanation of the problem: Can anyone help with Double Command issues. This a specific keyboard question and they do not seem to know.
    Thanks much.
    Emile

    Choose Force Quit from the Apple menu and close Mail from there.
    (103661)

  • Can't seem to sync my phone with iCal because I get a message that says:No writable calendar. I tried the suggestions I found in Help including a Terminal command to no avail.

    Can't seem to sync my phone with iCal because I get a message that says:No writable calendar. I tried the suggestions I found in Help including a Terminal command to no avail.

    I can only suggest you now need to somehow link your mobile to sync with the new calendar 'On my Mac'.
    I have a work Blackberry whose calendar I sync with an iCal calendar 'On my Mac' using a usb lead and the Blackberry Desktop Manager for Mac. This free piece of software from Blackberry, automatically starts up as soon as I connect the usb to the iMac and it then prompts me to select which calendar 'On the iMac', which is writable, that I want my Blackberry to sync to.

  • I accidently deleted my url box at the top of safari. I believe I did this with the command key. Can anyone help me get it back? Thank you in advance!

    I accidently deleted my url box at the top of safari. I believe I did this with the command key. Can anyone help me get it back? Thank you in advance!

    Right click (cntl-click) on the top of the bar and select "customize toolbar".  Drag the default set back in.
    Regards,
    Captfred

  • Help with a Command script

    Hello,
    Awhile back someone wrote the following script for me. The
    idea was to make a comman that would allow me to reduce an image
    down to 400 pixel width without loss of scale. I want to have a
    similiar command that will reduce a large image down to 400 pilel
    height without loss of scale. I fiddled with the command for width
    but can't get it to work for height. Can I get some help rewriting
    the following command to work for 400 pixel height? Thanks.
    // User Variables
    var width = 400;
    // Command
    var dom = fw.getDocumentDOM();
    var scale = width/dom.width;
    var height = dom.height * scale;
    dom.setDocumentImageSize({left:dom.left, top:dom.top,
    right:dom.left+width, bottom:dom.top+height},
    {pixelsPerUnit:dom.resolution, units:dom.resolutionUnits});

    Tom Hersh wrote:
    > I did try it that way. But I could not get it to work.
    The word "scale" is critical, but I switching did not help.
    Just switch the variables word for word. Height for width and
    width for
    height.
    // User Variables
    var width = 400;
    // Command
    var dom = fw.getDocumentDOM();
    var scale = width/dom.width;
    var height = dom.height * scale;
    dom.setDocumentImageSize({left:dom.left, top:dom.top,
    right:dom.left+width,
    bottom:dom.top+height}, {pixelsPerUnit:dom.resolution,
    units:dom.resolutionUnits});
    // User Variables
    var height = 400;
    // Command
    var dom = fw.getDocumentDOM();
    var scale = height/dom.height;
    var width = dom.width * scale;
    dom.setDocumentImageSize({left:dom.left, top:dom.top,
    right:dom.left+width,
    bottom:dom.top+height}, {pixelsPerUnit:dom.resolution,
    units:dom.resolutionUnits});
    Once you see this script, it's not hard to see what it is
    doing.
    This is the Fireworks generated script scaling just the
    height of an
    image to 400 px from 640x480 px.
    fw.getDocumentDOM()
    .scaleSelection(0.83281248807907104, 0.83333333333333337,
    "autoTrimImages transformAttributes");
    This works on all 640x480 images. Throw in a 700x480 and it
    won't.
    I'm assuming, very few people in here (myself included),
    would be able
    to transform this into something that would account for
    varying widths
    as senocular did.
    SKB

  • Hi i been try to minimise few app like safari,Ical etc etc from the fullscreen view but didn't manage to find any solution!! With the command   M shortcuts didn't work...any help???

    Hi i been try to minimise few app like safari,Ical etc etc from the fullscreen view but didn't manage to find any solution!! With the command   M shortcuts didn't work...any help???

    To make a screen full screen, you click on the arrows in the upper right corner.  To minimize, move your cursor all the way to the upper right corner of your desktop--give it a second--a symbol will appear that lets you "reverse" the action and minimize the window.  Hope I'm explaining this correctly. 

  • Error while trying to remove an object with dsrm command

    hello,
    i get an error while trying to delete an object computer with the command line tool, DSRM. i get this view:
    actually, it's a one of hundreds of commands, that help cleaning the active directory of the obsolete objects. it is saying : "Access Denied" (in french, accès refusé). i say that the account used to execute this command, is a member of domain
    admins group, and enterprise admins group too. so i cannot believe it's a mater of some missing rights... :/
    thanks in advance, for your help,
    regards
    Lotfi BOUCHERIT

    Hi,
    I was able to reproduce your issue when using a non-elevated command prompt in a 2008R2 box. So please try to elevate your command prompt and your command will most likely go through.
    In addition to above, I'd suggest you look in to PowerShell instead, which in most cases is more effective.(and doesn't need to run in an elevated prompt to make AD-Changes)
    The same as above could be done with the powershell cmdlet Remove-AdComputer.
    Remove-AdComputer -Identity "Distinguishedname"
    Hope this helps you!
    Microsoft Certified Trainer
    MCSE: Desktop, Server, Private Cloud, Messaging
    Blog: http://365lab.net

  • Help needed with permissions problem in new Aperture 3.5.1

    Hello and thank you for helping me with my first question to this wonderful support center. I have been using Aperture for many years. I recently upgraded my Mac to Mavericks, now running 10.9.2. and then upgraded (by necessity) to Aperture 3.5.1. I am working on a big project for a client and have an assistant in another city. I live outside the US so mailed  my library to my asst. on an external drive. She updated to 10.9.2 or .3 and Aperture 3.5.1. No problems. She modified the library and sent the library to the client in another city in the US on an external drive who has also upgraded to  Mavericks and is running Aperture 3.5.1.  So we are all in Mavericks with recent Apertures. When client tried to open the sent library client got a message that stated:
    "Aperture cannot access this library. To use this library, make sure its file permissions are set correctly.”
    Clientʻs Tech assistant at her office is a PC specialist but apparently did try on Friday and did try to repair permissions but I am told that it did not work. I wish I had more specific info on what Tech assistant did but I do not at this time.
    On Monday I would like to give them very specific instructions about what to do to open the library
    For recent discussions I have found only this
    https://discussions.apple.com/message/23600132#23600132
    Oct 30, 2013 3:35 PM by Frank Caggiano
    about repairing permissions.
    I am sure that we are all running Mavericks and new Aperture, that does not seem to be at the root of  the immediate problem. As we are in two different countries and three different cities and communication is hard, please tell me if this is a common problem with an easy fix and if it should be fixed by Repairing Permissions, please tell me exactly what I should tell them to do on Monday. They can at least see this discussion from their city!
    Many thanks!! This is an urgent project so I very much appreciate your help.

    Have your collegues check the file system of the drive and the "Ignore Ownership on this volume" flag.
    To check the filesystem and "Ignore ownership" flag select the drive in the Finder and use the command "File > Get Info ⌘i"
    In the panel unlock the padlock in the "Sharing & Permissions" brick and set the "Ignore ownership" flag at the bottom of the panel.
    Also, check the "General" brick of the panel. The format should be showing as "Mac OS Extended (Journaled)". Aperture checks for the correct formating before opening a library and may refuse to open a library on a drive formatted for Windows.
    If the format is wrong, it would be best to move the library to a different drive with the correct formatting.
    Once the "Ignore ownership" flag is set, try again to repair the permissions and see, ifyou now can open the library.

  • Report with two Command is empty if one of the two commands returns no data

    Hi all,
    I have a report with two Commands not linked together.
    If ONLY one of the two Commands returns no data, the full report is empty (although the other Command returns data).
    I'm using Crystal Report 2008 and the CRJ 12.2.205
    Have an idea?

    Hi Ted,
    how can I solve the problem, please? It is important.
    If I can help yourself, the problem is appeared in many reports since I updated the library (the old library version 11.8.4.1094 works fine with all). I'm waiting for your answer, please.
    Thank you very much.

  • I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?

    I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?    

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • SqlPlus or PL/SQL -- how to copy one procedure with one command?

    Hello,
    In this scenario, I have 11g on server1 and server2.
    Using SqlPlus or a PL/SQL procedure, I want to issue a command to copy a procedure now on server1 over to a new identical server and tablespace called server2.
    Would someone please help me with the syntax of this copy command?
    On server2 I tried something like this:
    create procedure tablespace1.procname from tablespace1.procname@dblink_server1
    Note that I want to avoid using imp or datapump, etc. I want this to be a simple copy of one procedure by name from another server.
    Any suggestions are greatly appreciated. Thank you.

    Thank you.
    Below, line 1 method returns a 'create table...' statement:
    1> select dbms_metadata.get_ddl ('TABLE','table_name','schema_name') FROM dual
    This works well, especially for tables, but I still cannot figure out how to do it across a database link.
    The next method, line 2, works well for procedures, but not for tables:
    2> select name, type, line, text from user_source where type='PROCEDURE' ORDER BY NAME,LINE
    One way or another, I am trying to get the source from selected remote servers and then use it to create the same objects on other remote servers.
    Any suggestions are greatly appreciated.
    Live long and prosper.

Maybe you are looking for

  • Moving video playback to a specific point in a video... impossible?

    So watching a full length movie on my 2nd gen touch. Say I want to skip to the 1:27:30 mark, but trying to move the video position slider to that spot is a lesson in insanity. For a big movie like this, you end up with 10 min chunks before or after w

  • My photo stream has gone. How can i get it back?

    my photo stream has gone and i cannot find a way to get it back, as a result i cannot view my icloud photos

  • Forms 11g Server compilation issues: FRM-18108: Failed to load the following objects

    Attempting to upgrade to 11g (Forms 11 Version 11.1.2.1.0 on Linux) from 9i. Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production Compiling an FMB on the server (not windows PC) is giving error FRM-18108: Failed to load the fo

  • JDBC Mysql Resultset too large!

    Hello everybody, I'm currently building a large database retrieval system(JAVA and mysql). Everything works fine, but I have a big problem. The returning resultset is way higher then it should be!! The table has the following structure: Probe_set_id

  • Configuration (IMG) Objects in Logon Language

    Dear SAP Experts, I am currently working on an implementation where, in addition to English (EN) as logon language, we will also be having French (FR) and Portuguese (PT) languages. Would like to seek your advice on how we can extract or get a list o