• Prime Mover (unregistered)
    v_line := 'frist ';
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    utl_file.put_line(write_file, v_line);
    
  • Event Horizon (unregistered)

    It looks like they’ve finally reached that distant tipping point where hiring a real programmer is cheaper than paying for all the disk space from the cut-and-pastes...

    BTW missing a string concat operator before field4 ABTW I still don’t really get why one would need so much vertical space... please don’t tell me it’s for page breaks!!

  • witchdoctor (unregistered)

    Boss: "Do it in PL/SQL"

    Dev: "But I've never written anything in PL/SQL. Does that even have loops?"

    Boss: "Sure it does, just google things, you'll be fine. Oh, by the way, I need that before 5 today."

    Narrator: "Dev was in fact not fine"

  • (nodebb)

    He's reusing the variable. That's very environmentally conscious.

  • my name is missing (unregistered)

    Knowing Oracle, if you use a new variable, it will cost you more money.

  • (nodebb) in reply to my name is missing

    Are you implying that variable reuse was dictated more by self serving financial greed (or more accurately frugality), than being concerned with ecology?

  • NoLand (unregistered)

    I still don’t really get why one would need so much vertical space... please don’t tell me it’s for page breaks!!

    It's for warming up the tractor feed…

  • COB (unregistered) in reply to my name is missing

    OK, that made me laugh out loud

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    I'm sure it would be much easier to debug if "utl_file.put_line(write_file, v_line);" was put into a function named "put_line".

    I suppose if you wanted to get fancy you could give it a parameter for the number of times to print the line. It would probably look something like this (pardon my lack of this Black Speech of languages):

    utl_file.put_line(write_file, v_line);
    if (n > 1) utl_file.put_line(write_file, v_line);
    if (n > 2) utl_file.put_line(write_file, v_line);
    if (n > 3) utl_file.put_line(write_file, v_line);
    if (n > 4) utl_file.put_line(write_file, v_line);
    if (n > 5) utl_file.put_line(write_file, v_line);
    if (n > 6) utl_file.put_line(write_file, v_line);
    ...
    
  • Jim Bednarek (unregistered)

    Oracle is the worst.

    Used to think that - then was exposed to db2

  • (nodebb)

    "Now, PL/SQL is a… special language. The procedural elements it adds to SQL have a distinctly "we want to sell this to mainframe programmers" vibe, which makes the syntax verbose and clumsy."

    Hardly. You kids these days with all your new-fangled object oriented and - god forbid - functional languages, you wouldn't recognize an imperative language if it was labelled in giant neon letters "Imperative language". PL/SQL is just a member of the Algol/Pascal/Modula2/Ada family. The syntax is very much like Pascal. It is a bit more verbose than C-style languages, true, but hardly clumsy.

    "It frequently creates situations where things which should be easy are incredibly hard, "

    Then you're doing it wrong.

    "and things which should be hard are impossible."

    Then you're doing it very wrong.

    "But it's technically a feature-rich language, and you can even write web servers in it, if you want."

    Then you're doing it horriffyingly wrong.

  • VI (unregistered)

    At this point, I'm convinced that "stored procedures" was only invented to induce vendor lock-in.

  • OPBoot (unregistered) in reply to Jim Bednarek

    Oh - you had to go there....

    Now imagine that the company who sell that DB are trying to get it work with $MY_PRODUCT and you have to point them to their own documentation for that DB to tell them why what they're trying to do won't work.

    And now you have to get on a call with their dbas to explain it....

  • markm (unregistered)

    What happens when the length of the file changes? I hope there isn't a switch statement on the number of lines, followed by cases with 1, 2, 3, ... copies of:

      utl_file.put_line(write_file, v_line);
    

    because I dunno LOL's suggestion would be too difficult for this "programmer".

Leave a comment on “Putting the File Out”

Log In or post as a guest

Replying to comment #:

« Return to Article