Results 1 to 5 of 5

Thread: sqlj help

  1. #1
    Join Date
    Jul 2003
    Posts
    5

    Unanswered: sqlj help

    I want to write a sqlj program that will prompt the user for an old zipcode value and a new zip values and that will change all occurrences of the old zipcode value in the tables of the mail database to the new zipcode value. I have figured out the code for pl/sql, but I don't know how to go about putting it in sqlj. Here is what I have so far:


    ACCEPT oldZip PROMPT 'Enter old zipcode: '
    ACCEPT newZip PROMPT 'Enter new zipcode: '

    declare

    aCity ZIPCODES.CITY%TYPE;

    begin
    select CITY into aCity from ZIPCODES where ZIP = &oldZip;

    insert into ZIPCODES values(&newZip, aCity);

    update CUSTOMERS set ZIP = &newZip
    where ZIP = &oldZip;
    update EMPLOYEES set ZIP = &newZip
    where ZIP = &oldZip;

    delete from ZIPCODES where ZIP = &oldZip;
    end;
    /

  2. #2
    Join Date
    Jul 2003
    Posts
    2

    Re: sqlj help

    You must take CSC452 coure, right? I got the same problem

  3. #3
    Join Date
    Jul 2003
    Posts
    10
    yes. what all are you having problems with? how is everything coming with you?

  4. #4
    Join Date
    Jul 2003
    Posts
    2
    Hi,
    So bad, I did not actually finish any question of these three. I did part of Q1
    && Q3. How about you.

  5. #5
    Join Date
    Jul 2003
    Posts
    10
    I'm having sooo much trouble with this. For me, pl/sql is not really a problem, but the sqlj is. What did you come up with num1 and num3?

    Originally posted by Xenia1129
    Hi,
    So bad, I did not actually finish any question of these three. I did part of Q1
    && Q3. How about you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •