Truncating a table from inside an application

Hi all,
Got a new problem to tackle. I am creating an application to calculate a very complex production bonus based on alot of different variables...
I am working through retrieving all the data and created an apex temp table called site_bonus. I dump all the retireved values I get from Oracle for attendance, SIT data on discipline etc into the temp table as a count of number of occureneces to start the calculation of the bonus factors - here's the gotcha.....
Prior to dumping the new run data into the temp table I want to truncate the table to remove anyprevious run data so that I dont get duplicate records cuased by a previous run. I created an on demand application process that basically does the following:
truncate table "SITE_BONUS" /
( I basically copied it right from SQL workshop inside apex,by retrieving the SQL fromthe table truncate process where it works....
When I run it anywhere inside my page as an on demand process It fails with the following error:
ORA-06550: line 1, column 16: PLS-00103: Encountered the symbol "TABLE" when expecting one of the following: := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue.
Error
OK
I have tried it as a plsql process, an on demand process....and I get teh same error from any page inside my app and I cant figure out why I can do this from SQL worksop but cant call it from a page within my app.....
Any ideas?
Edited by: DSULLIVAN on Oct 28, 2009 3:13 PM - I corrected the typo

You are trying : trucate
trucate table "SITE_BONUS" /It should be : tuncate
truncate table SITE_BONUSHope this helps,
Sam
+Please reward good answers by marking them correct or helpful!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How can I call Adobe Reader from inside my Application and prevent operator to access Open/save opt

    Can Anyone help to find a way?
    http://answers.acrobatusers.com/How-call-Adobe-Reader-inside-application-avoid-operator-op en-save-doc-q13487.aspx
    From inside my application that run on an Automation PC, under Windows O.S, I want to call Adobe Reader using a shell command to open up an PDF Document containing some informations.
    Shell command like these
    "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" /A "<options>" "C:\mydoc.pdf"
    or
    cmd  /c "C:\mydoc.pdf"
    Operator is using a touchscreen.
    I want to prevent user to access any option that can give him acces to filesystem (Open/save/save as).
    I want also to prevent any change/add information to PDF document
    Thank you in advance for the time you will spend for me.

    You can use the Installation Tuner for Reader to customize the UI elements provided to the user.  Details on the Adobe web site.

  • Insert the data in sap tables from C SHARP application

    Hi All,
                 I want to save some data in sap table from my CSharp(DOTNET)  windows application.I tried with the help of  SAP.Net Connector but that connector is not been supported visual studio 2005 or i not have visual studio 2003 .Soo plz any one can help how i can do this .
    If any one have a idea then plz give me some example also how we did.
    thanks
    regards
    sandeep Dabral

    You have to use SAP .NET connetor to make interface with SAP. This is better way of doing interface between .NET and SAP.
    You create web service (wsdl) in .NET 2003 and try to use that in .NET 2005.
    You're getting the two technologies confused ......
    .Net Connector is used for RFC-type interfaces. It calls Bapi's directly. Web services are not involved for this type of interface.
    WSDL files are used to generate proxies for the .Net client to call Web Services (typically web-enabled Bapi's). This type of interface uses SOAP protocol not RFC and does not use the .Net Connector. Enterprise Web Services may be discovered using the .Net Enterprise Service Explorer, which is a different component from the .Net Connector.
    Regards,
    D.

  • JNDI Lookup of ConnectionFactory fails from inside Glassfish application

    This may very well end up being a glassfish specific question.
    I've got a stand-alone WAR using JSF, where I have a backing bean use some helper objects that will send a JMS message. When this WAR is running from inside of Glassfish, it fails to do the lookup of the ConnectionFactory.
    The application pulls the Queue JNDI and the Provider URL from a database, and uses a env Hashtable to do the JNDI InitialContext (which succeeds.) Using this Context, the ConnectionFactory lookup fails.
    The remote server in this instance is WebLogic 9.2 (the JNDI is publically available with no user authentication, verified with a JMS developer tool we use internally.)
    Here's the stacktrace...
    2007-10-15 19:48:04,514 ERROR [net.acadiasoft.shared.jms.util.JMSSenderHelper:130] NamingException: messageFactory not found
    javax.naming.NameNotFoundException: messageFactory not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
    at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
    at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.getConnectionFactory(JMSSenderHelper.java:128)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.init(JMSSenderHelper.java:58)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.<init>(JMSSenderHelper.java:36)
    at net.acadiasoft.web.shared.jms.util.AdminJmsHelper.<init>(AdminJmsHelper.java:19)
    at net.acadiasoft.web.server.pages.SchedulerBackingBean.deleteJobs(SchedulerBackingBean.java:75)

    I've found the problem, and it's something I simply overlooked. I don't know why I didnt realize, but i was setting the java.naming.factory.initial env variable to what Glassfish uses, not WebLogic.

  • How to access SQL tables from WebDynPro ABAP application ?

    Hi,
    I am trying a scenario, where I need to send an user ID to SQL server table (update/modify/delete) from webDynpro ABAP application.
    Basically ,I am trying to know:---
    a>How to write a SQL Connection from ABAP code within webdynpro ABAP application
    b>What are the ways to do it.(by code or any other API/mechanism)
    I appreciate if anybody knows this.
    Thanks
    Praveen

    Hi,
    The EXEC CONNECT ... is usually used in the procedural ABAP code. For this you can refer to the ABAPDOCU.
    I dont have any sample code on the classes I listed try to check out them for the parameters and the methods they have.
    In WD for Java, we have these connection classes to connect to any databsae server.
    Or try to create an RFC with DESTINATION for this
    Pls check out this link for this -
    Pull data from another r3 server using abap dynpro
    Regards
    Lekha

  • How to truncate  schema1 table from schema 2 -URGENT

    Hi all
    Please tell me is there any grant like that
    regards

    IS this
    grant drop any table to schema 2
    only way PapinRTFM: http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_107a.htm
    Prerequisites
    To truncate a table or cluster, the table or cluster must be in your schema or you must have DROP ANY TABLE system privilege. :)

  • Accessing SAP Tables from a Java application

    Hi,
    I know, the forum is called "Web Application Server" but because it's Java question I hope to get answers here.
    I have a small stand-alone Java application that needs to access (read-only) all records from a SAP table. Is there a possibility to do this without writing a BAPI before?
    thanks a lot
    Paul

    Hi Paul,
    You can use JCo to call the standard remote-enabled function RFC_READ_TABLE. There is one annoyance involved with this function, though: each row of data returned is packed into a single string, so you must either specify a delimiter and use e.g. String.split(...) to parse out the column values or use the returned metadata to extract each value based on position and length attributes of the column.
    Another option (although this is usually not allowed in a productive environment) is to establish a direct JDBC connection to the database, thus bypassing the ABAP application layer entirely.
    Regards,
    Thorsten

  • Inserting a record into ORACLE table from a webdynpro application

    Hi,
    From My webdypro code I have 10 attributes which are need to  be inserted into a ORACLE DB table. Can anyone suggest me how to achieve it or Can you please point me a tutorrial which can help on it.
    All the attributes will be inserted in a single record.
    Thanks,
    James

    check this code
    Created on Oct 18, 2007
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package com.psft;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    @author BALU
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataBaseDAO
         ResultSet rs;
         int qID = 1;
         int noOfChoices=0;
         Connection con;
         Statement stmt;
         public DataBaseDAO()
              try{
                   /*Class.forName("oracle.jdbc.driver.OracleDriver");
               con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","bduvvuri","dbsub516");
               stmt = con.createStatement();*/
               DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
               Class.forName("oracle.jdbc.driver.OracleDriver");
               String s ="jdbc:oracle:thin:@192.168.9.34:1527:ep7";
               con=DriverManager.getConnection(s,"user1","welcome1");
               stmt = con.createStatement();
              }catch(Exception e){}
         public int register(String name,String pass,String emailid){
              int i =0;
              try{
                   PreparedStatement ps = con.prepareStatement ("Insert into USERS(username,password,email) values (?,?,?)");
                   ps.setString( 1, name);
                   ps.setString( 2, pass);
                   ps.setString( 3, emailid);
                   i = ps.executeUpdate();
                   }catch(Exception e){
                   System.out.println("ee"+e.getMessage());
              return i;
    xxxxxx (please read forum rules)
    Edited by: Armin Reichert on Jan 17, 2008 10:17 AM

  • HT204053 Problem in purchasing from Inside the application

    Hi
    I want to buy gold in Game of War but when I press on buy I get the below message:
    Your Purchase  Could Not Be Completed
    For assistance, contact iTunees Support at www.apple.com/support/itunes/ww/.
    What can I do to solve this problem?
    Many Thanks

    Another message appear:
    "Can't connect to iTunes Store"
    I have internet but I don't know why this happen?

  • How to access the database tables from application

    Hii all,
    The information in webcenter content, such as meta data fields, users, security groups etc are stored in
    database tables like-      Revisions, SecurityGroups, Users, DocType etc..
    Can we access this tables from an adf application or any webcenter application..
    If yes, then what can be the approach for that..??
    Another things, how can we create custom tables just like the predefined tables...??
    Any information regarding this.??
    Thanks

    Can we access this tables from an adf application or any webcenter application.Yes, you can - like to any other existing database. But I would strongly discourage you from any, but read-only access, or you can easily end up with inconsistent data.
    If yes, then what can be the approach for that..??Just create a database connection and define in your model what tables you want to access.
    Another things, how can we create custom tables just like the predefined tables...
    Actually, WebCenter Content provides functionality of creation of custom tables (see http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#autoId2 ) and these are probably the only good candidates for read-write access. See further in the manual what use cases are supported. Of course, you could do this even externally, but rather than Data Definition Language, I'd use services (if there are some).

  • Problem in enabling constraint - after disabling and truncation of table .

    Hello Friends,
    I have a table called DRR_TABLES that has list of table names . The requirement is to truncate the tables present in DRR_TABLES except KEY_IDS table and table_name like '%TYPE%' table.
    written a procedure . successfullly truncating the tables from DRR_TABLES but while enabling constraints after truncation , I am getting problem in enabling constraints .
    ERROR at line 1:
    ORA-02270: no matching unique or primary key for this column-list
    ORA-06512: at "schema123.TRUNCATE_DRR_TABLES ", line 49
    ORA-06512: at line 1
    Heres is the code .
    PROCEDURE TRUNCATE_DRR_TABLES is
    x varchar2(200);
    v_tablecount number := 0;
    cursor c is select TABLE_NAME from DRR_TABLES where population_source='PUBLISHING' and TABLE_NAME != 'KEY_IDS' and TABLE_NAME NOT LIKE '%TYPE%';
    BEGIN
    DBMS_OUTPUT.PUT_LINE (' TRUNCATING DRR TABLES ...........');
    OPEN c ;
    LOOP
    FETCH c INTO x ;
    EXIT WHEN c%NOTFOUND;
    for c1 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status ='ENABLED' ORDER BY CONSTRAINT_TYPE DESC )
    loop
    begin
    execute immediate ('alter table '||c1.table_name||' disable constraint '||c1.constraint_name|| ' cascade');
    NULL;
    end;
    end loop;
    EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || x ;
    v_tablecount := v_tablecount + 1 ;
    DBMS_OUTPUT.PUT_LINE('TABLE TRUNCATED :'|| x );
    END LOOP ;
    DBMS_OUTPUT.PUT_LINE (' TOTAL TABLES TRUNCATED ' || v_tablecount );
    CLOSE c;
    OPEN c ;
    LOOP
    FETCH c INTO x ;
    EXIT WHEN c%NOTFOUND;
    for c2 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status = 'DISABLED' ORDER BY CONSTRAINT_TYPE)
    loop
    begin
    execute immediate ('alter table '||c2.table_name||' enable constraint '||c2.constraint_name);
    NULL;
    end;
    end loop;
    END LOOP ;
    CLOSE c ;
    END TRUNCATE_DRR_TABLES ;
    LINE 49 is the line corresponding to enable constraint statement.
    Edited by: kumar73 on 3 Sep, 2012 11:44 PM

    It is such a pity that a user having 321 posts till date is unaware of basics of Posting a Question.
    1. You need to provide us with your Oracle version
    select * from v$version;2. You need to understand and get accustomed to using tags before and after Code or SQL's for better readability.
    3. You need to provide us with the Table Structure and the Constraints Definition.
    There are many things that looks like Bad Coding practices:
    <font face="Times New Roman" size=2>
    1. Avoid RBAR (Loops).
    2. Implement Bulk Collect.
    3. Why do you need to disable the constraints before truncating? Are you kind of handling the Referential Integrity Constraints?
    4. Duplicate checking of Disabled Constraints.
    5. When the procedure is being executed at Production Environment, are you going to Monitor the DBMS_OUTPUT? Why not Log the Statements into a LOG Table?
    6. Why use a TableCount variable? Would the TableCount Variable be not equal to the Number of Records returned by Cursor C?
    7. What is the need to use a NULL statement after every Execute Immediate?
    8. What is the Need to surround each execute Immediate with Begin .. End block?
    9. Where is your Exception handling Block? Forgot to write?
    </font>
    What has been your effort in finding which Constraint/Table is causing you the trouble?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can we access PI tables from WebDynpro Java via PI 7.1?

    Hi Experts
    Is it possible to fetch PI Tables (to display monitoring and alerts as dashboard on portal) from Java Stack. I got some javadocs API SAP Netweaver for PI 7.1 but i don't know how far it can help me in solving my purpose of fetching and displaying the PI monitoring data on Portal.
    https://www.sdn.sap.com/irj/sdn/javadocs
    Please advise if J2EE access to PI Tables is possible or RFC is the suggested solution to fetch PI Monitoring data.
    Thanks
    Neha

    Hi Neha,
    You can access PI tables from Webdynpro Java application using RFC or Webservices. Create RFC or Webservices which will fetch data from the PI tables.Create the required JCO's and the Webdynpro java application which uses the Adaptive RFC model or Adaptive Webservice Model to connect to the ECC system.
    I found a document that speaks about fetching data from SXMB_MONI Standard Table https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050ff4f-84c3-2b10-3d99-8f9c44f57a17
    Hope this is useful.
    Regards,
    Seema Rane.

  • Large tables truncated or withheld from webhelp

    I'm running into a major issue trying to include a large table in my WebHelp build.  I'm using RoboHelp 8 in Word.  When I include a large table (6 columns x 180 rows) the table is either truncated or withheld from the compiled WebHelp.
    I've tried several things to resolve it, but they all end in the same results.  I've tried importing the table from its original Word file.  I've tried breaking it up into many smaller tables.  I've tried building a new table in Word, then copying the data.  Oddly enough if I build the table blank and compile--the table appears.  But once I copy data into the table, it disappears.
    RoboHelp seems unable to process the table, as when I've broken the single table into several smaller tables, it chokes, doesn't include the table or even put the topic in the TOC, even though it is in the source file.
    Any ideas?  I've not been able to find anything in the forums or anywhere else online. 
    Many thanks!

    Can you tell us what you mean "using RoboHelp in Word"? Do you mean you are using it as your editor or that you are using the RoboHelp for Word application? If the later, is there a reason why you can't use the RoboHelp HTML application? This is much more suited to producing WebHelp. Personally I wouldn't touch the HTML that Word creates with a bargepole.

  • How to truncate the values from the table

    Hi All,
    I am working on an issue..where we are first deleting all the records from the table and then based on few conditions we are putting the records back in that table...when we tried to run this program along with few others those who are doing almost the same stuff we are having issues...we tried to schedule few jobs related to these programs only...but after a ceratin amount of time couple of jobs got canceled...I was talking to my basis guy and he said the problem is ratehr then truncating the records from the table we are deleting the records and it's taking lots and lots of space to execute...so we need to truncate the records from the table insted of deleting it...we are using the following the statement right now:
        DELETE FROM ZTUS_PG.
        COMMIT WORK.
    So can you please tell me how can we truncate the values from this table instead of just deleting them and what would be effect of this.
    Thanks,
    Rajeev Gupta

    I don't think basis is saying you should delete all the records from the table. They are saying remove the table and it's contents (a much faster thing to do). I'm not sure this the right thing to do, but you can have a look at:
    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.sample.doc/doc/admin_scripts/s-truncate-db2.htm
    Something like:
    EXEC SQL.
      TRUNCATE TABLE ZTUS_PG REUSE STORAGE
    ENDEXEC.
    COMMIT WORK.                      "Empty table is committed here
    Rob
    Edited by: Rob Burbank on Dec 1, 2008 4:06 PM

  • How to add MS Office add-in from inside a Thinapp 5 virtual application to a MS Office 2013 suite that is installed on a base image

    Hi,
    We have the following solution:
    VMware Horizon View 5.3.1
    Non-persistent Linked-clone pool with delete VM after logoff
    Windows 8.1 Update 1 Enterprise 64 bit
    MS Office 2013 32-bit installed on image
    Thinapps registered for each user from logonscript with thinreg.exe command. Thinapps is located on a network share
    Native Windows roaming profiles with appdata/roaming, appdata/local without appdata/locallow(persona management does not support Windows 8.1 in View 5.3.1)
    This is our issue:
    We have a 3rd party application with a couple Thinapp entrypoints(exe files) and in the Thinapp package process we also installed Office addins. We tested that the Add-ins was opened inside Outlook, Word and Powerpoint before post installation scan.
    The problem is that the add-ins is not added to Office 2013 before or after the Thinapp is started on a test client.
    I have tried several changes in the package.ini and virtual filesystem attributes(no registry changes yet):
    Package.ini:
    ChildProcessEnvironmentExceptions=WINWORD.EXE;EXCEL.EXE;POWERPNT.EXE;OUTLOOK.EXE;
    ChildProcessEnvironmentDefault=External
    ChildProcessEnvironmentExceptions=excel.exe;outlook.exe;powerpnt.exe;winword.exe
    ChildProcessEnvironmentDefault=Virtual
    VirtualizeExternalOutOfProcessCOM=0
    DirectoryIsolationMode=Merged
    RegistryIsolationMode=Merged
    I have also read that you could make entrypoints to the locally installed Office 2013, but I get errors on the build process. ref. link: http://edwinfriesen.nl/content/?p=105#comments
    The best thing would be if the add-ins were added in the logon process together with thinreg.exe, but if that is not supported, the add-ins must be added to Office either in a custom Office shortcut/entry point or after starting the Thinapp virtual application.
    Remember that the application needs to registered every times the user logon, because we use a non-persistent View pool.
    I would really appreciate if somebody could tell me how to add Office add-ins from inside a Thinapp virtual application/package to a locally installed MS Office 2013 suite on a Windows "base" image?
    We do not want to add the whole Office suite to the Thinapp virtual package and not add the add-ins trough GPO,SCCM etc.

    What about the COM object parameters in package.ini ?
    We can live with scripting in logon or changed logon scripts etc.
    And you don't no need to lock in the project files.
    From package.ini documentation:
    ObjectTypes Parameter
    The ObjectTypes parameter specifies a list of virtual COM object types that are visible to other applications in
    the physical environment. You can use scripts, such as VBScripts, to call objects that start captured applications.
    An object type is registered to only one native or virtual application at a time. If you install Office 2003 on the
    native machine and want to use a virtual Office 2007 package, you must determine whether to have the virtual
    or native application handle the object types.
    If you want the virtual Office 2007 to handle the object types, you can leave the ObjectTypes setting in the
    Package.ini file, build the package, and register it using the thinreg.exe utility. If you want the native Office
    2003 to handle the object types, you must remove the ObjectTypes setting from the Package.ini file before
    building and registering the package.
    You cannot add random entries to the ObjectTypes parameter.
    You can only remove entries that were generated by the capture process.
    Example: Starting a Virtual Application When a COM Object is Created
    If a script or a native application creates an Excel.Application COM object or other COM objects listed in the
    ObjectTypes parameter, ThinApp starts the virtual package.
    [Microsoft Office Excel 2007.exe]
    ObjectTypes=Excel.Application;Excel.Application.12;Excel.Chart;
    Excel.Macrosheet;Excel.Sheet; Excel.Workspace

Maybe you are looking for

  • Creation of company code

    I have created a company code by copying (coppy as ) the standard company code 0001. While copying it was shown that some of the entries was copied successfully but some of was not . I have mainted P.org, site , storage location . But while craeting

  • Question about document being inaccessible after saving this may be long!

    for some reason when i save a document i am not always able to re-access it. i have a number of documents "saved" to the desktop (i don't know how they got there), i can't delete them ( i don't have "sufficient privileges") and when I go to open them

  • ERROR: WinHttpReceiveResponse failed 80072ee7

    This the message from the configmgrSetup.log: INFO: checking if there's an explicit proxy server.  $$<Configuration Manager Setup><04-10-2014 23:28:12.865+240><thread=4176 (0x1050)> ERROR: WinHttpReceiveResponse failed 80072ee7  $$<Configuration Mana

  • Captivate 6 not resuming in SumTotal

    Good morning, I have packaged several courses in Captivate 6.  When I load them in to SumTotal they are not resuming to the screen on which I exited the course.  I have tested the courses in ADL SCORM tester and the lesson location is changing, but w

  • Problems with making javac a shell command

    I am running win98. I use the command line to compile my java applications except the javac command doesn't work outside of the bin directory. How can I setup my java tools to run at my command? so far I have tried PATH :\WINDOWS;C:\WINDOWS\COMMAND;C