100% found this document useful (5 votes)
106 views

SQL functions programmer s reference 1st Edition Arie Jones All Chapters Instant Download

reference

Uploaded by

rovanshrity
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
106 views

SQL functions programmer s reference 1st Edition Arie Jones All Chapters Instant Download

reference

Uploaded by

rovanshrity
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Download Full ebookname - Read Now at ebookname.

com

SQL functions programmer s reference 1st Edition


Arie Jones

https://ebookname.com/product/sql-functions-programmer-s-
reference-1st-edition-arie-jones/

OR CLICK BUTTON

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Access 2010 Programmer s Reference Teresa Hennig

https://ebookname.com/product/access-2010-programmer-s-reference-
teresa-hennig/

ebookname.com

Visual Basic 2012 Programmer s Reference 1st Edition Rod


Stephens

https://ebookname.com/product/visual-basic-2012-programmer-s-
reference-1st-edition-rod-stephens/

ebookname.com

C 2005 Programmer s Reference 1st Edition Adrian Kingsley-


Hughes

https://ebookname.com/product/c-2005-programmer-s-reference-1st-
edition-adrian-kingsley-hughes/

ebookname.com

Student Centered Coaching A Guide for K 8 Coaches and


Principals 1st Edition Diane Sweeney

https://ebookname.com/product/student-centered-coaching-a-guide-
for-k-8-coaches-and-principals-1st-edition-diane-sweeney/

ebookname.com
Communicate science papers presentations and posters
effectively papers posters and presentations 1st Edition
Boffito
https://ebookname.com/product/communicate-science-papers-
presentations-and-posters-effectively-papers-posters-and-
presentations-1st-edition-boffito/
ebookname.com

Cytochrome P450 Role in the Metabolism and Toxicity of


Drugs and other Xenobiotics Issues in Toxicology 1st
Edition Costas Ioannides
https://ebookname.com/product/cytochrome-p450-role-in-the-metabolism-
and-toxicity-of-drugs-and-other-xenobiotics-issues-in-toxicology-1st-
edition-costas-ioannides/
ebookname.com

Handbook of Clinical Drug Data 10th Edition Philip


Anderson

https://ebookname.com/product/handbook-of-clinical-drug-data-10th-
edition-philip-anderson/

ebookname.com

Culture Wars in America An Encyclopedia of Issues


Viewpoints and Voices 2nd Edition Roger Chapman

https://ebookname.com/product/culture-wars-in-america-an-encyclopedia-
of-issues-viewpoints-and-voices-2nd-edition-roger-chapman/

ebookname.com

Illuminate An Advent Experience 1st Edition Paul Sheneman

https://ebookname.com/product/illuminate-an-advent-experience-1st-
edition-paul-sheneman/

ebookname.com
Nonconventional and Vernacular Construction Materials
Characterisation Properties and Applications 1st Edition
Kent A Harries
https://ebookname.com/product/nonconventional-and-vernacular-
construction-materials-characterisation-properties-and-
applications-1st-edition-kent-a-harries/
ebookname.com
SQL Functions Programmer’s Reference
SQL Functions Programmer’s Reference

Arie Jones
Ryan K. Stephens
Ronald R. Plew
Robert F. Garrett
Alex Kriegel
SQL Functions Programmer’s Reference
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2005 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN 13 978-0-7645-6901-2
ISBN 10 0-7645-6901-5
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
1B/RU/QU/QV/IN

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic,
mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United
States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appro-
priate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint
Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permission.

LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS
OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND
SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PAR-
TICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE
ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD
WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR
OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PRO-
FESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAM-
AGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A
CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE
PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDA-
TIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY
HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.

For general information on our other products and services or to obtain technical support, please contact our Customer Care
Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.

For technical support, please visit www.wiley.com/techsupport.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in elec-
tronic books.

Library of Congress Cataloging-in-Publication Data:


SQL functions programmer’s reference / Arie Jones ... [et al.].
p. cm.
Includes bibliographical references and index.
ISBN 0-7645-6901-5 (paper/website : alk. paper)
1. SQL (Computer program language) I. Jones, Arie.
QA76.73.S67S674 2005
005.13’3--dc22
2005002765

Trademarks: Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trade-
marks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may
not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is
not associated with any product or vendor mentioned in this book.
About the Authors

Arie Jones
Arie Jones is a senior database administrator for Perpetual Technologies, Inc. (www.perptech.com). He holds
a master’s degree in physics from Indiana State University and also works as the chief Web architect/DBA
for the USPFO for Indiana. Arie’s main specialty is in developing .NET-based database solutions for the gov-
ernment. He and his wife and family live outside of Indianapolis, Indiana.

Ryan K. Stephens
Ryan Stephens is the president and CEO of Perpetual Technologies, Inc. (www.perptech.com), an Indianapolis-
based IT firm specializing in database technologies. Ryan has been working with SQL and databases for 15
years and has held the positions of project manager, database administrator, and programmer/analyst. Ryan
has been teaching database courses for local universities since 1997 and has authored several internationally
published books on topics such as database design, SQL, database architecture, database administration, and
Oracle. Ryan enjoys discovering new ways to optimize the use of technology to streamline business operations,
as well as empowering others to do the same. Ryan and his wife live in Indianapolis with their three children.

Ronald R. Plew
Ronald R. Plew is vice president and CIO for Perpetual Technologies, Inc. (www.perptech.com) in
Indianapolis, Indiana. Ron is a Certified Oracle Professional. He has coauthored several internationally
published books on SQL and database technology. Ron is also an adjunct professor for Vincennes
University in Indiana, where he teaches SQL and various database courses. Ron holds a bachelor of
science degree in business administration/management from Indiana Institute of Technology out of Fort
Wayne, Indiana. Ron recently retired from the Indiana Army National Guard, where he served as a
programmer/analyst. His hobbies include automobile racing, chess, golf, and collecting Indy 500
memorabilia. Ron resides in Indianapolis with his wife Linda.

Robert F. Garrett
Bob Garrett is the software development manager at Perpetual Technologies, Inc. (www.perptech.com).
Bob’s languages of preference are Java, C++, and English. He has extensive experience integrating appli-
cations with relational databases. Bob has a degree in computer science and mathematics from Purdue
University, and lives with his wife and daughter near Indianapolis.

Alex Kriegel
Alex Kriegel is a professional database systems analyst with a major manufacturing firm in Oregon. He
has more than 10 years of database experience working with Microsoft SQL Server, Oracle, DB2, Sybase,
and PostgreSQL both as developer and DBA. Alex has a bachelor of science degree in solid-state physics
from State Polytechnic Institute of Minsk, Belarus, and has earned the Microsoft Certified Solution
Developer (MCSD) accreditation. He is the author of SQL Bible. Alex wrote the first draft of approxi-
mately two-thirds of this book.
Contributing Authors
Joshua Stephens
Joshua Stephens is a systems administrator/DBA for Perpetual Technologies, Inc. (www.perptech.com).
He has eight years of experience in various IT areas. As a former technical writer and trainer, he contin-
ues to enjoy helping others through writing. He holds a bachelor of arts degree in pure mathematics and
physics from Franklin College. He lives in Franklin, Indiana, with his wife and daughter.

Richard Bulley
Richard is a Ferris State University graduate and received a master of arts degree from Ball State
University. He has had 20 years of data processing experience with the United States Air Force and is a
United States Air Force Reserves Retiree and currently has over six years of experience as a Sybase and
MS SQL Server system DBA.
Credits
Acquisitions Editor Vice President & Executive Group Publisher
Jim Minatel Richard Swadley

Development Editor Vice President and Publisher


Kevin Shafer Joseph B. Wikert

Production Editor Project Coordinator


Gabrielle Nabi Ryan Steffen

Technical Editor Graphics and Production Specialists


Wiley-Dreamtech India Pvt Ltd April Farling, Carrie Foster, Denny Hager,
Julie Trippetti
Copy Editor
Publication Services, Inc. Quality Control Technicians
Joe Niesen
Editorial Manager John Greenough
Mary Beth Wakefield
Proofreading and Indexing
TECHBOOKS Production Services
I would like to dedicate this book to my wife, Jacqueline, for being understanding and supportive during
the long hours that it took to complete this book.

— Arie Jones

For Tina, Daniel, Autumn, and Alivia. You are my inspiration.

— Ryan Stephens

For Linda

— Ron Plew

For Becky and Libby

— Bob Garrett
Acknowledgments

