How can I exit my UNIX script when my PLSQL script in it calls an error?

hello.
I hope someone can help with my error handling and exiting-in-the-right-place problem.
I have several PLSQL scripts that are called from a UNIX script to insert/update employee records in ORACLE Financials.
At the end of the UNIX script, depending on whether an entry has been created in the errors table should depend on whether the UNIX script stops or not. Trouble is, its stopping too early everytime even though the the record has been inserted correctly. Please can someone either advise on what I'm doing wrong or suggest an alternative..
This the end of the PLSQL script that inserts the entry into errors table if theres an error..
WHEN OTHERS    THEN       ROLLBACK;
      err_msg := SUBSTR (SQLERRM, 1, 350);
      insert into kpmg_error_check (concurrent_id,module,narrative,status,creation_date,created_by)
                            values(0,'TEMPLOYEE_DTLS.sql',err_msg,'ERROR',SYSDATE,'Feldman');
     commit; This is the end of the UNIX script that looks at the table..
echo " "
echo "**** `date +%H:%M:%S` - Checking if TEMPLOYEE_DTLS.sql ran OK"
error_check=`sqlplus -s $user_id @$SU_TOP/sql/SUTEMPCHK.sql 1`
if `echo $error_check` -ge 1
then
# Load failed
echo " "
echo "**** `date +%H:%M:%S` - TEMPLOYEE_DTLS has failed - check table KPMG_ERROR_CHECK for details.."
exit 1
else
# Load finished OK, if input data file exists, move and rename it
echo " "
echo "**** `date +%H:%M:%S` - TEMPLOYEE_DTLS has finished OK.."
fiThis is the entire SUTEMPCHK.sql script that the UNIX script uses..
-- Check if any errors have occurred
SELECT count(1) FROM kpmg_error_check WHERE concurrent_id = &1
EXITIs it that the above is always returning '1' and so always thinks theres an entry in the errors table?
Is there an easier way?
many thanks,
Steven

Hi,
You have to iterate through all pages.marginPreferences:
var
  myDocument = app.activeDocument,
  allPagesMaPref = myDocument.pages.everyItem().marginPreferences,
  curPageMaPref;
