Toad World® Forums

PL/SQL Programming eBook for free - and legal!

Hi Wendy,

There are PDFs part 1 and 2. Only part 1 has an index–which covers also
what is in the part 2 pdf. But you have to open the part 2 pdf
separately and it has no index…which makes things hard to find… Any
way to combine them?

I haven’t tried this yet, but maybe http://www.pdfsam.org/ will be useful?


Cheers,
Norm. [TeamT]

Hi all,

Get pdftk.exe from www.pdftk.com and run (from the command line)

pdftk oracle-pl-sql-programming-5th-edition_part_1.pdf
oracle-pl-sql-programming-5th-edition_part_2.pdf cat output
oracle-pl-sql-programming-5th-edition.pdf

Nothing to it!

Fred

Hey Norm/Wendy,

There are PDFs part 1 and 2. Only part 1 has an index–which covers also
what is in the part 2 pdf. But you have to open the part 2 pdf
separately and it has no index…which makes things hard to find… Any
way to combine them?

I haven’t tried this yet, but maybe http://www.pdfsam.org/ will be useful?

I tried it yesterday. While it did combine the two parts for convenience,
the Table of Contents links on Part 1 are just hosed. Starting with “Part
IV”, the TOC links don’t work, even those pointing to pages in the Part I of
the ebook.

Good thing most PDF readers have handy navigation and search functions.

Rich – [TeamT]

Disclaimer: Well, at least half of the NFC North is decent.

Hi Rich/Wendy,

I tried it yesterday. While it did combine the two parts for convenience,
the Table of Contents links on Part 1 are just hosed. Starting with “Part
IV”, the TOC links don’t work, even those pointing to pages in the Part I of
the ebook.
As far as I’m aware this is how the book comes from O’Reilly. I have a
few PDFs where the TOC doesn’t work at all. Most irritating!

:frowning:


Cheers,
Norm. [TeamT]

I have a single-file PDF from O’Reilly (courtesy of Steven’s PL/SQL Challenge)

The TOC works correctly in that file. It’s just something in the split

Norman Dunbar
Sent by: toad@yahoogroups.com

2011/10/11 09:56

Please respond to
toad@yahoogroups.com

To

toad@yahoogroups.com

cc

Subject

Re: [toad] PL/SQL Programming eBook – is there a way to combine PDFs part 1 and
part 2?

Hi Rich/Wendy,

I tried it yesterday. While it did combine the two parts for convenience,
the Table of Contents links on Part 1 are just hosed. Starting with “Part
IV”, the TOC links don’t work, even those pointing to pages in the Part I of
the ebook.
As far as I’m aware this is how the book comes from O’Reilly. I have a
few PDFs where the TOC doesn’t work at all. Most irritating!

:frowning:


Cheers,
Norm. [TeamT]

This book was already as one file in my possession before this action (PL/SQL
challange). And there the TOC does work. So it is this specific case which leads
to problems. Maybe we must contact the website (what was it again?) and ask for
a correct PDF file?

Found the original link:

http://www.red-gate.com/products/oracle-development/entrypage/oracle-pl-sql-programming

Groetjes,
Wim

2011/10/11 Norman Dunbar

Hi Rich/Wendy,

I tried it yesterday. While it did combine the two parts for convenience,
the Table of Contents links on Part 1 are just hosed. Starting with “Part
IV”, the TOC links don’t work, even those pointing to pages in
the Part I of
the ebook.

As far as I’m aware this is how the book comes from O’Reilly. I have
a
few PDFs where the TOC doesn’t work at all. Most irritating!

:-(


Cheers,
Norm. [TeamT]

Hi Fred,

Get pdftk.exe from www.pdftk.com and run (from the command line)
Or already have it installed under Linux. :wink:

pdftk oracle-pl-sql-programming-5th-edition_part_1.pdf
oracle-pl-sql-programming-5th-edition_part_2.pdf cat output
oracle-pl-sql-programming-5th-edition.pdf
This works in that it merges two pdf files into one, however, it also does the following:

  • Removes the ability to select the TOC in the document reader in the navigation panel. Where before I could click on the TOC shortcut, and get a TOC that was separate from the document’s own TOC, this no longer works.

  • Leaves the document’s own TOC still unworkable from Part IV onwards. Up to that point, the TOC acts like a TOC and allows hyperlinks to be followed. From Part IV on, they don’t work.

Still, we tried!

Cheers,
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk

Thanks all! I did combine the pdfs…which is an improvement, but none of the
links work :frowning: I did submit an issue to redgate…a lot of nerve complaining
about something that’s free… Great book though!..worth the pain. Wendy

On 10/11/2011 11:01 AM, Dunbar, Norman (Capgemini) wrote:

Hi Fred,

>> Get pdftk.exe from www.pdftk.com and run (from the command line)
Or already have it installed under Linux. ;-)

>> pdftk oracle-pl-sql-programming-5th-edition_part_1.pdf
>> oracle-pl-sql-programming-5th-edition_part_2.pdf cat output
>> oracle-pl-sql-programming-5th-edition.pdf
This works in that it merges two pdf files into one, however, it also does
the following:

* Removes the ability to select the TOC in the document reader in the
navigation panel. Where before I could click on the TOC shortcut, and get a
TOC that was separate from the document's own TOC, this no longer works.

* Leaves the document's own TOC still unworkable from Part IV onwards. Up to
that point, the TOC acts like a TOC and allows hyperlinks to be followed.
From Part IV on, they don't work.

Still, we tried!