Shortly after we accepted this project, it became clear how much of a team effort would be needed to
make this book a must-have for anyone’s SQL library. Fortunately, I have an incredible technical team
that knows how to come together and get the job done. Most of my thanks go to Arie Jones. Arie stepped
up when I needed the most help, unafraid of commitment, confidently accepting another aggressive
assignment. Our author team included Arie Jones, Ron Plew, Bob Garrett, Alex Kriegel, and myself.
Contributing authors were Joshua Stephens and Richard Bulley. I cannot say enough about their profes-
sionalism and technical proficiency. Thank you for being part of another successful project!

Probably as no surprise to the Wiley audience, the author team thanks the editorial staff at Wiley, which
is one of the best with whom we have had the pleasure of working. Specifically, we appreciate Jim
Minatel’s efforts and confidence in our team, Kevin Shafer’s strict attention to detail, and the technical
editorial team’s thoroughness. Their dedication, patience, and thoroughness, we believe, reflect directly
on the quality and timely delivery of this book, which would not have been possible without each of
them, as well as the unmentioned Wiley staff behind the scenes.

— Ryan Stephens and the author team


Contents

Acknowledgments ix
Introduction xxxv

Chapter 1: Exploring Popular SQL Implementations 1


Introduction to SQL 1
Understanding the SQL Standard 2
Overview of Vendor Implementations of SQL 2
Oracle 3
IBM DB2 UDB 3
Microsoft SQL Server and Sybase 3
MySQL 3
PostgreSQL 4
Connecting to SQL Databases 4
ANSI SQL Data Types 5
Creating SQL Databases 5
Querying SQL Databases 7
Manipulating Data in SQL Databases 9
Summary 11

Chapter 2: Functions: Concept and Architecture 13


What Is a Function? 13
Simple UNIX Shell Function Example 14
Simple SQL Function Example 15
ANSI SQL Functions 15
Built-in Functions 16
Executing Built-in Functions 17
Practical Uses of Functions 17
Creating, Compiling, and Executing a SQL Function 18
Passing Parameters by Value or by Reference 22
Scope of a Function 24
Better Security 25
Overloading 25
Classifying SQL Functions: Deterministic and Non-Deterministic Functions 27
Oracle 29
IBM DB2 UDB 29
Contents
Microsoft SQL Server 30
Sybase 31
MySQL and PostgreSQL 31
Summary 32

Chapter 3: Comparison of Built-in SQL Functions by Vendor 33


Types of Functions 33
Classifying Built-in SQL Functions 34
Oracle 35
IBM DB2 UDB 36
Microsoft SQL Server and Sybase ASE 37
MySQL 39
PostgreSQL 39
Overview of Built-in Functions by Vendor 40
Summary 48

Chapter 4: SQL Procedural Extensions and User-Defined Functions 49


Procedural versus Declarative Languages 49
ANSI SQL Guidance for Procedural Extensions to SQL 51
SQL Procedural Extensions by Vendor 52
Oracle PL/SQL 52
Microsoft or Sybase Transact-SQL 54
IBM Procedural SQL 55
MySQL 57
PostgreSQL 57
Summary 58

Chapter 5: Common ANSI SQL Functions 59


ANSI Query Syntax 60
Aggregate Functions 60
AVG() 62
COUNT() 63
MAX() and MIN() 64
SUM() 65
String Functions 65
ASCII() 66
CHR() or CHAR() 67
CONCAT() 67
LOWER() and UPPER() 68
LENGTH() or LEN() 68
REPLACE() 69
xii
Contents
Mathematical Functions 69
ABS() 72
ACOS() 73
ASIN() 73
ATAN() and ATAN2() 74
CEIL() or CEILING() and FLOOR() 74
COS() 75
COSH() 75
COT() 75
DEGREES() and RADIANS() 76
EXP() 76
LOG(), LN(), LOG2(), and LOG10() 77
MOD() 77
PI() 79
POWER() 79
RAND() 80
ROUND() 80
SIGN() 81
SINH() 82
SQUARE() 82
SQRT() 83
TAN() 83
TANH() 83
TRUNC() or TRUNCATE() 84
Miscellaneous Functions 85
COALESCE() 85
NULLIF() 85
Summary 86

Chapter 6: Oracle SQL Functions 87


Oracle Query Syntax 87
Aggregate Functions 90
AVG() 91
CORR() 92
COUNT() 93
GROUPING() 94
MAX() and MIN() 95
STDDEV() 95
SUM() 96
Analytic Functions 97

xiii
Contents
Character Functions 97
CHR() and NCHR() 99
INITCAP() 100
LPAD() and RPAD() 101
TRIM(), LTRIM(), and RTRIM() 102
REPLACE() 103
SOUNDEX() 103
SUBSTR() 104
TRANSLATE() 105
Regular Expressions 106
Conversion Functions 106
CAST() 107
COMPOSE() 108
CONVERT() 108
DECOMPOSE() 110
TO_CHAR() 110
TRANSLATE...USING 113
UNISTR() 113
Date and Time Functions 114
ADD_MONTHS() 115
DBTIMEZONE and SESSIONTIMEZONE 116
EXTRACT() 117
MONTH_BETWEEN() 118
NEW_TIME() 118
ROUND() 119
SYSDATE 120
TRUNC() 121
Numeric Functions 123
ABS() 123
BITAND() 124
CEIL() and FLOOR() 124
MOD() 125
SIGN() 125
ROUND() 126
TRUNC() 127
Object Reference Functions 127
Miscellaneous Single-Row Functions 127
COALESCE() 128
DECODE() 129
DUMP() 130
GREATEST() 131
NULLIF() 132
NVL() 133

xiv
Contents
NVL2() 133
UID 134
VSIZE() 134
Summary 135

Chapter 7: IBM DB2 Universal Database (UDB) SQL Functions 137


DB2 UDB Query Syntax 138
String Functions 140
CONCAT() 142
INSERT() 142
LEFT() and RIGHT() 143
LENGTH() 143
LOCATE() and POSSTR() 144
LTRIM() and RTRIM() 144
REPEAT() 145
REPLACE() 145
SOUNDEX() 146
SPACE() 146
SUBSTR() 147
TRUNC() or TRUNCATE() 147
Date and Time Functions 148
DATE() 150
DAY() 151
DAYNAME() 151
DAYOFWEEK() 152
DAYOFWEEK_ISO() 152
DAYOFYEAR() 153
DAYS() 153
HOUR() 153
JULIAN_DAY() 154
MICROSECOND() 155
MIDNIGHT_SECONDS() 155
MINUTE() 156
MONTH() 156
MONTHNAME() 157
SECOND() 157
TIME() 157
TIMESTAMP() 158
TIMESTAMPDIFF() 159
TIMESTAMP_FORMAT() 160
TIMESTAMP_ISO() 160
WEEK() 160

xv
Contents
WEEK_ISO() 161
YEAR() 161
Conversion Functions 162
DEC or DECIMAL 163
HEX() 164
DOUBLE or DOUBLE_PRECISION 164
INT() or INTEGER() and SMALLINT() 165
TRANSLATE() 165
VARCHAR() 166
Security Functions 167
DECRYPT_BIN() 167
DECRYPT_CHAR() 168
ENCRYPT() 168
GETHINT() 169
IBM DB2 UDB Special Registers 169
CURRENT DATE 170
CURRENT DEFAULT TRANSFORM GROUP 171
CURRENT DEGREE 171
CURRENT EXPLAIN MODE 171
CURRENT EXPLAIN SNAPSHOT 172
CURRENT ISOLATION 172
CURRENT NODE 173
CURRENT PATH 173
CURRENT QUERY OPTIMIZATION 174
CURRENT REFRESH AGE 174
CURRENT SCHEMA 174
CURRENT SERVER 175
CURRENT TIME 175
CURRENT TIMESTAMP 175
CURRENT TIMEZONE 176
SESSION_USER 176
USER 177
Miscellaneous Functions 177
COALESCE() and VALUE() 178
DIGITS() 179
GENERATE_UNIQUE() 179
NULLIF() 180
RAND() 180
TABLE_NAME() 181
TYPE_ID() 182
TYPE_NAME() 182
Summary 182

xvi
Contents

Chapter 8: Microsoft SQL Server Functions 183