while ( curPageMaPref = allPagesMaPref.pop() )
  with (curPageMaPref) {
  columnCount = 1;
  //columnGutter can be a number or a measurement string.
  columnGutter = "0";
  bottom = "0"
  //When document.documentPreferences.facingPages == true,
  //"left" means inside; "right" means outside.
  left = "40"
  right = "0"
  top = "0"
  inside = "0"
Jarek

Similar Messages

  • How can you make it so that when a person from a company calls me it shows their name and company on the screen

    I use my iPhone for work as well as personal. However for work, I have noticed that when someone rings me, for instance Bob Mansfield from Com tec, the phone screen states just 'Bob' and no other details. I have the best part of 6 Bob's in my contacts all with different surnames and company's. Is there a way that I can get my phone to show more info on the person calling. For instance, surname and company if applicable? Any help would be much appreciated.

    See deggie's response in this post... https://discussions.apple.com/message/8531821#8531821

  • How can I populate a date field when document is signed?

    I have 4 digital signature fields in a PDF form.  Next to each signature field is a date field (m/d/yyyy format).  I would like it so when the user signs the signature box that the date field next to it populates with todays date, then changes to read only (so it cannot be altered).
    In Adobe Acrobat Pro 9 I have this form and it has the following fields
    Signature1
    Signature2
    Signature3
    Signature4
    DateField1
    DateField2
    DateField3
    DateField4
    The Signature fields trigger a Topaz.GemSignPlus driver where the end user will be signing on an electronic signature pad.
    How can I use Javascript to detect when one of those Signature fields is populated and then fill in the date to the approrpiate date field?  I tried creating boolean variables initialized as false for each sig field.  Then when the signature is done I try to change it to true, but for whatever reason my javascript detecting the value doesn't do anything.
    I've searched the net endlessly for this solution.  I can't believe I'm having such a hard time finding an answer.  I mean how many places do you go where they ask you to "Sign and date here".  Every signature based document I've ever seen also requires a date.
    Anyway here's what I have.  In Document JavaScript functions I have a script name called populate date:
    function populatedate()
    var bSignature1 = new Boolean();
    var bSignature2 = new Boolean();
    var bSignature3 = new Boolean();
    var bSignature4 = new Boolean();
    if (bSignature1) {
        DateField1.value = util.printd ("m/d/yyyy", new Date());
    if (bSignature2) {
        DateField2.value = util.printd ("m/d/yyyy", new Date());
    if (bSignature3) {
        DateField3.value = util.printd ("m/d/yyyy", new Date());
    if (bSignature4) {
        DateField4.value = util.printd ("m/d/yyyy", new Date());
    In each signature field I have under the Signed tab "This script executes when field is signed:
    var bSignature1 = new Boolean(true);
    I'm trying to change it to true see.  My thinking is if its true than DateField1.value should print the m/d/yyyy in it from the built in Date() function.
    But maybe I am not getting this context correct.  I am new to Javascript in Adobe.

    It's quite a round-about script... Why not simply use the signature signing script to set the value of the date field? The correct syntax for that is:
    this.getField("DateField1").value = util.printd ("m/d/yyyy", new Date());

  • How can I turn off my computer when I push de STOP button from de program?

    How can I turn off my computer when I push de STOP button from de program?

    You might also want to have a look at the old winutil>Windows API Function Utilities (32-bit) for LabVIEW. While they are written in LabVIEW 4.0 (!), they still seem to work fine under W2000 and LabVIEW 7.0. In particular, have a look at "exit windows.vi" inside "winevent.llb" of the above link. It calls the function "ExitWindowsEx" of user32.dll. Since this is part of the OS, you don't need to include extra DLLs.
    (All the above assumes Windows OS. I don't know how to shutdown the OS on e.g. MAC or linux.)
    LabVIEW Champion . Do more with less code and in less time .

  • How can i hide my extension number when i make outgoing calls

    Hi All,
    How can i hide my extension number when i make outgoing calls,what configuration should i make on the call manager server.
    Regards,
    Lester

    We use a Route Pattern that mimics the telco feature *67. The RP is *679.xxxxxxx with a Transformation mask of 000000000 (just to get beyond the individual blocking on some private lines.

  • How can I delete my Icloud account when I don't know the password and no longer have the email address associated with it?

    How can I delete my Icloud account when I don't know the password and no longer have the email address associated with it?
    You need your password to delete it and I need the email address to reset the password.  I feel like I'm going in circles!!!  Please help!!!

    Go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address (you shouldn't need to verify the old account).  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • How can I improve quality of image when burning a movie to a DVD

    How can I improve quality of image when burning a movie to a DVD?

    What resolution are you using?  If the DVD is to be playable on an ordinary DVD player, only ordinary TV resolution is supported.  You need Blue ray for HD.
    Geoff.

  • HT1414 how can i open my iphone because when i try to restore it from my back up all the files it didn't open anymore & always my iphone have a problem that it automatically shut down then the itunes logo appear then i need it to connect to itunes then re

    how can i open my iphone because when i try to restore it from my back up all the files it didn't open anymore & always my iphone have a problem that it automatically shut down then the itunes logo appear then i need it to connect to itunes then restore to enable to open it..what should i do?i cannot bring it to the smart center because i lost my receipt..is there any chance to recover it?thank you so much..i already update my operating system to ios 6.1.3 but when i recover my  back up the operating system was ios 6.1.2..

    Your phone is in recovery mode. Did you plug it to the computer running itunes? What happend?

  • I disabled my Macbook  Hard Disk and lock the settings, after i try to reboot, the system wouldn't come up. It refuses to read instructions from the hard disk. How can i enable the hard disk when the system wouldn't come up?

    I disabled my Macbook  Hard Disk and lock the settings, after i try to reboot, the system wouldn't come up. It refuses to read instructions from the hard disk. How can i enable the hard disk when the system wouldn't come up?

    How do you disabled it if running the same?

  • When I am connected to my home wifi, it says I am connected but the 4G icon doesn't go away.  How can I make that go away when I am connected?

    When I am connected to my home wifi, it says I am connected but the 4G icon doesn't go away.  How can I make that go away when I am connected?

    When I'm at my home, and on my Wifi, my 4G icon on my LG G2 is still present. No big deal. If the bits can flow via WiFi, that's what they'll do.
    You might try (if you really MUST shut off the cellular radio):
    Settings, Network Connections and More networks. Select Mobile Networks and uncheck Mobile data and data roaming.
    Not sure if that will work - but give it a try.

  • How can I rotate a PDF document when viewing in adobe reader?

    How can I rotate a PDF document when iewing in adobe reader?

    That hardware button can actually be toggled to work either as a mute button, or a lock orientation button. This can be edited at the settings screen.

  • How can I make it so that when Safari opens it takes me to the homepage?

    Say I am on youtube and I quit safari, when I reopen safari later, it goes to the page last open, in this case, youtube. How can I make it so that when Safari opens it always takes me to the homepage?

    Click on the red button (top left) to close the window before quitting.

  • How can I see all photo miniatures when I open a photo album or an event in iphoto?

    How can I see all photo miniatures when I open a photo album or an event in iphoto?

    Note the zoom slider at the bottom of th iPhoto Window - drag it left.

  • I have an Iphone 4S, when I am on the phone and I get a new message my phone vibrates and rings. How can I stop this from happening when I am on the phone

    I have an Iphone $S, when I am on the phone and I get a new message my phone vibrates and rings, How can I stop this from happneing when I am on the phone

    Flip the Ring/Silent switch. Make sure Vibrate when silent is off in Settings>Sound.

Maybe you are looking for