Error due to # in insert statement

Guys there is a .sql file which we run in oracle DB using a batch process
declare
act_errors number(10, 0);
  at_least_one_exception  EXCEPTION;
  err_num NUMBER;
  err_msg VARCHAR2(1000);
begin
act_errors  := 0;
dbms_output.put_line('Starting to process Case '|| 'C-9');
begin
insert into C_A(A_ID,
C_ID,
I_INFO)
VALUES
('C-9' ,
'C-9' ,
to_clob('
#5 Jessica Gardea-Cash Box open
#6 Quan T Nguyen-Teller in question')) ;
exception
  when others then
     act_errors := 154181;
      err_num := SQLCODE;
      err_msg := SUBSTR(SQLERRM, 1, 1000);
     dbms_output.put_line('Statement number ' || act_errors || ' failed (search for "act_errors := ' || act_errors || '" in the source file)');
     dbms_output.put_line(err_msg );
end;
IF act_errors <> 0 THEN
         RAISE at_least_one_exception;
END IF;
dbms_output.put_line('Case '|| 'C-9' || ' processed successfully');
commit;
exception
     when others then
       dbms_output.put_line('Error detected, rollbacking');
       rollback;
end;
/this above insert when run through toad , it runs fine... but when run as a btach process using sql plus
it errors out with the following error message..
Jessica Gardea-Cash Box open
ERROR at line 5:
ORA-06550: line 5, column 15:
PLS-00103: Encountered the symbol "-" when expecting one of the following:
:= . ( @ % ; not null range default character if i remove the '#' alone or if i push the '#' with spaces before it... it runs fine... if the '#' is right after a 'enter' or it is at the begining of the line it fails with error....\
Please help me solve it?? there are many such cases for it.. we cannot prevent '#' from coming at the start
Edited by: Depakjan on Mar 24, 2011 12:12 PM
Edited by: Depakjan on Mar 24, 2011 1:47 PM

Try this in sqlplus.
SET SQLPREFIX OFFAnd now execute your script.
G.

Similar Messages

  • Error while executing DB Insert statement in BPEL process

    Hi Folks,
    I am facing the below issue while trying to invoke a DB adapter for DB Insert from a BPEL process :
    +file:/oracle/orasoa/bpel/domains/default/tmp/.bpel_ProvisionOrderASAPReqABCSImpl_1.0_50dd1595129e9bbb00560e31e7c18cef.tmp/DB_INS_ASAPResponse.wsdl [ DB_INS_ASAPResponse_ptt::insert(AsapResponseCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.+
    +insert failed. Descriptor name: [DBINSASAPResponse.AsapResponse].+
    +; nested exception is:+
    ORABPEL-11616
    DBWriteInteractionSpec Execute Failed Exception.
    +insert failed. Descriptor name: [DBINSASAPResponse.AsapResponse].+
    +Caused by Exception [TOPLINK-6016] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.QueryException+
    Exception Description: Objects or the database cannot be changed through a ServerSession.  All changes must be done through a ClientSession's UnitOfWork.
    Query: InsertObjectQuery(<AsapResponse 1-1272531 1-R9WJ />).
    The same code runs fine when i invoke it again, without making any changes to the code.
    Any pointers in this regard will be highly appreciated.

    Doe this thread helps you:
    Strange Toplink errors appearing
    Are there any triggers behind the table? Wich version of the database you are using? Did you configure the JCA Adapter and remove the 'mcf.' settings in your BPEL wsdl process?
    Marc
    http://orasora.blogspot.com

  • Cannot get new token due to device offline state. Id error 40760

    Hi,
    I have a Blackberry Curve 9380 
    i can't go in my app world, the message says: Cannot get new token due to device offline state id error 40760
    what should i do?
    btw, i'm french
    thanks!

    Hi and Welcome to the Community!
    With a strong carrier network signal (e.g., not merely WiFi), I suggest the following steps, in order, even if they seem redundant to what you have already tried (steps 1 and 2 each should result in a message coming to your BB...please wait for that before proceeding to the next step):
    1) Register HRT
    KB00510 How to register a BlackBerry smartphone with the wireless network
    Please wait for one "registration" message to arrive to your Messages app
    2) Resend Service Books
    KB02830 Send the service books for the BlackBerry Internet Service
    Please wait for "Activation" Messages, one per already configured email account, to arrive in your Messages. If you have no already configured email accounts, please wait 1 hour.
    3) Reboot
    With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes.
    See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    If not, then please try this sequence:
    1) Remove AppWorld from your BB
    KB10040 How to view or remove installed applications on a BlackBerry smartphone
    If it requests that you reboot the BB, do so
    2) Do a Batt-Pull reboot (power on, remove battery, wait, insert battery, wait), even if redundant to the one you did in step 1.
    3) Install (on your BB) a fresh copy of AppWorld
    http://blackberry.com/appworld/download
    Again, if it requests to reboot, do so.
    4) Do another Batt-Pull reboot
    5) See if it now works.
    Otherwise, you should contact your mobile service provider for formal support.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Error in insert statement

    hi,
    i have used script for insert statement.while compiling it ,it shows error in declare section that to in t24_customer_code.can any body pls check out and tell me.
    the script is ....
    DECLARE
    a NUMBER := 10;
    t24_customer_code NUMBER;
    my_tab SYS.dbms_debug_vc2coll := SYS.dbms_debug_vc2coll ();
    BEGIN
    LOOP
    EXIT WHEN a > 20;
    a := a + 1;
    t24_customer_code:= 9700 + a;
    INSERT INTO t24_customer
    (t24_customer_code,
                   T24_MNEMONIC,
                   T24_SHORT_NAME,
                   T24_NAME_1,
                   T24_NAME_2,
                   T24_STREET,
                   T24_SECTOR,
                   T24_ACCOUNT_OFFICER,
                   T24_OTHER_OFFICER,
                   T24_INDUSTRY,
                   T24_TARGET,
                   T24_NATIONALITY,
                   T24_CUSTOMER_STATUS,
                   T24_LANGUAGE)
    VALUES
                   (t24_customer_code,
         'MNEMON' || a,
         'HANSARUN',
         'KUMAR',
         'MAQSOOD',
         'NIYAZ DINESH',
         1001,
                   1,
         5,
                   1000,
                   1,
                   'US',
                   2,
                   'US');
    my_tab.EXTEND;
    my_tab (a - 1) := t24_customer_code;
    END LOOP;
    OPEN :cur FOR
    SELECT *
    FROM t24_customer
    WHERE t24_customer_code IN (SELECT COLUMN_VALUE
    FROM TABLE (CAST (my_tab AS SYS.dbms_debug_vc2coll)));
    END;
    thanks
    ratheesh

    Please describe column name and data type on your table.
    T24_MNEMONIC is not NUMBER, is it?
    By the way,
    VALUES
    (t24_customer_code,Here t24_customer_code is not your variable
    but that is column name of t24_customer.
    You might get another error after solving 'ORA-01722: invalid number'
    SQL> edit
    Wrote file afiedt.buf
      1* insert into scott.dept (deptno) values (deptno)
    SQL> /
    insert into scott.dept (deptno) values (deptno)
    ERROR at line 1:
    ORA-00984: column not allowed here

  • Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object

    hi,
      when i was trying to deploy a SP  solution from my vs 2012 solution. this error  is displayed.
    i tried many things like
    1) get the wsp and apply power shell cmds to add and deploy, here also it failed:
    Add-SPSolution -LiteralPath d:\mywsp.wsp
    Install-SPSolution mywsp.wsp -GacDeployment -AllWebApplications -Local
    2) restart the timer services and  do  iisreset and  reboot the server. etc .as mentioned in one of the  the below  blogs:
    http://sharepoint1on1.blogspot.in/2014/04/sharepoint-error-occurred-in-deployment.html
    http://suehernandez.wordpress.com/2011/03/31/error-occurred-in-deployment-step-activate-features-operation-is-not-valid-due-to-the-current-state-of-the-object/
    http://www.dotnetsharepoint.com/2014/04/error-occurred-in-deployment-step-add.html
    http://social.msdn.microsoft.com/Forums/en-US/63adde23-03cf-4b65-923e-1219da94a780/error-occurred-in-deployment-step-add-solution-operation-is-not-valid-due-to-the-current-state-of?forum=sharepointdevelopmentprevious
    http://www.shakirmajeed.com/error-occurred-in-deployment-step-activate-features-operation-is-not-valid-due-to-the-current-state-of-the-object/
    but even after doing all these steps, the  error still persists!. and am not deploying into a remote server, the dev env is in a VM, where sp 2013, vs 2012, sql 2012  are installed.
    just wanna share one  note:   there is a isue in my search admin component. index was reset due to some reason. and from that time onwards my search full/incremental crawls were not working!
    will this cause an issue in my wsp deployment ? i hope  it wont, still  asking...
    can anyone help me how to resolve this error.because this is a  show stopper for me for the last few days!
    help is highly appreciated!

    This issue cause because of feature activation failure while WSP deployment.
    when you create a WSP using visual studio, it creates WSP package with default deployment configuration settings.
    Please restrict feature activation configuration, this will help you to troubleshoot this issue.
    - Click on Project in WSP and press F4, it will open "Project Properties"
    - set "Active deployment Configuration" - as "No Activation"
    - you can activate this features in required sequence after deployment using Activate-SPFeature
    If my contribution helps you, please click Mark As Answer on that post and Vote as Helpful
    Thanks, ShankarSingh(MCP)

  • Where is the syntax error in my Insert statement?

    It says that there is a syntax error in my insert statement, pointing to the .ExecuteNonQuery() at the end:
    'Defining the activity ID from the datatable
    Dim ActivityID As Integer = DataTableActivities.Rows(0).Item(0)
    'Defining the calories from the datatable
    Dim calories As Decimal = (DataTableActivities.Rows(0).Item(3)) * (DurationNum.Value / 60)
    'Insert statement to add new training events
    Dim SqlQueryActivityInsert As String = "INSERT INTO tblTraining (RunnerID, ActivityID, Full_Name, Time, Calories_Burnt, Date) VALUES (@RunnerID, @ActivityID, @Full_Name, @Time, @Calories, @Date)"
    Dim SqlCommandActivity As New OleDbCommand
    With SqlCommandActivity
    .CommandText = SqlQueryActivityInsert
    .Parameters.AddWithValue("@RunnerID", LoginForm.UserIDlbl.Text)
    .Parameters.AddWithValue("@ActivityID", ActivityID)
    .Parameters.AddWithValue("@Full_Name", LoginForm.Full_Namelbl.Text)
    .Parameters.AddWithValue("@Time", DurationNum.Value)
    .Parameters.AddWithValue("@Calories", calories)
    .Parameters.AddWithValue("@Date", WeekPicker.Value)
    .Connection = conn
    .ExecuteNonQuery()

    Viorel is right.  The 'Date' field is probably throwing it off.  Date is a reserved word. 
    https://www.drupal.org/node/141051
    Putting square brackets [] around the field name should get it working for you.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • SQL*Loader-930: Error parsing insert statement for column

    we upload data on daily basis in application throug apps user and these table are invloved
    1. DEV_RA_INTERFACE_LINES_ALL(owner is a apps)
    2.RA_INTERFACE_LINES_ALL(owner is a AR)
    we do steps
    1 delete record from DEV_RA_INTERFACE_LINES_ALL table
    2 delete record from      RA_INTERFACE_LINES_ALL table
    3 load data using sql loader with apps user
    4 insert in RA_INTERFACE_LINES_ALL table
    we want to change user i mean these step do dataupload user not apps
    we give the proper rights to dataupload like select,delete and insert rights on these table to dataupload user but when i going to load data throug sql loader we receive error
    SQL*Loader-930: Error parsing insert statement for column APPS.DEV_RA_INTERFACE_
    LINES_ALL.ORIG_SYSTEM_BILL_ADDRESS_ID.
    ORA-00904: "F_ORIG_SYSTEM_BILL_ADDR_REF": invalid identifier
    and if i insert data through apps then done.

    make sure that u have no speces left
    between lines.
    give the path of control file path correctly.

  • SQL*Loader-929: Error parsing insert statement for table

    Hi,
    I get the following error with SQL*Loader:
    Table MYTABLE loaded from every logical record.
    Insert option in effect for this table: INSERT
    Column Name Position Len Term Encl Datatype
    IDE FIRST * ; CHARACTER
    SQL string for column : "mysequence.NEXTVAL"
    CSI_NBR 1:10 10 ; CHARACTER
    POLICY_NBR 11:22 12 ; CHARACTER
    CURRENCY_COD 23:25 3 ; CHARACTER
    POLICY_STAT 26:27 2 ; CHARACTER
    PRODUCT_COD 28:35 8 ; CHARACTER
    END_DAT 44:53 10 ; CHARACTER
    FISCAL_COD 83:83 1 ; CHARACTER
    TOT_VAL 92:112 21 ; CHARACTER
    SQL*Loader-929: Error parsing insert statement for table MYTABLE.
    ORA-01031: insufficient privileges
    I am positive that I can SELECT the sequence and INSERT into the table with the user invoking sql*loader.
    Where does that "ORA-01031" come from?
    Regards
    ...

    Options:
    1) you are wrong about privileges OR
    2) you have the privilege only when you connect via SQL*Plus (or whichever other tool you used to test the insert).
    Is it possible that during your test you enabled the role which granted you the INSERT privilege - and that SQL*Loader doesn't do this?
    Can you see the table in this list?
    select *
    from user_tab_privs_recd
    where table_name='MY_TABLE'
    and owner='table owner whoever';
    select *
    from user_role_privs;Any roles where DEFAULT_ROLE is not YES?
    HTH
    Regards Nigel

  • Error cannot get new token due to device offfline state

    I cant download any app from appworld or even cant access into Myworld. Its says "Cannot get new token due to device offline state.(Error id:40760)"
    i reinstalled the appworld but its the same thing happening.Besides i have reset my BBID pasword through email as i forgot that. when i try to access in my mobile's bbid it says"Unable to update Blackberry ID account informtion while offline".
    it seems smthing wrong with the "offline state".Actually whats this thing?. i am using curve 9300 without BES or BIS but with the normal edge internet enabaling apn settings for five months.every thing was fine.but this problem is occuring for two days.my browser and other installed apps working fine but not the appworld.Please Help me....................

    Hi,
    I have the same problem, cant download any app from appworld or even cant access into Myworld. Its says "Cannot get new token due to device offline state.(Error id:40760)"
    I am using Bold 9700  without BES or BIS but with the normal edge internet enabaling apn settings for five months.every thing was fine. But this problem is occuring for two days.my browser and other installed apps working fine but not the appworld.Please Help me....................

  • "Operation is not valid due to the current state of the object" error when trying to create a link for a shared folder in OneDrive

    I'm trying to share a folder in OneDrive with another user in my organization, and create a link so that people outside of the company can see the folder. Whenever I try to create a link I get an error that says: "Couldn't create the link sorry something
    went wrong operation is not valid due to the current state of the object" How do I resolve this?

    Hi,
    Sorry for replying late and I noticed that you posted another thread in this forum:
    http://social.technet.microsoft.com/Forums/en-US/2b8c6f54-9c59-4b37-b28f-1d49a1b7913b/operation-is-not-valid-due-to-the-current-state-of-the-object-error-when-trying-to-create-a-link?forum=officeitpro
    I've replied and kindly refer to it to see if it is helpful.
    Regards,
    Melon Chen
    TechNet Community Support

  • SQL Insert Statement Data Type Mismatch Error

    I am doing a very simple web application that has a Microsoft Access database as the data source. I have been able to sucessfully create update and query statements using parameters but am having issues with an insert statement. I am using JSTL 1.1.2
    The following code creates the data type mismatch error.
    <sql:update
         sql="insert into tblTtoF(TFToolID,TFFeatID) values(?,?)">
            <sql:param value='$(ID}'/>
         <sql:param value='${feature}'/>
            </sql:update>The table has NUMBER as the data type for both of these fields and the variables I am feeding into it are both numbers. If I hard code the first number into the sql statement then it works. I have tried swapping the variables around and as long as the first one is hard coded the parameter for the second one works no matter which is first or second.
    However I can get the following code to work, which of course leaves me vulnerable to sql injection attacks which is not really a good thing.
    <sql:update>
         insert into tblTtoF(TFToolID,TFFeatID) values('<c:out value="${ID}"/>','<c:out value="${feature}"/>')
            </sql:update>So I am just looking for any suggestions as to why my first piece of code doesn't work seeing as it is the simplest of SQL statements and the most standard syntax.
    Thanks

    I changed it to the following
         <c:set var="featurenew" value="${0 + feature}"/>
         <c:set var="IDnew" value="${0 + param.toolID}"/>
              <sql:update
              sql="insert into tblTtoF(TFToolID,TFFeatID) values(?,?)">
              <sql:param value='$(IDnew}'/>
              <sql:param value='${featurenew}'/>
              </sql:update>And got the following error in the localhost.log
    31/07/2006 09:31:41 org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.sql.SQLException: SQL Exception : [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(JdbcOdbcPreparedStatement.java:1437)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(JdbcOdbcPreparedStatement.java:1072)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(JdbcOdbcPreparedStatement.java:1063)
         at org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.setParameters(UpdateTagSupport.java:254)
         at org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doEndTag(UpdateTagSupport.java:156)
         at org.apache.jsp.dataUpdated_jsp._jspx_meth_sql_update_1(dataUpdated_jsp.java:975)
         at org.apache.jsp.dataUpdated_jsp._jspx_meth_c_if_0(dataUpdated_jsp.java:879)
         at org.apache.jsp.dataUpdated_jsp._jspx_meth_c_forEach_0(dataUpdated_jsp.java:680)
         at org.apache.jsp.dataUpdated_jsp._jspService(dataUpdated_jsp.java:151)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
         at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
         at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
         at java.lang.Thread.run(Thread.java:595)
    I have also tried the following in the past with no luck
    <fmt:parseNumber value="${ID}" type="number" var="IDnew"/>
    AND......
    <sql:query
       sql="select TFToolID from tblTtoF where TFToolID = ?"
       var="toolresults">
       <sql:param value="${ID}"/>
    </sql:query>
    <c:forEach var="getID" items="${toolresults.rows}">
         <c:set var="theID" value="${getID.TFToolID}"/>
    </c:forEach>
    AND when that didn't work, added this....
    <fmt:parseNumber value="${theID}" var="IDnew"/>

  • VLD-1119: Unable to generate Multi-table Insert statement for some or all t

    Hi All -
    I have a map in OWB 10.2.0.4 which is ending with following error: -
    VLD-1119: Unable to generate Multi-table Insert statement for some or all targets.*
    Multi-table insert statement cannot be generated for some or all of the targets due to upstream graphs of those targets are not identical on "active operators" such as "join".*
    The map is created with following logic in mind. Let me know if you need more info. Any directions are highly appreciated and many thanks for your inputs in advance: -
    I have two source tables say T1 and T2. There are full outer joined in a joiner and output of this joined is passed to an expression to evaluate values of columns based on
    business logic i.e. If T1 is available than take T1.C1 else take T2.C1 so on.
    A flag is also evaluated in the expression because these intermediate results needs to be joined to third source table say T3 with different condition.
    Based on value taken a flag is being set in the expression which is used in a splitter to get results in three intermediate tables based on flag value evaluated earlier.
    These three intermediate tables are all truncate insert and these are unioned to fill a final target table.
    Visually it is something like this: -
    T1 -- T3 -- JOINER1
    | -->Join1 (FULL OUTER) --> Expression -->SPLITTER -- JOINER2 UNION --> Target Table
    | JOINER3
    T2 --
    Please suggest.

    I verified that their is a limitation with the splitter operator which will not let you generate a multi split having more than 999 columns in all.
    I had to use two separate splitters to achieve what I was trying to do.
    So the situation is now: -
    Siource -> Split -> Split 1 -> Insert into table -> Union1---------Final tableA
    Siource -> Split -> Split 2 -> Insert into table -> Union1

  • Dealing with errors due to newly added/dropped columns

    DB version:11g
    I am not sure if i have created an unnecessarily large post to explain a simple issue. Anway, here it is.
    I have been asked to code a package for Archiving .
    We'll have two schemas;The original schema and an Archive schema (connected via a DB Link)
    ORIGINAL Schema -------------------------> ARCHIVE Schema
                   via DB Link          When records of certain tables in the ORIGINAL schema meet the archiving criteria (based on Number of Days Old, Status Code etc), it will be moved ('archived') to the ARCHIVE schema using the INSERT syntax
    insert into arch_original@dblink
    col1,
    col2,
    col3,
    select col1,
    col2,
    col3,
    from original_tableThe original table and its archive table has the same structure, except that the Archive table has an additional column called archived_date which just records when a record got archived.
    create table original
    col1 varchar2(33),
    col2 varchar2(35),
    empid number
    create table arch_original
    col1 varchar2(33),
    col2 varchar2(35),
    empid number,
    archived_date date default sysdate not null
    );We have tables with lots of columns(there are lots of tables with more than 100 columns) and when all column names are explicitly listed like the above syntax, the code becomes huge.
    Alternative Syntax:
    So i thougt of using the syntax
    insert into arch_original select original.*,sysdate from original;  -- sysdate will populate archived_date columnEventhough the code looks simple and short, i've noticed a drawback to this approach.
    Drawback:
    For the next release, if developers decide to add/drop a column in the ORIGINAL table in the Original Schema, that change should be reflected in the archive_table's (ARCHIVE schema) DDL script as well. It is practically impossible to keep track of all these changes during the development phase.
    If i use
    insert into arch_original select original.*,sysdate from original;  syntax, you will realise that there is change in the table structure only when you encounter an error(due to missing/new column) in the Runtime. But, if you have all the column names listed explicitly like
    insert into arch_original@dblink
    (col1,
    col2,
    col3,
    select col1,
    col2,
    col3,
    from original_tablethen you'll encounter this error during the Compilation itself. I prefer the error due to a missing/new column during the Compilation itself rather than in Runtime.
    So what do you guys think? I shouldn't go for
    insert into arch_original select original.*,sysdate from original; syntax because of the above Drawback. Right?

    What advantage would it bring if i make ARCHIVED_DATE as the first column in the ARCHIVE tables?The advantage is that if you'll add a column in the future on both original and archived tables the insert statement will work anyway...
    SQL> create table x (a number, b number);
    Table created.
    SQL> create table y (arc_date date, a number, b number);
    Table created.
    SQL> insert into x values (1,1);
    1 row created.
    SQL> insert into x values (2,2);
    1 row created.
    SQL> select * from x;
             A          B
             1          1
             2          2
    SQL> insert into y select sysdate, x.* from x;
    2 rows created.
    SQL> alter table x add (c number);
    Table altered.
    SQL> alter table y add (c number);
    Table altered.
    SQL> alter table x drop column b;
    Table altered.
    SQL> alter table y drop column b;
    Table altered.
    SQL> insert into x values (3,3);
    1 row created.
    SQL> insert into y select sysdate, x.* from x
      2  where a=3;
    1 row created.
    SQL> select * from x;
             A          C
             1
             2
             3          3
    SQL> select * from y;
    ARC_DATE           A          C
    25-JAN-10          1
    25-JAN-10          2
    25-JAN-10          3          3Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]
    Edited by: Massimo Ruocchio on Jan 25, 2010 12:44 PM
    Added more explicative example

  • XSQL error when trying to insert record

    hi,
    I encounter a problem using INSERT statement in xsql:query action. If I try to use INSERT statement in my xsql page like this:
    <xsql:ze_action bean="TaskentryIn">
    <xsql:query>
    INSERT
    Grundtab( Datum,Startzeit,Endzeit)
    VALUES
    ('{@date}',{'@begin}','{@ende}')
    </xsql:query>
    </xsql:ze_action>
    I always get this xsql-error:
    Statement.executeQuery - No result sets were produced by 'INSERT...'
    So far so good, I think this shouldn't be an error rather a warning.
    But this is not my primary problem.
    Anyway the record is inserted in the DB. But since I call the above <xsql:query>, from within my own action handler, I call a sendRedirect() to my next page after the <xsql:query> tag was processed.
    After sendRedirect(), when I am on my next page, I check the DB for the inserted records, and it shows up that the insert was made two times, so I have two identically records in my DB.
    If I am not sendRedirect() to the next xsql page, then the insert is only made once. So I assume that there is a problem if an xsql-error occurs and afterwards a sendRedirect().
    I am using the same way to make my SELECT statements and I dont have any trouble with them. Only when I use INSERT.
    Any adive or help is appreciated.
    Peter

    <xsql:query> is only for queries.
    Use <xsql:dml> for a DML statement.

  • Insert Statement Will Not Work if a user has

    I am using a MySQL database to process my Java Server Page form.
    Simply, I always try to see if I can process information, first, via the command line client, then thru JSP.
    At the command line client I type:
    I type insert into tablename (favorite_quote) VALUES
    ('Sleepin' in 'da house!');
    That insert throws an error. SImply said, because of the bunches of single quotes... Is there any advanced statement or insert statement to solve this?
    If I do this:
    INSERT INTO tablename (favorite_quote) VALUES
    ('Java');
    It adds the record perfectly normal...
    I am REALLY new to Java, so any help on this issue would be great!
    BTW: Part of my Java Server Pages has:
    String favorite_quote =request.getParameter("favorite_quote");
    "INSERT INTO tablename (favorite_quote) VALUES " +
    "('"+userid+"')";
    Obviously that works fine unless anybody adds a ' or " isn't or what's, etc.
    I'm loving Java, I just REALLY need some help on solving this issue.
    Thank you so much! Any help would BE **WONDERFUL**!

    String favorite_quote
    te =request.getParameter("favorite_quote");
    PreparedStatement ps =
    = connection.prepareStatement(""INSERT INTO tablename
    (favorite_quote) VALUES (?)");
    ps.setString(1, "Sleepin' in 'da house!");
    ps.execute();oops a small error
    PreparedStatement ps = connection.prepareStatement("INSERT INTO tablename (favorite_quote) VALUES (?)");

Maybe you are looking for

  • Importing from one Iphoto Library to another

    Hi, Just wondering if you can help. I have two Iphoto libraries and would like to consolidate them into one. However, I want to import them in their current albums rather than as individual files as there is 31,000 of them and it will take forever to

  • Freezes and related problem

    My G4 has been freezing at least a couple times per day lately. When it does so, I have to shut it down to remedy the problem. When I attempt to restart, I usually get three monotone beeping sounds and the white "standby" light flashes three times. A

  • How do i specify the filename for a binary file generated by a JSP?

    I am writing a report generator that has the ability to generate Excel files. The user clicks on a link (exporter.jsp), the page's content-type has been set to "application/vnd.ms-excel" which naturally prompts the user to either save to a file or op

  • How to embed report in a custom template

    Hello friends, I have prepared a custom web template that I use in all of the web reports. How do I embed that in all of my web applications I prepare thru WAD? Thanks

  • Getdeviceip??? cant get it to work

    Whenever, it get to the getDeviceList, it always said that these two line below are wrong. xmlhttp.Send(); xmlDoc.loadXML(xmlhttp.responseText); what wrong with them??? Here is the code of the function getDeviceList() function getDeviceList(callManag