SQL Server Query Syntax 183
String Functions 185
ASCII() 187
CHAR() 187
CHARINDEX() 188
DIFFERENCE() 188
LEFT() and RIGHT() 189
LEN() 189
LOWER() 190
LTRIM() and RTRIM() 190
NCHAR() 191
PATINDEX() 191
REPLACE() 192
QUOTENAME() 192
REPLICATE() 192
REVERSE() 193
SOUNDEX() 193
SPACE() 194
STR() 194
STUFF() 195
SUBSTRING() 196
UNICODE() 196
UPPER() 196
Date and Time Functions 197
DATEADD() 198
DATEDIFF() 199
@@DATEFIRST() 199
DATENAME() 200
DATEPART() 200
DAY() 201
GETDATE() and GETUTCDATE() 202
MONTH() 202
YEAR() 203
Metadata Functions 203
COL_LENGTH() 204
DB_ID() 205
DB_NAME() 205
FILE_ID() 206
FILE_NAME() 207

xvii
Contents
Configuration Functions 207
@@CONNECTION 207
@@LANGID 208
@@LANGUAGE 208
@@LOCK_TIMEOUT 210
@@MAX_CONNECTIONS 210
@@NESTLEVEL 211
@@OPTIONS 211
@@SPID 211
@@VERSION 212
Security Functions 212
HAS_DBACCESS() 213
SUSER_SID() 214
SUSER_SNAME() 214
USER 214
USER_ID() 215
USER_NAME() 215
System Functions 216
APP_NAME() 219
CASE 219
CAST() and CONVERT() 220
COALESCE() 224
CURRENT_TIMESTAMP 225
CURRENT_USER 225
DATALENGTH() 226
@@ERROR 226
HOST_ID() 227
HOST_NAME() 227
@@IDENTITY 228
IDENTITY() 228
ISDATE() 229
ISNULL() 229
ISNUMERIC() 230
NEWID() 230
PERMISSIONS() 231
ROWCOUNT_BIG and @@ROWCOUNT 231
@@TRANCOUNT 232
COLLATIONPROPERTY() 233
SCOPE_IDENTITY() 233
System Statistical Functions 234
@@CPU_BUSY 235
@@IDLE 235

xviii
Contents
@@IO_BUSY 236
@@TIMETICKS 236
@@TOTAL_ERRORS 236
@@TOTAL_READ 237
@@TOTAL_WRITE 237
fn_virtualfilestats() 238
Undocumented Functions 239
ENCRYPT() 240
FN_GET_SQL() 240
@@MICROSOFTVERSION 241
PWDCOMPARE() 241
PWDENCRYPT() 242
TSEQUAL() 242
Summary 243

Chapter 9: Sybase ASE SQL Built-In Functions 245


Sybase Query Syntax 246
String Functions 247
CHARINDEX() 249
CHAR_LENGTH() 250
COMPARE() 250
DIFFERENCE() 252
LTRIM() and RTRIM() 252
PATINDEX() 253
REPLICATE() 254
REVERSE() 254
RIGHT() and LEFT() 255
SORTKEY() 255
SOUNDEX() 257
SPACE() 257
STR() 257
STUFF() 258
SUBSTRING() 259
USCALAR() 259
Date and Time Functions 260
DATEADD() 261
DATEDIFF() 262
DATENAME() 262
DATEPART() 263
GETDATE() 264

xix
Contents
Conversion Functions 264
CONVERT() 266
INTTOHEX() 270
HEXTOINT() 271
Security Functions 271
IS_SEC_SERVICE_ON() 272
SHOW_SEC_SERVICES() 272
Aggregate Functions 272
AVG() 273
COUNT() 274
MAX() 274
MIN() 275
SUM() 275
Mathematical Functions 275
ABS() 277
ACOS() 278
ASIN() 278
ATAN() 278
ATN2() 279
CEILING() 279
COS() 280
COT() 280
DEGREES() 280
EXP() 281
FLOOR() 281
LOG() 281
LOG10() 282
PI() 282
POWER() 282
RADIANS() 283
RAND() 283
ROUND() 284
SIGN() 285
SIN() 285
SQRT() 286
TAN() 286
Text and Image Functions 286
TEXTPTR() 287
TEXTVALID() 287
System Functions 288
COL_LENGTH() 289
COL_NAME() 290

xx
Contents
DATALENGTH() 291
DB_ID() 291
DB_NAME() 292
OBJECT_ID() 292
OBJECT_NAME() 293
RAND() 293
SUSER_ID() 294
SUSER_NAME() 295
TSEQUAL() 295
USER() 296
USER_ID() 296
USER_NAME() 297
VALID_NAME() 297
VALID_USER() 298
Unary System Functions 299
@@BOOTTIME 301
@@CLIENT_CSID 301
@@CLIENT_CSNAME 302
@@CONNECTIONS 302
@@CPU_BUSY 303
@@ERROR 303
@@ERRORLOG 303
@@IDENTITY 304
@@IDLE 305
@@IO_BUSY 305
@@LANGID 305
@@LANGUAGE 306
@@MAXCHARLEN 306
@@MAX_CONNECTIONS 306
@@NCHARSIZE 307
@@NESTLEVEL 307
@@OPTIONS 308
@@PROBESUID 308
@@ROWCOUNT 308
@@SPID 309
@@SQLSTATUS 309
@@TIMETICKS 310
@@TOTAL_ERRORS 310
@@TOTAL_READ 311
@@TOTAL_WRITE 311
@@TRANCHAINED 311
@@TRANCOUNT 312

xxi
Contents
@@TRANSTATE 312
@@UNICHARSIZE 313
@@VERSION 313
@@VERSION_AS_INTEGER 314
Summary 314

Chapter 10: MySQL Functions 315


MySQL Query Syntax 315
Aggregate Functions 317
AVG() 318
COUNT() 318
MAX() and MIN() 319
SUM() 319
Numeric Functions 319
ABS() 322
ACOS() 323
ASIN() 323
ATAN() 323
ATAN2() 323
BIT_AND() 324
BIT_COUNT() 324
BIT_OR() 325
CEIL() or CEILING() 325
CONV() 325
COS() 326
COT() 326
DEGREES() 326
EXP() 327
FLOOR() 327
FORMAT() 327
GREATEST() 328
INTERVAL() 328
LEAST() 328
LOG() 329
LOG10() 329
MOD() 329
OCT() 330
PI() 330
POW() or POWER() 330
RADIANS() 331
RAND() 331

xxii
Contents
ROUND() 331
SIGN() 332
SIN() 332
SQRT() 332
STD() or STDDEV() 332
TAN() 333
TRUNCATE() 333
String Functions 333
ASCII() 338
BIN() 339
CHAR() 339
COMPRESS() 339
CONCAT() 340
CONCAT_WS() 340
ELT() 341
FIELD() 341
FIND_IN_SET() 342
HEX() 342
INSERT() 342
INSTR() 343
ISNULL() 343
LCASE() or LOWER() 344
LEFT() 344
LENGTH(), CHAR_LENGTH(), and CHARACTER_LENGTH() 344
LOCATE() 345
LPAD() 346
LTRIM() 346
MAKE_SET() 346
NULLIF() 347
OCT() 347
ORD() 348
REPEAT() 348
REPLACE() 348
REVERSE() 349
RIGHT() 349
RPAD() 349
RTRIM() 350
SOUNDEX() 350
SUBSTRING() 350
SUBSTRING_INDEX() 351
TRIM() 352
UCASE() or UPPER() 352

xxiii
Exploring the Variety of Random
Documents with Different Content
CHAPTER V.
ICELAND.
Volcanic Origin of the Island.—The Klofa Jökul.—Lava-streams.—The
Burning Mountains of Krisuvik.—The Mud-caldrons of Reykjahlid.—The
Tungo-hver at Reykholt.—The Great Geysir.—The Strokkr.—Crystal
Pools.—The Almannagja.—The Surts-hellir.—Beautiful Ice-cave.—The
Gotha Foss.—The Detti Foss.—Climate.—Vegetation.—Cattle.—
Barbarous Mode of Sheep-shearing.—Reindeer.—Polar Bears.—Birds.—
The Eider-duck.—Videy.—Vigr.—The Wild Swan.—The Raven.—The
Jerfalcon.—The Giant auk, or Geirfugl.—Fish.—Fishing Season.—The
White Shark.—Mineral Kingdom.—Sulphur.—Peat.—Drift-wood.

I CELAND might as well be called Fireland, for all its 40,000