Cheers,
Norm. [TeamT]

Information in this message may be confidential and may be legally
privileged. If you have received this message by mistake, please notify the
sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should
still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to
under the Freedom of Information Act, Data Protection Act or for litigation.
Email messages and attachments sent to or from any Environment Agency
address may also be accessed by someone other than the sender or recipient,
for business purposes.

If we have sent you information and you wish to use it please read our terms
and conditions which you can get by calling us on 08708 506 506. Find out
more about the Environment Agency at www.environment-agency.gov.uk

I did submit an issue to redgate…a lot of

nerve complaining about something that’s free…

Well… I guess that depends on who the developers are. Some developers
don’t like bug reports while others recognize that without bug reports
they can’t really produce a product they can be proud of.

Of course… the most useful bug report is filled with details on how to
reproduce the issue and a potential suggestion on how it could work better.

The least useful is a generic rant that doesn’t identify a single detailed
issue :wink:

Roger S.

Hey Wendy,

Thanks all! I did combine the pdfs…which is an improvement, but none
of the links work :frowning: I did submit an issue to redgate…a lot of
nerve complaining about something that’s free… Great book
though!..worth the pain. Wendy

It’d be nice if the links were fixed, but their very generous offer is
hard to bargain with!

Still, I downloaded the 14-day trial of NitroPDF Pro and recreated all of
the bookmarks in the combined PDF (nice tool that might be worth
purchasing). It’s something anyway. FWIW, the links that work point to
page numbers; the ones that don’t point to named anchors (which I couldn’t
easily find a way to edit).

OK, Gigs of Oracle downloads are done, so it’s back to real work…

Rich – [TeamT]

Disclaimer: GO WINSCONSIN! (except for the Bucks apparently)

I need to write a generic SQL query to parse a comma delimited string from right
to left and return the first non-null value.

Example:

  1. ,Database,10g,Oracle,

  2. ,10g,Oracle,

  3. ,Data,Menu,Oracle,

For all the above examples, the output should be “Oracle”

Appreciate the help.

Thanks,

Vikram

Substr combined with instr would do the job.

Roger S.

Just as an added note – and this probably goes without saying - you
probably want to do a check to see if the value you are searching for exists
first, if it does then do the task otherwise set some default value.

A substr starting at a position of 0 will give you the entire string.

Roger S.

Appreciate if you cna elaborate.

The query should be dynamic. I can’t specify the position of the “delimiter”
since this could vary from string to string.

Appreciate if you cna elaborate.

Instr
value, using a negative starting position indicates a reverse “look up”

So…

In the string “hello world, hello world, hello world”, entering:

Select instr(txt, ‘hello world’) from dual

Will respond with: 1

Select instr(txt, ‘hello world’, -1) from dual

Will respond with: 27

Using substr from the position returned you can structure exactly what you want
extracted.

Roger S.

Will respond with: 27

I shouldn’t have to clarify, but just in case: by “third”, I really meant
“last”. In the example, the third happened to be the last.

Roger S.

I am sorry if I wasn’t very clear and precise.

The keyword in the example I gave i.e. Oracle can change and can be any string.

For example the column will contain values

  1. ,Database,10g,Oracle10,

  2. ,10g,Oracle20,

  3. ,Data,Menu,OracleAA,

The output column should contain:

Oracle10

Oracle20

OracleAA

Roger’s principle still applies. The following variation of his SQL shows the last character of the last non null string:-

SELECT INSTR (’,Database,10g,Oracle,’,
SUBSTR (REPLACE (’,Database,10g,Oracle,’, ‘,’, NULL), -1),
-1)
FROM DUAL;

He is correct. You can use what he has shown, with SUBSTR and INSTR to do what you want.

Regards,

Mike McAllister
Principal Systems Engineer
Decypher
DSN: 487-3751
Commercial: (210) 652-3751
Cell: (512) 423-7447
Email: michael.mcallister.2.ctr.au@us.af.mil
smime.p7s (5.59 KB)

Perfect application of regular expressions.

with i as (

select ‘,Database,10g,Oracle10,’ i from dual union all

select ‘,10g,Oracle20,’ i from dual union all

select ‘,Data,Menu,OracleAA,’ i from dual )

select regexp_substr( ‘,’ || i . i || ‘,’ , ‘.,([^,]+),’ , 1 , 1 ,null, 1
) result

, i . i

from i ;

RESULT I

Oracle10 ,Database,10g,Oracle10,

Oracle20 ,10g,Oracle20,

OracleAA ,Data,Menu,OracleAA,

– oops – I used the “subexpr” parameter of regexp_substr, which is new
with Oracle 11g. But maybe you can get (more) creative and find a way that works
in 10g?

Nate Schroeder

Enterprise Services - Data Management Team

Monsanto Company

800 N. Lindbergh Blvd. LC4D - Saint Louis, MO - 63167

314-694-2592

This should work in Oracle 10:

regexp_substr(regexp_substr( ‘,’ || i . i || ‘,’ , ‘[^,].*[^,]’ ), ‘[^,]+$’
) result

The inner regexp_substr says: I want the (longest possible, which is implied)
string that starts with a non-comma and ends with a non-comma. This strips the
leading and trailing commas if any.

The outer regexp_substr takes the result of that and says: I want the (longest
possible) string that contains no commas and ends at the end of the string.

Nate Schroeder

Enterprise Services - Data Management Team

Monsanto Company

800 N. Lindbergh Blvd. LC4D - Saint Louis, MO - 63167

314-694-2592