Data modification code not working please suggest something good?

Hi all,
I have a sql file where for all "CONSTRAINT anyname NOT NULL,"
occurences
i have to append "NOT NULL, -- " before "CONSTRAINT Adept_Usr_Login
NOT NULL, " in order to modify that.
I have written this code which is not giving required result.
Please provide me some better solution if some can.
The sql file contents are:
CREATE TABLE Adept_User(
Id NUMBER(10, 0) NOT NULL,
Login_Name VARCHAR2(30)
CONSTRAINT Adept_Usr_Login NOT NULL,
First_Name VARCHAR2(35)
CONSTRAINT Adept_Usr_First_name NOT NULL,
Last_Name VARCHAR2(35),
User_Password VARCHAR2(10)
CONSTRAINT Adept_Usr_Last_name NOT NULL,
User_Status NUMBER(10, 0)
CONSTRAINT Adept_Usr_Status NOT NULL,
User_Type NUMBER(10, 0)
CONSTRAINT Adept_Usr_Type NOT NULL,
Customer_Contact NUMBER(10, 0),
Employee NUMBER(10, 0),
Organization Number(10,0),
Password_Modified_Date DATE,
Currency_Master_Id NUMBER(10, 0),
CONSTRAINT PK23 PRIMARY KEY (Id)
CREATE TABLE Adept_User_Group(
Id NUMBER(10, 0) NOT NULL,
Adept_Group NUMBER(10, 0)
CONSTRAINT Adept_Usr_Grp NOT NULL,
Adept_User_Name NUMBER(10, 0)
CONSTRAINT Adept_Usr_name NOT NULL,
CONSTRAINT PK157 PRIMARY KEY (Id)
CREATE TABLE Adept_User_Permission(
Id NUMBER(10, 0) NOT NULL,
Adept_Screens NUMBER(10, 0)
CONSTRAINT Adept_Usr_Perm_Scren NOT NULL,
Adept_User_Group NUMBER(10, 0)
CONSTRAINT Adept_Usr_Grp NOT NULL,
Dashboard char(1),
CONSTRAINT PK28 PRIMARY KEY (Id)
The code written is:
import java.io.*;
class MySample1
public static void main(String[] args) throws Exception
String file="C:/Documents and
Settings/vijendras/Desktop/sampleApplicationchngd.sql";
FileReader inputstream = new FileReader(file);
BufferedReader rdr = new BufferedReader( inputstream );
// the StringBuilder which stores the processed lines
StringBuffer dataLines = new StringBuffer();
// read the file line by line
String dataLine;
while( ( dataLine = rdr.readLine() ) != null ) {
// split the input data into words upto first 3 words only
String[] tokens = dataLine.trim().split( " ",3 );
if( tokens[ 0 ].trim().equalsIgnoreCase( "CONSTRAINT") && tokens[ 2
].trim().equalsIgnoreCase( "NOT") &&
tokens[ 3 ].trim().equalsIgnoreCase( "NULL," ) )
dataLines.append( "NOT" ).append(" NULL").append(",").append(" -- ");
System.out.println(dataLines.toString());
else{
dataLines.append(dataLine).append( '\n' );
rdr.close(); // close the file
// open the file for writing new data to it
BufferedWriter writer = new BufferedWriter(new
FileWriter(file));
//System.out.println(dataLines.toString());
// write the new StringBuilder's data back to the file.
writer.write( dataLines.toString(), 0, dataLines.length()
writer.close(); // close the filev
Thanks
Vijendra

Hi Alok ,
i got ur query ,,
loop at main_table.
DELETE from zvdelivery1
WHERE MATNR = MAIN_TABLE-MATNR AND
BOX_NO = main_table-box_no.
ENDLOOP.
instead of this
get the main_table contents into itab where
as u say the matnr can be v*-.1234aofdmcpilo
so ur itab will be like this
matnr              |  box no |  date   
v*-.1234aofdmcpilo |  20     | 10122006
K#$%^&*ASDIFNIFDID |  30     | 11232006
$@%&&*43943434DFDDD|  40     | 12232006  
so get the whole contents into ur itab.
now  use only this
DELETE ZDELIVERY1 FROM TABLE MAIN_TABLE .
if  sy-subrc eq 0 .
write:/ records deleted.
endif.
NOTE.
DONT PUT THIS(DELETE STATEMENT ) IN A LOOP .
Regards,
Vijay.

Similar Messages

  • I have Iphone4 and my Iphone wifi button greyed out mean not working, Please suggest what need to do.

    I have Iphone4 and my Iphone wifi button grayed out mean not working, Please suggest what need to do and i am using ios 6.

    Please ask your question

  • 3 month subscription code not working,please help :(

    Hello.i have bough a 3 month subscription code from a electronics shop in my city was excited to get home and play gta online but the code didnt work evrytime i enter it it says "the code you entered may not be correct or may no longer be vald  Please check your entry its not cool i dont wanna buy a new code and not woek either or use my credit card.Please need help ASAP

    is there any weird looking letters  or something like that in your code ?are you sure it's the same region as your account ?

  • HTMLB Code not working Please help.....

    Hello All,
    Ive new in HTMLB. Have written this code wherein a JSP page is called from a JSPDynPage file. But am <b>not getting any output. Its all blank.</b> Dunno if im going wrong .... Please help.
    Struggling with this since y'day.
    <b>CODE</b>:
    <u><b>UserInfoDynPage.java</b></u>
    package com.sap.sample;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.enum.*;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.page.*;
    import com.sapportals.portal.htmlb.page.*;
    import com.sapportals.portal.prt.component.*;
    public class UserInfoDynPage extends PageProcessorComponent
    {     public DynPage getPage()
         {     return new UserInfoDynPageDynPage();
           public static class UserInfoDynPageDynPage extends JSPDynPage
           {     //private UserInfoBean UserInfoBean = null;
             public void doInitialization()
             {          IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
                       IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
                    /*Object o = componentSession.getValue("UserInfoBean");
                    if(o==null || !(o instanceof UserInfoBean))
                    {     UserInfoBean = new UserInfoBean();
                      componentSession.putValue("UserInfoBean",UserInfoBean);
                    else
                    {     UserInfoBean = (UserInfoBean) o;
                    // fill your bean with data here...
        public void doProcessAfterInput() throws PageException
        public void doProcessBeforeOutput() throws PageException
        {     this.setJspName("UserInfo.jsp");
    <u><b>UserInfo.jsp</b></u>
    <%@ taglib uri="tagLib" prefix="hjb" %>
    <hbj:content id="myContext" >
         <hbj:page title="UserInfo Page">
            <hbj:form id="myFormId" >
                 <hbj:textView id="title" text="Search Screen" design="STANDARD" />
                 <table>
                      <tr>
                           <td>
                                <hbj:label id:"lb_Search" text"Search For" labelFor="search" />
                           </td>
                           <td>
                                <hbj:inputField id="search" type="string" maxlength="25" />
                           </td>
                      </tr>
                      <tr>
                           <td>
                                <hbj:label id="lb_SearchType" text="Search Type" labelFor="searchType" />
                           </td>
                           <td>
                                <hbj:dropdownListBox id="SearchType" tooltip="UME Object  to search for" disabled="false">
                                     <hbj:listBoxItem key="user" value="User" />
                                     <hbj:listBoxItem key="group" value="Group" />
                                     <hbj:listBoxItem key="role" value="Role" />
                                </hbj:dropdownListBox>
                           </td>
                      </tr>
                 </table>
                 <br>
                 <hbj:button id="submit" text"search!" tooltip="Click me to search" disabled="false" design="emphasized" />
                 <br>
                 <br>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <u><b>Portalapp.xml</b></u>
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="UserInfoDynPage">
          <component-config>
            <property name="ClassName" value="com.sap.sample.UserInfoDynPage"/>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/UserInfo.jsp"/>
          </component-config>
          <component-profile>
               <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>     
        </component>
      </components>
      <services/>
    </application>
    =============
    Please help.
    Awaiting Reply.
    Thanks,
    Uday
    Message was edited by: Uday Hardikar

    Hi BHI,
    Thank you for your input.
    Had made silly mistake and got solved.
    And now, I have another problem which is related to this same program but the error seems to be a different one.
    Have posted another query:
    Error in HTMLB program..Please help..Urgent OR Error in HTMLB program..Please help..Urgent
    Please help me as its kinda urgent.
    Thanks in advance.
    Uday

  • Psn code not working. please help

    I just bought from a store nearby two 50$ receipt one worked but the other didn't it said not correct or may no longer be valid please check your entry (E-8200012F). I checked it many times but still no use what do I do.
    And I realy like how you take care of every situation

    What region is the card for, and what region is the PS store you're trying to redeem it from ?? If both those are not the same, then it won't work

  • My ipod cclassic 80gb is hang after trying dat press and hold method then also its not working please tell me solution

    My ipod cclassic 80gb is hang after trying dat press and hold method then also its not working please tell me solution

    Thanks for your response and good luck wishes, I suspect I will need them!
    In principle, I agree re: the manufacturer's warranty. However, I am pretty upset that this is now my second iPod to develop a critical fault within weeks of the warranty expiring, and frankly, it is not unreasonable to expect a state-of-the-art $500 electronic device to last well beyond one year of life.
    I agree talking to Apple is not likely to do me any good (the clue is in how impossible they make it to talk to them in the first place) - but that is not necessarily OK. I expect I will have to pay money to get the battery replaced - again, not OK (full stop - but especially given the cost of the device and the money I have spent with Apple). Yes, the batteries have a limited lifespan, but it should last longer than this (and surely, I should notice a gradual decline in its functionality, not an instant stop).
    I will try Deggie's suggestion (see my reply post), but probably won't hold my breath (think I have already done this). I probably will have to get the new battery - and probably under my own steam. It is a principle at stake and I feel I should be able to let Apple know how I'm feeling - and am frustrated that they make this virtually impossible. It sends the very clear message that they are not interested in listening to their customers.

  • Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    Hey, I wanna download Lion for free, so i need UP-TO-DATE , but it do not works , please help

    I think you misunderstood the guy. The up-to-date program isn't working for a lot of people. I'm eligible for the free upgrade but it fails to recognise my serial. From what I've read, this is affecting a lot of people who purchased their computers online. Apple seems to be fixing the issue though, so my advice would be to keep trying. Alternatively, click on the manual verificaton link so they can check your order for you and send the redemption code after they do.

  • Hi .. My phone has stopped vibrating.I have read the solution given by some users on this forum and have tried all the tricks. But nothing seems to be working. My phone still does not vibrate.please suggest

    Hi .. My phone has stopped vibrating.I have read the solution given by some users on this forum and have tried all the tricks. But nothing seems to be working. My phone still does not vibrate.please suggest.

    Hi .. My phone has stopped vibrating.I have read the solution given by some users on this forum and have tried all the tricks. But nothing seems to be working. My phone still does not vibrate.please suggest.

  • My iPhone is split from front panel on top, and back cover of my is swollen too. I am not able to use my phone and I cannot access my data in the phone. Please suggest what could be the cause of this problem?

    My iPhone is split from front panel on top, and back cover of my is swollen too. I am not able to use my phone and I cannot access my data in the phone. Please suggest what could be the cause of this problem?

    It sounds like the battery might have gone bad, and is swelling and causing the symptoms you describe.  Do not attempt to use the phone, but take it to Apple for evaluation.

  • I am trying ot install my cs6 online. it says that my code has been redeemed but i took it off of one of my laptops to download it onto this one. it is still not working. please help

    I am trying ot install my cs6 online. it says that my code has been redeemed but i took it off of one of my laptops to download it onto this one. it is still not working. please help

    Find your serial number quickly
    Download CS6 products
    Activation & Deactivation Help
    Mylenium

  • Since last week my date & time have not worked on my 5c. The date & time are constantly wrong. I've shut down, doesn't work. Set it automatically, doesn't work. I don't get texts or calls when it's sleeping. Any suggestions?

    Since last week my date & time have not worked on my 5c. The date & time are constantly wrong. I've shut down, doesn't work. Set it automatically, doesn't work. I don't get texts or calls when it's sleeping. Any suggestions?

    try a reset.
    Hold the home & power buttons down simultaneously until you see the Apple logo appear.
    Note: no data will be lost.

  • HT204204 i tried to update to ios 8.2 on my iphone 5s when message popup to me now my iphone not working, please help i dont want to lose my data

    hi
    i tried to update to ios 8.2 on my iphone 5s when message popup to me now my iphone not working, please help i dont want to lose my data

    What is the exact text of the message you got? And did you not back up before you updated?

  • IPhone 6 pin or fingerprint not working please help me asap

    i phone 6 pin and finger print not working please help

    Howdy Karan sood,
    Welcome to Apple Support Communities.
    It sounds like you’re running into an issue unlocking your iPhone because Touch ID and passcode aren’t being accepted.
    Take a look at the article linked below, it provides troubleshooting suggestions that’ll resolve most Touch ID issues.
    Use Touch ID on iPhone and iPad - Apple Support
    Get help with Touch ID
    Make sure that you're using the latest version of iOS.
    Make sure that your fingers and the Home button are clean and dry.*
    Cover the Home button completely. Don't tap too quickly, don't press down hard, and don't move your finger while Touch ID is scanning. Make sure that your finger touches the metal ring around the Home button.
    If you're using a case or screen protector, make sure it doesn't cover the Home button or the surrounding ring. If it does, remove the case or screen protector and try again.
    Tap Settings > Touch ID & Passcode and make sure that iPhone Unlock or iTunes & App Store is on. Also make sure that you've enrolled one or more fingerprints.
    Try enrolling a different finger.
    If you can't enroll any of your fingers, take your device to an Apple Retail Store, Apple Authorized Service Provider, or contact AppleCare for help.
    * Moisture, lotions, sweat, oils, cuts, or dry skin might affect fingerprint recognition. Certain activities can also temporarily affect fingerprint recognition, including exercising, showering, swimming, cooking, or other conditions or changes that affect your fingerprint.
    And, this article provides tips that’ll help resolve passcode issues.
    iOS passcodes - Apple Support
    Forget your passcode?
    If you or someone else enters the wrong passcode too many times, your device will disable itself temporarily. Get help if you forgot your passcode or your device is disabled.
    Learn what to do if you forgot your Restrictions passcode.
    I hope this helps,
    -Jason

  • Date parameter does not work in SharePoint 2010 report using SQL 2008 Server Reporting Service

    Here is the settings:
    SharePoint 2010 with SQL server 2008 reporting services configured
    When create a report for a SP list using SQL server report builder (3.0) the date parameter does not work.
    The data parameter is set as "date and time" type and field name equals the col name in the SP list
    When run the report, the whatever dates I select, the result is always the same, so the parameters do not take any effect.
    Is any step missing?
    Thanks for any advice !

    Hi ,
    How did you configure you "date and time" type parameter and field name equals the col name in the SP list?
    Have you tested if other type parameter worked?
    Have you tried typing the date format as 20140722 in your date parameter filed before run the report?
    http://whitepages.unlimitedviz.com/2012/02/using-sharepoint-filters-with-reporting-services-parameters-for-personalized-reports/
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

  • The built-in mic in g50 122ca laptop model is not working. please help me out.

    the built-in mic in g50 122ca laptop model is not working. please help me out. OS: Windows Vista (32-bit)

    here is a sample code .
    so far you procedure looks good but
    i bet you have to specify the name of report , instead of 'filename'.
    see this
    Plist_id := GET_PARAMETER_LIST('P_name');
    IF NOT ID_NULL(Plist_id) THEN
    DESTROY_PARAMETER_LIST(Plist_id);
    END IF;
    Plist_id := CREATE_PARAMETER_LIST('P_name');
    ADD_PARAMETER( Plist_id, 'P_Receive_date', TEXT_PARAMETER, TO_CHAR(Receive_date,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Hearing_date', TEXT_PARAMETER, TO_CHAR(Hearing_date,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Hearing_time', TEXT_PARAMETER, TO_CHAR(Hearing_time,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Issue_date', TEXT_PARAMETER, TO_CHAR(Issue_date,'mm/dd/yyyy'));
    ADD_PARAMETER( Plist_id, 'P_Workshop_date', TEXT_PARAMETER, TO_CHAR(Workshop_date,'mm/dd/yyyy'));
    -- RUN_PRODCT(REPORTS,'..\Reports\Pro_License',SYNCHRONOUS, RUNTIME, FILESYSTEM, Plist_id, NULL);
    -- here Pro_License is the name of report.
    did you tried to see if the parameter passed using a message ?
    try
    message('parameter name'); pause; write this before "run_report".

Maybe you are looking for

  • Date format error while accessing date from SQLSERVER

    Hi all, in me webdynpro application I have taken Date type for the Input Field. At date select it is displaying in the format   *2/14/2009 i.e. mm/dd/yyyy* And when I am saving date in the sql database then the date format changes to.. 2009-02-14 i.e

  • Infopath2013 button in secondary view not visible on form in SharePoint online

    We have a SharePoint list that has gotten its Form with Infopath. The infopathform has 2 views: Userview and Fullview. The Userview has some fields and a submit button and is activated when adding a new item in the list. The Fullview is active when o

  • Thinkpad twist downgrade to window 7 missing driver

    Hi I just purchase the thinkpad twist s230u 33374HU from staples I tried to upgrade the hdd to ssd, however I do not own window 8 copied. I download grade the machines to window 7 but there is no driver for wireless or lan adapter that support window

  • VPN View of LAN

    I have setup a VPN connection to my office and it appears to be operating as promised. When I log in remotely using VPN, I use my servers fully qualified name with "Connect to Server" menu selection to access the files on my server. Is there anyway t

  • Wireless Printing to Xerox Phaser 6180...does it work?

    Is there a list of compatible printers for the Airport Express? I want to wireless print to a Xerox Phaser 6180