square miles have originally been upheaved from the depths of
the waters by volcanic power. First, at some immeasurably distant
period of the world’s history, the small nucleus of the future island
began to struggle into existence against the superincumbent weight
of the ocean; then, in the course of ages, cone rose after cone,
crater was formed after crater, eruption followed on eruption, and
lava-stream on lava-stream, until finally the Iceland of the present
day was piled up with her gigantic “jökuls,” or ice-mountains, and
her vast promontories, stretching like huge buttresses far out into
the sea.

In winter, when an almost perpetual night covers the wastes of


this fire-born land, and the waves of a stormy ocean thunder against
its shores, imagination can hardly picture a more desolate scene; but
in summer the rugged nature of Iceland invests itself with many a
charm. Then the eye reposes with delight on green valleys and
crystal lakes, on the purple hills or snow-capped mountains rising in
Alpine grandeur above the distant horizon, and the stranger might
almost be tempted to exclaim with her patriotic sons, “Iceland is the
best land under the sun.” That it is one of the most interesting—
through its history, its inhabitants, and, above all, its natural
curiosities—no one can doubt. It has all that can please and
fascinate the poet, the artist, the geologist, or the historian; the
prosaic utilitarian alone, accustomed to value a country merely by its
productions, might turn with some contempt from a land without
corn, without forests, without mineral riches, and covered for about
two-thirds of its surface with bogs, lava-wastes, and glaciers.
The curse of sterility rests chiefly on the south-eastern and
central parts of the island. Here nothing is to be seen but deserts of
volcanic stone or immense ice-fields, the largest of which—the Klofa
Jökul—alone extends over more than 4000 square miles. The interior
of this vast region of névè and glacier is totally unknown. The
highest peaks, the most dreadful volcanoes of the island, rise on the
southern and south-western borders of this hitherto inaccessible
waste; the Oraefa looking down from a height of 6000 feet upon all
its rivals—the Skaptar, a name of dreadful significance in the annals
of Iceland, and farther on, like the advanced guards of this host of
slumbering fires, the Katla, the Myrdal, the Eyjafjalla, and the Hecla,
the most renowned, though not the most terrible, of all the
volcanoes of Iceland.
As the ice-fields of this northern island far surpass in magnitude
those of the Alps, so also the lava-streams of Ætna or Vesuvius are
insignificant when compared with the enormous masses of molten
stone which at various periods have issued from the craters of
Iceland. From Mount Skjaldebreith, on both sides of the lake of
Thingvalla as far as Cape Reykjanes, the traveller sees an
uninterrupted lava-field more than sixty miles long, and frequently
from twelve to fifteen broad; and lava-streams of still more gigantic
proportions exist in many other parts of the island, particularly in the
interior. In general, these lava-streams have cooled down into the
most fantastic forms imaginable. “It is hardly possible,” says Mr.
Holland, “to give any idea of the general appearance of these once
molten masses. Here a great crag has toppled over into some deep
crevasse, there a huge mass has been upheaved above the fiery
stream which has seethed and boiled around its base. Here is every
shape and figure that sculpture could design or imagination picture,
jumbled together in grotesque confusion, whilst everywhere myriads
of horrid spikes and sharp shapeless irregularities bristle amidst
them.”
By the eruptions of the Icelandic volcanoes many a fair meadow-
land has been converted into a stony wilderness; but if the
subterranean fires have frequently brought ruin and desolation over
the island, they have also endowed it with many natural wonders.
In the “burning mountains” of Krisuvik, on the south-western
coast, a whole hill-slope, with a deep narrow gorge at its foot, is
covered with innumerable boiling springs and fumaroles, whose
dense exhalations, spreading an intolerable stench, issue out of the
earth with a hissing noise, and completely hide the view.

40. EFFIGY IN LAVA.

The Námar, or boiling mud-caldrons of Reykjahlid, situated


among a range of mountains near the Myvatn (Gnat-Lake), in one of
the most solitary spots in the north of the island, on the border of
enormous lava-fields and of a vast unknown wilderness, exhibit
volcanic power on a still more gigantic scale. There are no less than
twelve of these seething pits, all filled with a disgusting thick slimy
gray or black liquid, boiling or simmering with greater or less
vehemence, and emitting dense volumes of steam strongly
impregnated with sulphurous gases. Some sputter furiously,
scattering their contents on every side, while in others the muddy
soup appears too thick to boil, and after remaining quiescent for
about half a minute, rises up a few inches in the centre of the basin,
emits a puff of steam, and then subsides into its former state. The
diameter of the largest of all the pits can not be less than fifteen
feet; and it is a sort of mud Geysir, for at intervals a column of its
black liquid contents, accompanied with a violent rush of steam, is
thrown up to the height of six or eight feet. Professor Sartorius von
Waltershausen, one of the few travellers who have visited this
remarkable spot, says that the witches in Macbeth could not possibly
have desired a more fitting place for the preparation of their infernal
gruel than the mud-caldrons of Reykjahlid.
Among the hot or boiling springs of Iceland, which in hundreds
of places gush forth at the foot of the mountains, some are of a
gentle and even flow, and can be used for bathing, washing, or
boiling, while others of an intermittent nature are mere objects of
curiosity or wonder. One of the most remarkable of the latter is the
Tungo-hver, at Reykholt, in the “valley of smoke,” thus named from
the columns of vapor emitted by the thermal springs which are here
scattered about with a lavish hand. It consists of two fountains
within a yard of each other—the larger one vomiting a column of
boiling water ten feet high for the space of about four minutes,
when it entirely subsides, and then the smaller one operates for
about three minutes, ejecting a column of about five feet. The
alternation is perfectly regular in time and force, and there are
authentic accounts of its unfailing exactitude for the last hundred
years.
But of all the springs and fountains of Iceland there is none to
equal, either in grandeur or renown, the Great Geysir, which is not
merely one of the curiosities of the country, but one of the wonders
of the earth, as there is nothing to compare to it in any other part of
the world.
At the foot of the Laugafjall hill, in a green plain, through which
several rivers meander like threads of silver, and where chains of
dark-colored mountains, overtopped here and there by distant snow-
peaks, form a grand but melancholy panorama, dense volumes of
steam indicate from afar the site of a whole system of thermal
springs congregated on a small piece of ground which does not
exceed twelve acres. In any other spot, the smallest of these boiling
fountains would arrest the traveller’s attention, but here his whole
mind is absorbed by the Great Geysir. In the course of countless
ages this monarch of springs has formed, out of the silica it deposits,
a mound which rises to about thirty feet above the general surface
of the plain, and slopes on all sides to the distance of a hundred feet
or thereabouts from the border of a large circular basin situated in
its centre, and measuring about fifty-six feet in the greatest
diameter and fifty-two feet in the narrowest. In the middle of this
basin, forming as it were a gigantic funnel, there is a pipe or tube,
which at its opening in the basin is eighteen or sixteen feet in
diameter, but narrows considerably at a little distance from the
mouth, and then appears to be not more than ten or twelve feet in
diameter. It has been probed to a depth of seventy feet, but it is
more than probable that hidden channels ramify farther into the
bowels of the earth. The sides of the tube are smoothly polished,
and so hard that it is not possible to strike off a piece of it with a
hammer.
Generally the whole basin is found filled up to the brim with sea-
green water as pure as crystal, and of a temperature of from 180° to
190°. Astonished at the placid tranquillity of the pool, the traveller
can hardly believe that he is really standing on the brink of the far-
famed Geysir; but suddenly a subterranean thunder is heard, the
ground trembles under his feet, the water in the basin begins to
simmer, and large bubbles of steam rise from the tube and burst on
reaching the surface, throwing up small jets of spray to the height of
several feet. Every instant he expects to witness the grand spectacle
which has chiefly induced him to visit this northern land, but soon
the basin becomes tranquil as before, and the dense vapors
produced by the ebullition are wafted away by the breeze. These
smaller eruptions are regularly repeated every eighty or ninety
minutes, but frequently the traveller is obliged to wait a whole day,
or even longer, before he sees the whole power of the Geysir. A
detonation louder than usual precedes one of these grand eruptions;
the water in the basin is violently agitated; the tube boils
vehemently; and suddenly a magnificent column of water, clothed in
vapor of a dazzling whiteness, shoots up into the air with immense
impetuosity and noise to the height of seventy or eighty feet, and,
radiating at its apex, showers water and steam in every direction. A
second eruption and a third rapidly follow, and after a few minutes
the fairy spectacle has passed away like a fantastic vision. The basin
is now completely dried up, and on looking down into the shaft, one
is astonished to see the water about six feet from the rim, and as
tranquil as in an ordinary well. After about thirty or forty minutes it
again begins to rise, and after a few hours reaches the brim of the
basin, whence it flows down the slope of the mound into the Hvita,
or White River. Soon the subterraneous thunder, the shaking of the
ground, the simmering above the tube, and the other phenomena
which attend each minor eruption, begin again, to be followed by a
new period of rest, and thus this wonderful play of nature goes on
day after day, year after year, and century after century. The mound
of the Geysir bears witness to its immense antiquity, as its water
contains but a minute portion of silica.
41. THE STROKKR.

