Need some help...in need of a different way.

Hi, I'm new to Java and need some help. I have 2 questions that are similar in nature.
1st Question:
In a program that I'm writting I have a do-while loop which at the end brings up a dialog box that asks the user to enter '1' for 'Yes' or '2' for 'No' to continue.
I would rather have the option of having the user enter 'y' or 'Y' for Yes and 'n' or 'N' for No.
Here is what I have currently:
int x;
String data;
do{
//Blah blah code
data = JOptionPane.showInputDialog(null, "Enter 1 for Yes or 2 for No");
x = Integer.parseInt(data);
}while(x == 1);
x++;
2nd Question:
In another part of my program I have a Case statement that asks the user to enter a number or a letter from a list of choices. They can enter '2' , 't', or 'T'.
I would rather have all of this in an if-else chain. Is this possibe? if so, how would I do it.
Thanks.

I would rather have the option of having the user enter 'y' or 'Y' for Yes and 'n' or
'N' for No. You can test the first letter of whatever the user inputs like this:String response = JOptionPane.showInputDialog(null, "Enter (Y)es or (N)o");
response = response.toLowerCase();
if(response.startsWith("y")) {
    // the user entered something starting with y
} else if(response.startsWith("n")) {
    // the user entered something starting with n
} else {
    // what are you going to do?
}JOptionPane also has versions that would allow yes/no buttons. Eg, see:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Similar Messages

  • Need some help killing threads (not in the way already mentioned..)

    I have read the ways in which we should safely kill a thread - and for the most part i understand that. But my question is HOW to implement it in the way that I need.
    Basically I have a multithreaded (ewww) app that really is a large job scheduler running 24/7. It can run anywhere from 1 to 15 jobs at a given time. This is fine. What i need is to have the ability to 'kill' a job when I need to. When the app daemon decides its time to run a certain job (based on business logic) it kicks one off, which is a class I made that implements Runnable.
    public class SchedulerProcessThread extends SOQBase implements Runnable{}
    when its time to start a job i do the usual:
    SchedulerProcessThread spt = new SchedulerProcessThread(blah);
    Thread t = new Thread(spt, "fooname");
    t.start();
    Now, this comes to my problem of where/how to kill the job (if needed). A SchedulerProcessThread is linear and finite so it will always have a termination point - it never loops. And when one is kicked off - i do not have a reference to it anymore - I mean, I couldnt if i am constantly running new jobs, potentially hundreds every hour. And jobs can be started in various places in the app, depending upon whether others are already running, etc.
    I wish to implement the do-while (alive) logic on the job thread. So in the 'run()' method of my SPT class, I would like the:
    while (alive) {
    doProcessing();
    But how can i invoke a method on my class [SPT] so that it changes the alive var from true to false when i do not have a reference to it?
    As a side note, I have a command prompt on the app whereby i can call up all the running 'jobs' which is a list of the running threads under a threadgroup called 'soqjob' (all new Threads that are started with a passing param of and SPT object are under the 'soqjob' threadgroup). So now i can see all those 'soqjob' threads which are currently running Thread objects that have been passed new instances of an SPT class.
    Is there anyway i can grab the 'soqjob' thread of my choice and somehow access my SPT class that was originally passed to it in the Thread constructor? if so, then I could pass in the command to stop the do-while loop.
    Hmm - does any of this make sense? If i can sum up, the problem is i do not know how to access my own SPT class once I have passed it into a thread object and invoked that thread object's 'start()' method. if i can do that, then i can switch the ALIVE var from true to false and thereby kill the SPT job i need.
    Any ideas?
    Many thanks
    Ian

    I would add a Collection (synchronized) to the Scheduler that holds a reference to all the Processes. Pass a reference of the Scheduler to the Processes so that when a Process is done, it can remove itself from the Collection.
    public class Scheduler {
         private Collection threads;
         public void addProcess() {
              Runnable runnable = new ProcessThread(this);
              Thread thread = new Thread(runnable);
              thread.start();
              threads.add(thread);
         public void removeProcess(ProcessThread thread) {
              threads.remove(thread);
         private Thread getSelectedThread(Component c) {
              //Find Thread in Collection and return it
         private class Action implements ActionListener {
              public void actionPerformed(ActionEvent e) {
                   Thread thread = getSelectedThread(e.getSource());
                   thread.interrupt();
    class ProcessThread extends ... implements Runnable {
         private Scheduler scheduler;
         public ProcessThread(Scheduler s) {
              this.scheduler = s;
         public void run() {
              while (!Thread.interrupted()) {
                   try {
                        doProcessing();
                        Thread.yield();     //Give the other Threads a chance to do some work
                   } catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
              this.scheduler.removeProcess(this);     //Remove this Thread from the Scheduler's Collection
    }Did you consider using the classes java.util.Timer and java.util.TimerTask?

  • HT1222 I need some help.... I Have the iPhone 4S and downloaded the new software (6.0) and everything seems great so far except when I try to open a link in safari from a different app (messages, Facebook, ext..) it glitches and won't load. Any advice?

    I need some help.... I Have the iPhone 4S and downloaded the new software (6.0) and everything seems great so far except when I try to open a link in safari from a different app (ie..messages, Facebook, ect..) it glitches and won't load. The blue loading bar will just jump back and forth and the page will not load properly if at all....

    It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
    First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
    http://www.adwaremedic.com/kb/baddns.php
    http://www.adwaremedic.com/kb/hackedrouter.php
    If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
    As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • Need some help in creating Search Help for standard screen/field

    I need some help in adding a search-help to a standard screen-field.
    Transaction Code - PP01,
    Plan Version - Current Plan (PLVAR = '01'),
    Object Type - Position ( OTYPE = 'S'),
    Click on Infotype Name - Object ( Infotype 1000) and Create.
    I need to add search help to fields Object Abbr (P1000-SHORT) / Object Name (P1000-STEXT).
    I want to create one custom table with fields, Position Abb, Position Name, Job. Position Abb should be Primary Key. And when object type is Position (S), I should be able to press F4 for Object Abb/Object Name fields and should return Position Abbr and Position Name.
    I specify again, I have to add a new search help to standard screen/field and not to enhance it.
    This is HR specific transaction. If someone has done similar thing with some other transation, please let me know.
    There is no existing search help for these fields. If sm1 ever tried or has an idea how to add new search help to a standard screen/field.
    It's urgent.
    Thanks in advace. Suitable answers will be rewarded

    Hi Pradeep,
    Please have a look into the below site which might be useful
    Enhancing a Standard Search Help
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/daeda0d7-0701-0010-8caa-
    edc983384237
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm
    A search help exit is a function module for making the input help process described by the search help more flexible than possible with the standard version.
    This function module must have the same interface as function module F4IF_SHLP_EXIT_EXAMPLE. The search help exit may also have further optional parameters (in particular any EXPORTING parameters).
    A search help exit is called at certain timepoints in the input help process.
    Note: The source text and long documentation of the above-specified function module (including the long documentation about the parameters) contain information about using search help exits.
    Function modules are provided in the function library for operations that are frequently executed in search help exits. The names of these function modules begin with the prefix F4UT_. These function modules can either be used directly as search help exits or used within other search help exits. You can find precise instructions for use in the long documentation for the corresponding function module.
    During the input help process, a number of timepoints are defined that each define the beginning of an important operation of the input help process.
    If the input help process is defined with a search help having a search help exit, this search help exit is called at each of these timepoints. If required, the search help exit can also influence the process and even determine that the process should be continued at a different timepoint.
    timepoints
    The following timepoints are defined:
    1. SELONE
    Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This timepoint can be used in a search help exit of a collective search help to restrict the selection possibilities for the elementary search helps.
    Entries that are deleted from SHLP_TAB in this step are not offered in the elementary search help selection. If there is only one entry remaining in SHLP_TAB, the dialog box for selecting elementary search helps is skipped. You may not change the next timepoint.
    The timepoint is not accessed again if another elementary search help is to be selected during the dialog.
    2. PRESEL1
    After selecting an elementary search help. Table INTERFACE has not yet been copied to table SELOPT at this timepoint in the definition of the search help (type SHLP_DESCR_T). This means that you can still influence the attachment of the search help to the screen here. (Table INTERFACE contains the information about how the search help parameters are related to the screen fields).
    3. PRESEL
    Before sending the dialog box for restricting values. This timepoint is suitable for predefining the value restriction or for completely suppressing or copying the dialog.
    4. SELECT
    Before selecting the values. If you do not want the default selection, you should copy this timepoint with a search help exit. DISP should be set as the next timepoint.
    5. DISP
    Before displaying the hit list. This timepoint is suitable for restricting the values to be displayed, e.g. depending on authorizations.
    6. RETURN (usually as return value for the next timepoint)
    The RETURN timepoint should be returned as the next step if a single hit was selected in a search help exit.
    It can make sense to change the F4 flow at this timepoint if control of the process sequence of the Transaction should depend on the selected value (typical example: setting SET/GET parameters). However, you should note that the process will then depend on whether a value was entered manually or with an input help.
    7. RETTOP
    You only go to this timepoint if the input help is controlled by a collective search help. It directly follows the timepoint RETURN. The search help exit of the collective search help, however, is called at timepoint RETTOP.
    8. EXIT (only for return as next timepoint)
    The EXIT timepoint should be returned as the next step if the user had the opportunity to terminate the dialog within the search help exit.
    9. CREATE
    The CREATE timepoint is only accessed if the user selects the function "Create new values". This function is only available if field CUSTTAB of the control string CALLCONTROL was given a value not equal to SPACE earlier on.
    The name of the (customizing) table to be maintained is normally entered there. The next step returned after CREATE should be SELECT so that the newly entered value can be selected and then displayed.
    10. APP1, APP2, APP3
    If further pushbuttons are introduced in the hit list with function module F4UT_LIST_EXIT, these timepoints are introduced. They are accessed when the user presses the corresponding pushbutton.
    Note: If the F4 help is controlled by a collective search help, the search help exit of the collective search help is called at timepoints SELONE and RETTOP. (RETTOP only if the user selects a value.) At all other timepoints the search help exit of the selected elementary search help is called.
    If the F4 help is controlled by an elementary search help, timepoint RETTOP is not executed. The search help exit of the elementary search help is called at timepoint SELONE (at the
    F4IF_SHLP_EXIT_EXAMPLE
    This module has been created as an example for the interface and design of Search help exits in Search help.
    All the interface parameters defined here are mandatory for a function module to be used as a search help exit, because the calling program does not know which parameters are actually used internally.
    A search help exit is called repeatedly in connection with several
    events during the F4 process. The relevant step of the process is passed on in the CALLCONTROL step. If the module is intended to perform only a few modifications before the step, CALLCONTROL-STEP should remain unchanged.
    However, if the step is performed completely by the module, the following step must be returned in CALLCONTROL-STEP.
    The module must react with an immediate EXIT to all steps that it does not know or does not want to handle.
    Hope this info will help you.
    ***Reward points if found useful
    Regards,
    Naresh

  • Need some help with a Macally enclosure and a spare internal drive

    Need some help with a Macally enclousure
    Posted: Oct 1, 2010 10:55 AM
    Reply Email
    Aloha:
    I have a Macally PHR-S100SUA enclousure that does not recognise,my WD 1001fals hard drive. It has worked just fine with other internal drives, but not this one?
    This is a spare internal drive that I am trying to make an external drive to store back ups for a lot of data. But so far I can not get it recognized by the computer. Maybe I need different drivers?
    Any suggestions?
    Dan Page

    Hi-
    Drivers aren't typically needed for external enclosures.
    Macally has none listed for that enclosure.
    The same is true for the WD drive, internal or external; no drivers.
    With the exception of high end PM multi drive enclosures, I can't think of any that use drivers.
    How is the external connected?
    Have you tried different cables, different ports?
    Bad/damaged cables are fairly common.
    Have you verified connections inside of the enclosure?

  • We have a set of oracle clients running on T5220 zones that need some help

    Greetings all -
    We have a set of oracle clients running on T5220 zones that need some help.
    If, for example, I execute the query "select (all) from dba_objects", trace output reports 90% of the elapsed time spent under "SQLNet message from client".
    Here are OS details for the clients: Solaris 10 5/08 s10s_u5wos_10 SPARC
    Running "uname -a" from the client gives:
    (SunOS bmc-ste-app 5.10 Generic_127127-11 sun4v sparc SUNW,SPARC-Enterprise-T5220)
    Here are OS details for the dataserver: Enterprise Linux Enterprise Linux Server release 5.2
    Running "uname -a" from the dataserver gives:
    (2.6.18-92.1.6.0.2.el5 #1 SMP Thu Jun 26 17:44:55 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux)
    The RDBMS is 10.2.0.4
    Again, please note, there is no application in the picture here. We are just running a simple catalog query (select * from dba_objects) from sqlplus. Why the wait on something like this? The wait also occurs when a different query is used (select (all) from SYS.COL$ where rownum < 50000). And it doesn't matter if I used the full client or the instant client. I still get the same high-wait.
    We had thought - maybe this is a network thing - so we put a test client on the same subnet as the dataserver. This helped - but not enough. The wait is still way too high even with firewalls taken out of the equation.
    We've also looked at arraysize, SDU, kernel settings. And we've spent time going over tkprof, truss and sqlnet-tracing.
    Has anyone ever had to solve this HIGH WAIT ON CLIENT issue? Is there a work around or some tweak I'm missing.
    Is anyone configured like we are (linux dataserver, solaris clients)? If so - did you see anything like this?
    tia -
    Jim
    Edited by: jim1768 on Mar 31, 2010 1:47 PM
    Edited by: jim1768 on Mar 31, 2010 2:12 PM
    Edited by: jim1768 on Mar 31, 2010 2:13 PM

    Hello,
    We have the exact same issue. Did you ever solve this issue? We have a t5220 and have just upgraded our 11.5.10.2 11i system on it from 9.2.0.8 32-bit sparc to 11.2.0.1 64-bit sparc. Things should be faster but arent, and our consultant has tracked it down to high wait times when the apps tier using forms connects to the database tier on the same box. So even though the t5220 is both server and client, there is something about the client sql connection.through TNS that his having trouble. Thanks for any information. We've also created an S/R with Oracle.
    Note: I am well aware of the other issues with the CMT server series but this particular issue seems independent of the regular / known issues and remains a mystery to us. Other known issues with the CMT servers for SPARC:
    Metalink Note 781763.1 (Migration from fast single threaded CPU machine to CMT UltraSPARC T1 & T2)
    http://blogs.sun.com/glennf/resource/Optimizing_Oracle_CMT_v1.pdf
    http://blogs.sun.com/glennf/tags/throughput
    http://blogs.sun.com/glennf/entry/getting_past_go_with_sparc
    http://www.oracle.com/apps_benchmark/doc/E-Bus-11i-PAY_ORA_SUN-T5220.pdf (this paper has some oracle init settings at the end. The kernel settings have been included in the OS upgrade)
    http://blogs.sun.com/mandalika/entry/siebel_on_sun_cmt_hardware

  • JTree - need some help!

    Hello ,
    I need some help with JTree
    I'm writing an aplicaion that includes JTree , but Default JTree is not enough cause near to each intersection (not leaf) I need to display square with different color , I don't care if the square will replace the icon of tree or will be located close to the text (intersection name)
    I don't know how to do it exactly
    Please help me!!
    Thanks a lot!

    more easy with UIManager, put it at the beginig of your application:
    UIManager.put("Tree.closedIcon",
    new ImageIcon(gifp + "folder.gif"));
    UIManager.put("Tree.openIcon",
    new ImageIcon(gifp + "folder_open.gif"));
    UIManager.put("Tree.leafIcon",
    new ImageIcon(gifp + "puntaflechaamarilla.gif"));
    UIManager.put("Tree.expandedIcon",
    new ImageIcon(gifp + "arbol-menos.gif"));
    UIManager.put("Tree.collapsedIcon",
    new ImageIcon(gifp + "arbol-mas.gif"));
    where gip is the gif's path.

  • I need some help. im getting error -69 when trying to sync my ipod. i dont kno what to do. ive tried googling as much info as i can on this but i cant seem to find a answer to get me off to a good starting point. i back all my music up on a hard drive.

    i need some help. im getting error -69 when trying to sync my ipod. i dont kno what to do. ive tried googling as much info as i can on this subject but i cant seem to find a answer to get me off to a good starting point. i back all my music up on a external hard drive.

    If the file was not originally from iTunes, you'll need to redownload it from it's original source or rerip it from the CD.  Files can sometimes go bad and become corrupted.  As to how or why that happens, there are a number of ways.
    What format are the problematic tracks in? Have you tried converting them to another format in iTunes?
    iTunes: How to convert a song to a different file format
    B-rock

  • Need some help with sound quality

    Hi guys, new here. I'm working on creating an album on my own. Bass and vocals are real, everything else is using software instruments. I have about 8 songs done, but the problem is I don't really know what I'm doing as far as recording and levels go.
    I'm using studio headphones and everything sounds fantastic through them, and even pretty good if I just hook up some earbuds, but when I bounce out a track and burn them to do a disc and play it in my car, it sounds awful. Suddenly the guitar is too low, drums are too loud.
    I really need some help here. I'm even willing to pay someone to get me on the right track. Using paypal or whatever.

    AecDuck wrote:
    Where's the fun in that? Maybe you have different motives, but I got into home recording because I like doing things myself, even if I have to learn the hard way. If you know enough to get good bass and vocal recordings and mix that with virtual instruments, then you are well on your way to making a decent sounding mix. Mixing in headphones can be very deceiving. Things simply sound different in headphones. You need some monitors, even if they are crappy because if you can get it to sound good in crappy monitors it will likely sound good on other speakers.
    The fun and experience comes from getting a good balance that sounds good in headphones, and in the monitors, and in your home stereo, and in your car stereo. Use the different audio systems as a reference. If the drums are too quiet in the car, bring them up a bit. If the bass is too loud in your headphones, put them down a bit.
    If you bring in your recordings to be mixed by somebody else, first of all you're going to end up paying hundreds, if not $1000+ dollars, even in a sub-par studio. Secondly, it's never going to sound how you want it to sound. It's going to sound how THEY want it to sound.
    I know it takes longer, and it's hard work, but you will have such a tremendous amount of satisfaction when your project is done knowing that YOU recording it, and YOU mixed it on YOUR equipment. It will be 100% yours.
    Where's the fun? How about the fun in interacting with another human being? How about the satisfaction in having another validate what you've been trying to produce?
    I don't think it's helpful to make generalizations about what type of experience the OP might have in getting professional help. I have had good experiences working with mixing engineers, and perhaps I have just been lucky, but I've been able to produce music that sounded how I wanted it to sound, but at a level beyond which my skill at the time would have been able to produce, AND I gained some insights to help me in the future.
    It IS satisfying to teach yourself a new skill. And it takes a lot of patience, trial and error, and you might miss the mark more often than you hit it. If you're in a rush, it might be a viable solution to contact some studios and see if you can work with them. Learning from others is perfectly acceptable.

  • Need some help with wine + midi

    Howdi guys!
    I need some help. I'd like to run an application which is only available for Windows and OSX, so my choice is wine. This application needs to send midi signals to the hardware it is supposed to control.
    In the product's forum there is a thread which shows how it can be done. But the newest releases of wine don't allow this, because it doesn't support jack anymore.
    I think basically it doesn't matter which application it is I run in wine, the question is, is it possible to send midi signals in and out through wine? If so, how? Might be that it's quite trivial, in my defense I have to say that I never worked with midi before.
    The soundcard I use is an Edirol UA-25 which is fully supported in Linux, midi works.
    Thanks for any ideas!
    edit: Forgot two things: I know I could try older versions of wine or running it in a virtual machine, but I want to avoid this.
    Last edited by Army (2012-04-27 07:15:33)

    For that app, you will probably be using the ALSA-midi interface. So, you shouldn't require Wine to have jack support. - In fact, that picture clearly shows that Wine is using ALSA-midi, but he is using jackd + a2jmidid (which exposes alsa-midi 2 jack-midi).
    As long as that software doesn't require a special driver, you should be able to use it. As for the specifics, i would imagine that you would start jackd, start a2jmidid and then start your application. - you also have to make sure your midi device is connecting before launching your app in wine - otherwise the device won't show up in your wine app. You also will need to select your midi interface in your application. After this, you should be able to connect your wine app (through the a2jmidi bridge) to your hardware.
    But if for whatever reason you can't get it too work ~ i do actually use a VM for updating firmware on 2 different audio devices (a soundcard and midi-controller) - and it works great. I am using VMware, but i would imagine virtualbox would work very similar..
    cheerz

  • Remote App on iPad connects but drops after about  20 mins. Need to turn  off wait about 1 minute then turn on wifi on iMac before it can reconnect. Need some help please.

    Remote App on iPad connects but drops after about  20 mins. Need to turn  off wait about 1 minute, then turn on wifi on iMac before it can reconnect. Need some help please.
    Already gone through troubleshooting guide a zillion times. Thanks.

    This worked for me... A little time consuming but once you get rolling it goes GREAT... Thanks....
    I got my artwork and saved it to my Desktop
    Opened up Microsoft Paint and clicked on "File" and "Open" and found it to get it on the screen to resize it
    Clicked "resize" and a box for changing it opened up
    Checked the box "Pixels" and "Unchecked maintain aspect ratio"
    Set Horizontal for 640 and Vertical for 480
    Clicked on "OK" and went back to "File" and did a "Save As" and chose JPEG Picture
    It came up "File Already Existed" and clicked "OK" (really did not care about the original artwork I found because wrong size)
    Went to iTunes and on the movie right clicked on "Get Info", clicked on "Details", then "Artwork"
    Go to the little box on the top left that shows your old artwork and click on it to get the little blue border to appear around it and hit "Delete" to make it gone
    Click on "Add Artwork" and find it where you put the one from above on your Desktop and hit "Open" and OK and your new artwork is now there and all good.
    Sounds like a lot of steps to follow but after around 5 or so you will fly through it. This worked perfect on my iPhone 6 Plus and I have artwork on my Home Videos now.

  • TS1702 I need some help the apps were downloading slowly

    The apps downloaded but it didn't cause it's stuck in downloading mode what should I do?
    The iOS 6 update didn't work.
    Please I need some help.
    The apps didn't download.
    Talking Angela and Ginger didn't download.
    Talking Santa didn't update.

    Try moving the existing backup file to a safe location so that iTunes has to create an entire new file.  The backup file is located here. You can delete that backup once you get a successfull backup.
    iTunes places the backup files in the following places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Windows Vista and Windows 7: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Note: If you do not see the AppData or Application Data folders, you may need to show hidden files (Windows XP,  Windows Vista and Windows 7), or iTunes may not be installed in the default location. Show hidden files and then search the hard drive for the Backup directory.

  • Need some help: my itunes won't sync with my iphone anymore. Both softwares are up to date and I've reinstalled itunes. After I reinstall, it syncs. But then when I reboot my computer, it no longer syncs anymore and I have to keep reinstalling itunes. Tho

    Need some help: my itunes won't sync with my iphone anymore. Both softwares are up to date and I've reinstalled itunes. After I reinstall, it syncs. But then when I reboot my computer, it no longer syncs anymore and I have to keep reinstalling itunes. Thoughts???

    thought that it was possible to have the same iTunes library on any machine that was authorised, a kind of cloud-iTunes I guess. 
    That would convenient, but sadly it is not the case. Sorry!
    Either way your welcome and best of luck!
    B-rock

  • Need some help in debugging this exported script

    Below is DDL generated by visio forward engineering tool . The example below consists of 2 test tables with one foreign key.
    Forward engineering generated DDL script
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table1]') AND type in (N'U'))
    DROP TABLE [dbo].[Table1]
    GO
    CREATE TABLE [dbo].[Table1] (
    [test] CHAR(10) NOT NULL
    , [test2] CHAR(10) NULL
    GO
    ALTER TABLE [dbo].[Table1] ADD CONSTRAINT [Table1_PK] PRIMARY KEY CLUSTERED (
    [test]
    GO
    GO
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table2]') AND type in (N'U'))
    DROP TABLE [dbo].[Table2]
    GO
    CREATE TABLE [dbo].[Table2] (
    [test2] CHAR(10) NOT NULL
    GO
    ALTER TABLE [dbo].[Table2] ADD CONSTRAINT [Table2_PK] PRIMARY KEY CLUSTERED (
    [test2]
    GO
    GO
    ALTER TABLE [dbo].[Table1] WITH CHECK ADD CONSTRAINT [Table2_Table1_FK1] FOREIGN KEY (
    [test2]
    REFERENCES [dbo].[Table2] (
    [test2]
    GO
    GO
    When i converted this DDL script using scratch editor the migration tool gave some errors can anyone help me to resolve below
    DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table1]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table1;
    END IF;
    END;
    CREATE TABLE Table1
    test CHAR(10) NOT NULL,
    test2 CHAR(10)
    ALTER TABLE Table1
    ADD
    CONSTRAINT Table1_PK PRIMARY KEY( test );
    --SQLDEV:Following Line Not Recognized
    DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table2]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table2;
    END IF;
    END;
    CREATE TABLE Table2
    test2 CHAR(10) NOT NULL
    ALTER TABLE Table2
    ADD
    CONSTRAINT Table2_PK PRIMARY KEY( test2 );
    --SQLDEV:Following Line Not Recognized
    ALTER TABLE Table1
    ADD
    CONSTRAINT Table2_Table1_FK1 FOREIGN KEY( test2 ) REFERENCES Table2 (test2)
    --SQLDEV:Following Line Not Recognized
    ;

    Pl do not post duplicates - Need some help in debugging this script

  • Need some help in Los Angeles

    working on a music video that needs some help. I own Final Cut and Color. Done the edit and it looks great but it needs help polishing and I have no idea what to do. Planning on showing the video this friday night in hollywood and I want it to blow people away. Is there anyone in the area would be willing to help? Please contact me ASAP. Thanks Ray

    if you can give me a call that would be best, I can tell you what I need to accomplish. Thanks
    818 935 5079

Maybe you are looking for

  • Component renders more then once

    Hi, I'm having a jspx page containing a navigation panel and 3 panelboxes. Depending on the value of a 'Type' attribute defined in the pageDefinition, one of the panelBoxes get rendered. *If the value of the 'Type' attribute is 'T': the panelBox rend

  • Customer invoice - Accouting error

    Hello Gurus, When releasing an invoice(F2) to accouting I get an error, "Account 1001166 is blocked for posting". 1001166 is sold to party in the document. There is NO posting block in the billing document type, Additional information: This customer

  • How to measure path area in Illustrator CC?

    How to measure path area in Illustrator CC? For example I draw a rectangular, how do I get it's area size? Thanks!!!

  • Open forms designed by Livecycle Designer in ipads

    hi everyone, I've got a few dynamic forms that were designed using the Livecycle Designer ES and its requirement is at least a version of adobe acrobat 8.1. I have some users having trouble opening these forms using ipad although they have got the la

  • Comcast connundrum - how to make it work?

    I am having trouble making the time capsul the primary wireless router connected to a comcast cable modem. cable modem is a CISCO DPC3008. I can make the time capsule work as a backup, but then there is no internet connectivity. I can make the wirele