After the Geysir, the most remarkable fountain of these


Phlegræan fields is the great Strokkr, situated about four hundred
feet from the former. Its tube, the margin of which is almost even
with the general surface, the small mound and basin being hardly
discernible, is funnel-shaped, or resembling the flower of a
convolvulus, having a depth of forty-eight feet, and a diameter of six
feet at the mouth, but contracting, at twenty-two feet from the
bottom, to only eleven inches. The water stands from nine to twelve
feet under the brim, and is generally in violent ebullition. A short
time before the beginning of the eruptions, which are more frequent
than those of the Great Geysir, an enormous mass of steam rushes
from the tube, and is followed by a rapid succession of jets,
sometimes rising to the height of 120 or 150 feet, and dissolving into
silvery mist. A peculiarity of the Strokkr is that it can at any time be
provoked to an eruption by throwing into the orifice large masses of
peat or turf; thus choking the shaft, and preventing the free escape
of the steam. After the lapse of about ten minutes, the boiling fluid,
as if indignant at this attempt upon its liberty, heaves up a column of
mud and water, with fragments of peat, as black as ink.
About 150 paces from the Great Geysir are several pools of the
most beautifully clear water, tinting with every shade of the purest
green and blue the fantastical forms of the silicious travertin which
clothes their sides. The slightest motion communicated to the
surface quivers down to the bottom of these crystal grottoes, and
imparts what might be called a sympathetic tremor of the water to
every delicate incrustation and plant-like efflorescence. “Aladdin’s
Cave could not be more beautiful,” says Preyer; and Mr. Holland
remarks that neither description nor drawing is capable of giving a
sufficient idea of the singularity and loveliness of this spot. In many
places it is dangerous to approach within several feet of the margin,
as the earth overhangs the water, and is hollow underneath,
supported only by incrustations scarcely a foot thick. A plunge into
waters of about 200° would be paying rather too dearly for the
contemplation of their fairy-like beauty.
42. ENTRANCE TO THE ALMANNAGJA.

The gigantic chasm of the Almannagja is another of the volcanic


wonders of Iceland. After a long and tedious ride over the vast lava-
plain which extends between the Skalafell and the lake of Thingvalla,
the traveller suddenly finds himself arrested in his path by an
apparently insurmountable obstacle, for the enormous Almannagja,
or Allman’s Rift, suddenly gapes beneath his feet—a colossal rent
extending above a mile in length, and inclosed on both sides by
abrupt walls of black lava, frequently upward of a hundred feet high,
and separated from about fifty to seventy feet from each other.

43. THE ALMANNAGJA.

A corresponding chasm, but of inferior dimensions, the


Hrafnagja, or Raven’s Rift, opens its black rampart to the east, about
eight miles farther on; and both form the boundaries of the verdant
plain of Thingvalla, which by a grand convulsion of nature has itself
been shattered into innumerable small parallel crevices and fissures
fifty or sixty feet deep.
44. THE HRAFNAGJA.

Of the Hrafnagja Mr. Ross Browne says: “A toilsome ride of eight


miles brought us to the edge of the Pass, which in point of rugged
grandeur far surpasses the Almannagja, though it lacks the extent
and symmetry which give the latter such a remarkable effect. Here
was a tremendous gap in the earth, over a hundred feet deep,
hacked and shivered into a thousand fantastic shapes; the sides a
succession of the wildest accidents; the bottom a chaos of broken
lava, all tossed about in the most terrific confusion. It is not,
however, the extraordinary desolation of the scene that constitutes
its principal interest. The resistless power which had rent the great
lava-bed asunder, as if touched with pity at the ruin, had also flung
from the tottering cliffs a causeway across the gap, which now forms
the only means of passing over the great Hrafnagja. No human
hands could have created such a colossal work as this; the
imagination is lost in its massive grandeur; and when we reflect that
miles of an almost impassable country would otherwise have to be
traversed in order to reach the opposite side of the gap, the
conclusion is irresistible that in the battle of the elements Nature still
had a kindly remembrance of man.

45. THE TINTRON ROCK.

“Five or six miles beyond the Hrafnagja, near the summit of a


dividing ridge, we came upon a very singular volcanic formation,
called the Tintron. It stands, a little to the right of the trail, on a rise
of scoria and burnt earth, from which it juts up in rugged relief to
the height of twenty or thirty feet. This is, strictly speaking, a huge
clinker, not unlike what comes out of a grate—hard, glassy in spots,
and scraggy all over. The top part is shaped like a shell; in the centre
is a hole about three feet in diameter, which opens into a vast
subterranean cavity of unknown depth. Whether the Tintron is an
extinct crater, through which fires shot out of the earth in by-gone
times, or an isolated mass of lava, whirled through the air out of
some distant volcano, is a question that geologists must determine.
The probability is that it is one of those natural curiosities so
common in Iceland which defy research. The whole country is full of
anomalies—bogs where one would expect to find dry land, and
parched deserts where it would not seem strange to see bogs; fire
where water ought to be, and water in the place of fire.”

“Ages ago,” says Lord


Dufferin, “some vast commotion
shook the foundations of the
island; and bubbling up from
sources far away amid the inland
46. FALL OF THE OXERAA.
hills, a fiery deluge must have
rushed down between their
ridges, until, escaping from the
narrower gorges, it found space to spread itself into one broad sheet
of molten stone over an entire district of country, reducing its varied
surface to one vast blackened level. One of two things then
occurred: either, the vitrified mass contracting as it cooled, the
centre area of fifty square miles (the present plain of Thingvalla)
burst asunder at either side from the adjoining plateau, and sinking
down to its present level, left two parallel gjas, or chasms, which
form its lateral boundaries, to mark the limits of the disruption; or
else, while the pith or marrow of the lava was still in a fluid state, its
upper surface became solid, and formed a roof, beneath which the
molten stream flowed on to lower levels, leaving a vast cavern into
which the upper crust subsequently plumped down.” In the lapse of
years, the bottom of the Almannagja has become gradually filled up
to an even surface, covered with the most beautiful turf, except
where the river Oxeraa, bounding in a magnificent cataract from the
higher plateau over the precipice, flows for a certain distance
between its walls. At the foot of the fall the waters linger for a
moment in a dark, deep, brimming pool, hemmed in by a circle of
ruined rocks, in which anciently all women convicted of capital
crimes were immediately drowned. Many a poor crone, accused of
witchcraft, has thus ended her days in the Almannagja. As may
easily be imagined, it is rather a nerve-trying task to descend into
the chasm over a rugged lava-slope, where the least false step may
prove fatal; but the Icelandic horses are so sure-footed that they can
safely be trusted. From the bottom it is easy to distinguish on the
one face marks and formations exactly corresponding, though at a
different level, with those on the face opposite, and evidently
showing that they once had dovetailed into each other, before the
igneous mass was rent asunder.
Two leagues from Kalmanstunga, in an immense lava-field,
which probably originated in the Bald Jökul, are situated the
renowned Surts-hellir, or caves of Surtur, the prince of darkness and
fire of the ancient Scandinavian mythology. The principal entrance to
the caves is an extensive chasm formed by the falling in of a part of
the lava-roof; so that, on descending into it, the visitor finds himself
right in the mouth of the main cavern, which runs in an almost
straight line, and is nearly a mile in length. Its average height is
about forty, and its breadth fifty feet. The lava-crust which forms its
roof is about twelve feet thick, and has the appearance of being
stratified and columnar, like basaltic pillars, in its formation. Many of
the blocks of lava thus formed have become detached and fallen into
the cavern, where they lie piled up in great heaps, and heavily tax
the patience of the traveller, who has to scramble over the rugged
stones, and can hardly avoid slipping and stumbling into the holes
between them, varied by pools of water and masses of snow. But
after having toiled and plodded to the extremity of this dismal
cavern, his perseverance is amply rewarded by the sight of an ice-
grotto, whose fairy beauty appears still more charming, in contrast
with its gloomy vestibule. From the crystal floor rises group after
group of transparent pillars tapering to a point, while from the roof
brilliant icy pendants hang down to meet them. Columns and arches
of ice are ranged along the crystalline walls, and the light of the
candles is reflected back a hundred-fold from every side, till the
whole cavern shines with astonishing lustre. Mr. Holland, the latest
visitor of the Surts-hellir, declares he never saw a more brilliant
spectacle; and the German naturalist, Preyer, pronounces it one of
the most magnificent sights in nature, reminding him of the fairy
grottoes of the Arabian Nights’ Tales.
From the mountains and the vast plateau which occupies the
centre of the island, numerous rivers descend on all sides, which,
fed in summer by the melting glaciers, pour enormous quantities of
turbid water into the sea, or convert large alluvial flats into
morasses. Though of a considerable breadth, their course is
frequently very short, particularly along the southern coast, where
the jokuls from which they derive their birth are only separated from
the sea by a narrow foreland. In their impetuous flow, they not
seldom bear huge blocks of stone along with them, and cut off all
communication between the inhabitants of their opposite banks.
The chief rivers of Iceland are, in the south, the Thiorsa and the
Hvita, which are not inferior in width to the Rhine in the middle part
of its course; in the north, the Skjalfandafljot and the Jökulsa and
the Jökulsa i Axarfirdi, large and rapid streams above a hundred
miles long; and in the east the Lagarfliot. As may be expected in a
mountainous country, containing many glacier-fed rivers, Iceland has
numerous cascades, many of them rivalling or surpassing in beauty
the far-famed falls of Switzerland.
One of the most celebrated of these gems of nature is the Goda-
foss, in the northern part of the island, formed by the deep and
rapid Skjalfandafljot, as it rushes with a deafening roar over rocks
fifty feet high into the caldron below; but it is far surpassed in
magnificence by the Dettifoss, a fall of the Jökulsa i Axarfirdi.
“In some of old earth’s convulsions,” says its discoverer, Mr.
Gould,—for from its remote situation, deep in the northern wilds of
Iceland, it had escaped the curious eye of previous travellers—“the
crust of rock has been rent, and a frightful fissure formed in the
basalt, about 200 feet deep, with the sides columnar and
perpendicular. The gash terminates abruptly at an acute angle, and
at this spot the great river rolls in. The wreaths of water sweeping
down; the frenzy of the confined streams where they meet, shooting
into each other from either side at the apex of an angle; the wild
rebound when they strike a head of rock, lurching out half way
down; the fitful gleam of battling torrents, obtained through a veil of
eddying vapor; the Geysir-spouts which blow up about seventy feet
from holes whence basaltic columns have been shot by the force of
the descending water; the blasts of spray which rush upward and
burst into fierce showers on the brink, feeding rills which plunge
over the edge as soon as they are born; the white writhing vortex
below, with now and then an ice-green wave tearing through the
foam to lash against the walls; the thunder and bellowing of the
water, which make the rock shudder under foot, are all stamped on
my mind with a vividness which it will take years to efface. The
Almannagja is nothing to this chasm, and Schaffhausen is dwarfed
by Dettifoss.”
The ocean-currents which wash the coasts of Iceland from
opposite directions have a considerable influence on its climate. The
south and west coasts, fronting the Atlantic, and exposed to the Gulf
Stream, remain ice-free even in winter, and enjoy a comparatively
mild temperature, while the cold Polar current, flowing in a south-
western direction from Spitzbergen to Jan Mayen and Iceland,
conveys almost every year to the eastern and northern shores of the
island large masses of drift-ice, which sometimes do not disappear
before July or even August. According to Dr. Thorstensen, the mean
annual temperature of the air at Reykjavik is +40°, and that of the
sea +42°, while according to Herr von Scheele the mean annual
temperature at Akureyre, on the north coast, is only +33°, though
even this shows a comparatively mild climate in so high a latitude.
But if Iceland, thanks to its insular position and to the influence of
the Gulf Stream, remains free from the excessive winter cold of the
Arctic continents, its summer, on the other hand, is inferior in
warmth to that which reigns in the interior of Siberia, or of the
Hudson’s Bay territories.
The mean summer temperature at Reykjavik is not above +54°;
during many years the thermometer never rises a single time above
+80°; sometimes even its maximum is not higher than +59°; and,
on the northern coast, snow not seldom falls even in the middle of
summer. Under such circumstances, the cultivation of the cereals is
of course impossible; and when the drift-ice remains longer than
usual on the northern coasts, it prevents even the growth of the
grass, and want and famine are the consequence.
The Icelandic summer is characterized by constant changes in
the weather, rain continually alternating with sunshine, as with us in
April. The air is but seldom tranquil, and storms of terrific violence
are of frequent occurrence. Towards the end of September winter
begins, preceded by mists, which finally descend in thick masses of
snow. Travelling over the mountain-tracks is at this time particularly
dangerous, although cairns or piles of stone serve to point out the
way, and here and there, as over the passes of the Alps, small huts
have been erected to serve as a refuge for the traveller.
In former times Iceland could boast of forests, so that houses
and even ships used to be built of indigenous timber; at present it is
almost entirely destitute of trees, for the dwarf shrubberies here and
there met with, where the birch hardly attains the height of twenty
feet, are not to be dignified with the name of woods. A service-tree
(Sorbus ancuparia) fourteen feet high, and measuring three inches
in diameter at the foot, is the boast of the governor’s garden at
Reykjavik; it is, however, surpassed by another at Akureyre, which
spreads a full crown twenty feet from the ground, but never sees its
clusters of berries ripen into scarlet.
The damp and cool Icelandic summer, though it prevents the
successful cultivation of corn, is favorable to the growth of grasses,
so that in some of the better farms the pasture-grounds are hardly
inferior to the finest meadows in England. About one-third of the
surface of the country is covered with vegetation of some sort or
other fit for the nourishment of cattle; but, as yet, art has done little
for its improvement—ploughing, sowing, drainage, and levelling
being things undreamt of. With the exception of the grasses, which
are of paramount importance, and the trees, which, in spite of their
stunted proportions, are of great value, as they supply the islanders
with the charcoal needed for shoeing their horses, few of the
indigenous plants of Iceland are of any use to man. The Angelica
archangelica is eaten raw with butter; the matted roots or stems of
the Menyanthes trifoliata serve to protect the backs of the horses
against the rubbing of the saddle; and the Icelandic moss, which is
frequently boiled in milk, is likewise an article of exportation. The
want of better grain frequently compels the poor islanders to bake a
kind of bread from the seeds of the sand-reed (Elymus arenarius),
which on our dunes are merely picked by the birds of passage; and
the oarweed or tangle (Laminaria saccharina) is prized as a
vegetable in a land where potatoes and turnips are but rarely
cultivated.
When the first settlers came to Iceland, they found but two
indigenous land-quadrupeds: a species of field-vole (Arvicola
œconomus) and the Arctic fox; but the seas and shores were no
doubt tenanted by a larger number of whales, dolphins, and seals
than at the present day.
The ox, the sheep, and the horse which accompanied the Norse
colonists to their new home, form the staple wealth of their
descendants; for the number of those who live by breeding cattle is
as three to one, compared with those who chiefly depend on the sea
for their subsistence. Milk and whey are almost the only beverages
of the Icelanders. Without butter they will eat no fish; and curdled
milk, which they eat fresh in summer and preserve in a sour state
during the winter, is their favorite repast. Thus they set the highest
value on their cattle, and tend them with the greatest care. In the
preservation of their sheep, they are much hampered by the
badness of the climate, by the scantiness of winter food, and by the
attacks of the eagles, the ravens, and the foxes, more particularly at
the lambing season, when vast numbers of the young animals are
carried off by all of them. The wool is not sheared off, but torn from
the animal’s back, and woven by the peasantry, during the long
winter evenings, into a kind of coarse cloth, or knit into gloves and
stockings, which form one of the chief articles of export.
“While at breakfast,” says Mr. Shepherd, “we witnessed the
Icelandic method of sheep-shearing. Three or four powerful young
women seized, and easily threw on their backs the struggling
victims. The legs were then tied, and the wool pulled off by main
force. It seemed, from the contortions of some of the wretched
animals, to be a cruel method; but we were told that there is a
period in the year when the young wool, beginning to grow, pushes
the old out before it, so that the old coat is easily pulled out.” The
number of heads of cattle in the island is about 40,000, that of the
sheep 500,000.
The horses, which number from 50,000 to 60,000, though small,
are very robust and hardy. There being no wheel carriages on the
island, they are merely used for riding and as beasts of burden.
Their services are indispensable, as without them the Icelanders
would not have the means of travelling and carrying their produce to
the fishing villages or ports at which the annual supplies arrive from
Copenhagen. In winter the poor animals must find their own food,
and are consequently mere skeletons in spring; they, however, soon
recover in summer, though even then they have nothing whatever
but the grass and small plants which they can pick up on the hills.
The dogs are very similar to those of Lapland and Greenland.
Like them, they have long hair, forming a kind of collar round the
neck, a pointed nose, pointed ears, and an elevated curled tail, with
a temper which may be characterized as restless and irritable. Their
general color is white.
In the year 1770 thirteen reindeer were brought from Norway.
Ten of them died during the passage, but the three that survived
have multiplied so fast that large herds now roam over the
uninhabited wastes. During the winter, when hunger drives them
into the lower districts, they are frequently shot; but no attempts
have been made to tame them: for, though indispensable to the
Laplander, they are quite superfluous in Iceland, which is too rugged
and too much intersected by streams to admit of sledging. They are,
in fact, generally considered as a nuisance, as they eat away the
Icelandic moss, which the islanders would willingly keep for their
own use.
47. ICELANDIC HORSES.

The Polar bear is but a casual visitor in Iceland. About a dozen


come drifting every year with the ice from Jan Mayen, or
Spitzbergen, to the northern shores. Ravenous with hunger, they
immediately attack the first herds they meet with; but their ravages
do not last long, for the neighborhood, arising in arms, soon puts an
end to their existence.
In Iceland the ornithologist finds a rich field for his favorite
study, as there are no less than eighty-two different species of
indigenous birds, besides twenty-one that are only casual visitors,
and six that have been introduced by man.
The swampy grounds in the interior of the country are peopled
with legions of golden and king plovers, of snipes and red-shanks;
the lakes abound with swans, ducks, and geese of various kinds; the
snow-bunting enlivens the solitude of the rocky wilderness with his
lively note, and, wherever grass grows, the common pipit (Anthus
pratensis) builds its neat little nest, well lined with horsehair. Like the
lark, he rises singing from the ground, and frequently surprises the
traveller with his melodious warbling, which sounds doubly sweet in
the lifeless waste.

48. SHOOTING REINDEER.

The eider-duck holds the first rank among the useful birds of
Iceland. Its chief breeding-places are small flat islands on various
parts of the coast, where it is safe from the attacks of the Arctic fox,
such as Akurey, Flatey, and Videy, which, from its vicinity to
Reykjavik, is frequently visited by travellers. All these breeding-
places are private property, and several have been for centuries in
the possession of the same families, which, thanks to the birds, are
among the wealthiest of the land. It may easily be imagined that the
eider-ducks are guarded with the most sedulous care. Whoever kills
one is obliged to pay a fine of thirty dollars; and the secreting of an
egg, or the pocketing of a few downs, is punished with all the rigor
of the law. The chief occupation of Mr. Stephenson, the aged
proprietor of Videy, who dwells alone on the islet, is to examine
through his telescope all the boats that approach, so as to be sure
that there are no guns on board. During the breeding season no one
is allowed to land without his special permission, and all noise,
shouting, or loud speaking is strictly prohibited. But, in spite of these
precautions, we are informed by recent travellers that latterly the
greater part of the ducks of Videy have been tempted to leave their
old quarters for the neighboring Engey, whose proprietor hit upon
the plan of laying hay upon the strand, so as to afford them greater
facilities for nest-building. The eider-down is easily collected, as the
birds are quite tame. The female having laid five or six pale
greenish-olive eggs, in a nest thickly lined with her beautiful down,
the collectors, after carefully removing the bird, rob the nest of its
contents, after which they replace her. She then begins to lay afresh,
though this time only three or four eggs, and again has recourse to
the down on her body. But her greedy persecutors once more rifle
her nest, and oblige her to line it for the third time. Now, however,
her own stock of down is exhausted, and with a plaintive voice she
calls her mate to her assistance, who willingly plucks the soft
feathers from his breast to supply the deficiency. If the cruel robbery
be again repeated, which in former times was frequently the case,
the poor eider-duck abandons the spot, never to return, and seeks
for a new home where she may indulge her maternal instinct
undisturbed.
Mr. Shepherd thus describes his visit to Vigr, in the
Isafjardardjup, one of the head-quarters of the eider-duck in the
north of Iceland: “As the island was approached, we could see flocks
upon flocks of the sacred birds, and could hear their cooings at a
great distance. We landed on a rocky wave-worn shore, against
which the waters scarcely rippled, and set off to investigate the
island. The shore was the most wonderful ornithological sight
conceivable. The ducks and their nests were everywhere in a
manner that was quite alarming. Great brown ducks sat upon their
nests in masses, and at every step
started up from under our feet. It
was with difficulty that we avoided
treading on some of the nests. The
island being but three-quarters of a
mile in width, the opposite shore was
soon reached. On the coast was a
wall built of large stones, just above
the high-water level, about three feet
in height, and of considerable
49. EIDER-DUCK. thickness. At the bottom, on both
sides of it, alternate stones had been
left out, so as to form a series of
square compartments for the ducks to make their nests in. Almost
every compartment was occupied; and, as we walked along the
shore, a long line of ducks flew out one after another. The surface of
the water also was perfectly white with drakes, who welcomed their
brown wives with loud and clamorous cooing. When we arrived at
the farmhouse we were cordially welcomed by its mistress. The
house itself was a great marvel. The earthern wall that surrounded it
and the window embrasures were occupied by ducks. On the
ground, the house was fringed with ducks. On the turf slopes of the
roof we could see ducks; and a duck sat in the scraper.
“A grassy bank close by had been cut into square patches like a
chessboard (a square of turf of about eighteen inches being
removed, and a hollow made), and all were filled with ducks. A
windmill was infested, and so were all the outhouses, mounds,
rocks, and crevices. The ducks were everywhere. Many of them were
so tame that we could stroke them on their nests; and the good lady
told us that there was scarcely a duck on the island which would not
allow her to take its eggs without flight or fear. When she first
became possessor of the island, the produce of down from the ducks
was not more than fifteen pounds’ weight in the year, but, under her
careful nurture of twenty years, it had risen to nearly one hundred
pounds annually. It requires about one pound and a half to make a
coverlet for a single bed, and the down is worth from twelve to
fifteen shillings per pound. Most of the eggs are taken and pickled
for winter consumption, one or two only being left to hatch.”
Though not so important as the eider, the other members of the
duck family which during the summer season enliven the lakes and
swamps of Iceland are very serviceable. On the Myvatn, or Gnat
Lake, one of their chief places of resort, the eggs of the long-tailed
duck, the wild duck, the scoter, the common goosander, the red-
breasted merganser, the scaup-duck, etc., and other anserines are
carefully gathered and preserved in enormous quantities for the
winter, closely packed in a fine gray volcanic sand.
The wild swan is frequently shot or caught for his feathers,
which bring in many a dollar to the fortunate huntsman. This noble
bird frequents both the salt and brackish waters along the coast and
the inland lakes and rivers, where it is seen either in single pairs or
congregated in large flocks. To build its nest, which is said to
resemble closely that of the flamingo, being a large mound,
composed of mud, rushes, grass, and stones, with a cavity at top
lined with soft down, it retires to some solitary, uninhabited spot.
Much has been said in ancient times of the singing of the swan, and
the beauty of its dying notes; but, in truth, the voice of the swan is
very loud, shrill, and harsh, though when high in the air, and
modulated by the winds, the note or whoop of an assemblage of
them is not unpleasant to the ear. It has a peculiar charm in the
unfrequented wastes of Iceland, where it agreeably interrupts the
profound silence that reigns around.
The raven, one of the commonest land-birds in Iceland, is an
object of aversion to the islanders, as it not only seizes on their
young lambs and eider-ducks, but also commits great depredations
among the fishes laid out to dry upon the shore. Poles to which dead
ravens are attached, to serve as a warning to the living, are
frequently seen in the meadows; and the Icelander is never so
happy as when he has succeeded in shooting a raven. This,
however, is no easy task, as no bird is more cautious, and its eyes
are as sharp as those of the eagle. Of all Icelandic birds, the raven
breeds the earliest, laying about the middle of March its five or six
pale-green eggs, spotted with brown, in the inaccessible crevices of
rocks. Towards the end of June, Preyer saw many young ravens
grown to a good size, and but little inferior to the old ones in
cunning.
In the gloomy Scandinavian mythology the raven occupies a
rank equal to that of the eagle in the more cheerful fables of ancient
Greece. It was dedicated to Odin, who, as the traditional history of
Iceland informs us, had two ravens, which were let loose every
morning to gather tidings of what was going on in the world, and
which on returning in the evening perched upon Odin’s shoulders to
whisper the news in his ear; the name of one was Hugin, or spirit; of
the other, Mumin, or memory. Even now many superstitious notions
remain attached to the raven; for the Icelanders believe this bird to
be not only acquainted with what is going on at a distance, but also
with what is to happen in future, and are convinced that it foretells
when any of the family is about to die, by perching on the roof of
the house, or wheeling round in the air with a continual cry, varying
its voice in a singular and melodious manner.
The white-tailed sea-eagle is not uncommon in Iceland, where
he stands in evil repute as a kidnapper of lambs and eider-ducks. He
is sometimes found dead in the nets of the fishermen; for, pouncing
upon a haddock or salmon, he gets entangled in the meshes, and is
unable to extricate himself. The skins of the bird, which seems to
attain a larger size than in Great Britain, most likely from being less
disturbed by man, are sold at Reykjavik and Akureyre for from three
to six rix-dollars.
The jyrfalcon (Falco gyrfalco), generally considered as the
boldest and most beautiful of the falcon tribe, has its head-quarters
in Iceland. As long as the noble sport of falconry was in fashion, for
which it was highly esteemed, the trade in falcons was worth from
2000 to 3000 rix-dollars annually to the islanders, and even now
high prices are paid for it by English amateurs.
The rarest bird of Iceland, if not
entirely extinct, is the Giant-auk, or
Geirfugl. The last pair was caught
about seventeen years ago near the
Geirfuglaskers, a group of solitary
rocks to the south of the Westman
Isles, its only known habitat besides
some similar cliffs on the north-
eastern coast. Since that time it is
said to have been seen by some
fishermen; but this testimony is
extremely doubtful, and the question
of its existence can only be solved by
a visit to the Geirfuglaskers
themselves—an undertaking which, if
50. THE JYRFALCON.
practicable at all, is attended with
extreme difficulty and danger, as
these rocks are completely isolated in the sea, which even in calm
weather breaks with such violence against their abrupt declivities
that for years it must be absolutely impossible to approach them.
In 1858 two English naturalists determined at least to make the
attempt, and settled for a season in a small hamlet on the
neighboring coast, eager to seize the first opportunity for storming
the Geirfugl’s stronghold. They waited for several months, but in
vain, the stormy summer being more than usually unfavorable for
their undertaking; and they were equally unsuccessful in the north,
whither they had sent an Icelandic student specially instructed for
the purpose. The giant-auk is three feet high, and has a black bill
four inches and a quarter long, both mandibles being crossed
obliquely with several ridges and furrows. Its wings are mere
stumps, like those of the Antarctic penguins. Thirty pounds have
been paid for its egg, which is larger than that of any other
European bird; and there is no knowing the price the Zoological
Society would pay for a live bird, if this truly “rara avis” could still be
found.
The waters of Iceland
abound with excellent fish,
which not only supply the
islanders with a great part of
their food and furnish them
with one of their chief articles
of exportation, but also attract
a number of foreign seamen.
Thus about 300 French, Dutch,
and Belgian fishing-sloops,
manned with crews amounting
in all to 7000 men, annually
make their appearance on the
southern and western coasts of
Iceland, particularly those of
the Guldbringe Syssel, or gold- 51. THE GIANT-AUK.
bringing country: thus named,
not from any evidence of the
precious metal, but from the golden cod-harvests reaped on its
shores. Between thirty and forty English fishing-smacks yearly visit
the northern coast. When they have obtained a good cargo they run
to Shetland to discharge it, and return again for more.
The Icelandic fishing-season, which begins in February and ends
in June, occupies one-half of the male inhabitants of the island, who
come flocking to the west, even from the remotest districts of the
north and east, to partake of the rich harvest of the seas. Many thus
travel for more than 200 miles in the midst of winter, while the storm
howls over the naked waste, and the pale sun scarcely dispels for a
few hours the darkness of the night. In every hut where they tarry
on the road they are welcome, and have but rarely to pay for their
entertainment, for hospitality is still reckoned a duty in Iceland. On
reaching the fishing-station, an agreement is soon made with the
proprietor of a boat. They usually engage to assist in fishing from
February 12 to May 12, and receive in return a share of the fish
which they help to catch, besides forty pounds of flour and a daily
allowance of sour curds, or “skier.”
All the men belonging to a boat generally live in the same damp
and narrow hut. At daybreak they launch forth, to brave for many
hours the inclemencies of the weather and the sea, and while
engaged in their hard day’s work their sole refreshment is the
chewing of tobacco or a mouthful of skier. On returning to their
comfortless hut, their supper consists of the fishes of inferior quality
they may have caught, or of the heads of the cod or ling, which are
too valuable for their own consumption. These are split open and
hung upon lines, or exposed on the shore to the cold wind and the
hot sun; this renders them perfectly hard, and they keep good for
years. In this dried state the cod is called stockfish. About the middle
of May the migratory fishermen return to their homes, leaving their
fish which are not yet quite dry to the care of the fishermen dwelling
on the spot. Towards the middle of June, when the horses have so
far recovered from their long winter’s fast as to be able to bear a
load, they come back to fetch their stockfish, which they convey
either to their own homes for the consumption of their own families,
or to the nearest port for the purpose of bartering it against other
articles. Haddocks, flatfish, and herrings are also very abundant in
the Icelandic seas; and along the northern and north-western coasts
the basking shark is largely fished for all the summer. Strong hooks
baited with mussels or pieces of fish, and attached to chains
anchored at a short distance from the shore, serve for the capture of
this monster, which is scarcely, if at all, inferior in size to the white
shark, though not nearly so formidable, as it rarely attacks man. The
skin serves for making sandals; the coarse flesh is eaten by the
islanders, whom necessity has taught not to be over-nice in their
food; and the liver, the most valuable part, is stewed for the sake of
its oil.
“We had observed,” says Mr. Shepherd, “that the horrible smell
which infested Jsa-fjordr varied in intensity as we approached or
receded from a certain black-looking building at the northern end of
the town. On investigating this building, we discovered that the seat
of the smell was to be found in a mass of putrid sharks’ livers, part
of which were undergoing a process of stewing in a huge copper. It
was a noisome green mass, fearful to contemplate. The place was
endurable only for a few seconds; yet dirty-looking men stirred up
the mass with long poles, and seemed to enjoy the reeking vapors.”
The salmon of Iceland, which formerly remained undisturbed by
the phlegmatic inhabitants, are now caught in large numbers for the
British market. A small river bearing the significant name of Laxaa,
or Salmon River, has been rented for the trifling sum of £100 a year
by an English company, which sends every spring its agents to the
spot well provided with the best fishing apparatus. The captured fish
are immediately boiled, and hermetically packed in tin boxes, so that
they can be eaten in London almost as fresh as if they had just been
caught.
The mineral kingdom contributes but little to the prosperity of
Iceland. It affords neither metals, nor precious stones, nor rock-salt,
nor coal; for the seams of “surturbrand”, or “lignite”, found here and
there, are too unimportant to be worked. The solfataras of Krisuvik
and Husavik, though extremely interesting to the geologist, likewise
furnish sulphur in too impure a condition or too thinly scattered to
afford any prospect of being worked with success, not to mention
the vast expense of transport over the almost impassable lava-tracks
that separate them from the nearest ports. In 1839–40, when, in
consequence of the monopoly granted by the Neapolitan
Government to a French company, sulphur had risen to more than
three times its usual price, Mr. Knudsen, an enterprising Danish
merchant, undertook to work the mines of Krisuvik, but even then it
would not answer.
In 1859, a London company, founded by Mr. Bushby,—who
having explored the sulphur districts, had raised great expectations
on what he considered their dormant wealth,—renewed the attempt,
but after a year’s trial it was abandoned as perfectly hopeless. The
“solfataras of Iceland”, says Professor Sartorius of Waltershausen,
“can not compete with those of Sicily, where more sulphur is
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like