Обсуждение: SQL For smarties
Hi All, Does anyone know where I can get the book 'SQL for smarties' as it seems to be out of print. Alternatively could anyone recommend a book that is going to help me represent tree structures in a database and the methods to manipulate them. Thanks in advance. Graham.
"Graham Vickrage" <graham@digitalplanit.com> writes:
> Does anyone know where I can get the book 'SQL for smarties' as it seems to
> be out of print.
Surely not. Amazon claims to have it in stock: just go to
www.amazon.com and search for "sql for smarties"; comes right up.
Perhaps you were looking for the first edition?
regards, tom lane
You mean this book: http://www.bookpool.com/.x/noh7tjpis1/ss/1?qs=sql+for+smarties&Go.x=0&Go.y=0 <http://www.bookpool.com/.x/noh7tjpis1/ss/1?qs=sql+for+smarties&Go.x=0&Go.y=0> Graham Vickrage wrote: >Hi All, > >Does anyone know where I can get the book 'SQL for smarties' as it seems to >be out of print. > >Alternatively could anyone recommend a book that is going to help me >represent tree structures in a database and the methods to manipulate them. > >Thanks in advance. > >Graham. > > > >---------------------------(end of broadcast)--------------------------- >TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to majordomo@postgresql.org so that your >message can get through to the mailing list cleanly >
Graham Vickrage wrote: > Hi All, > > Does anyone know where I can get the book 'SQL for smarties' as it seems to > be out of print. > > Alternatively could anyone recommend a book that is going to help me > represent tree structures in a database and the methods to manipulate them. http://cddb.sai.msu.su/~megera/postgres/gist/ check contrib/tree i have not tried myself though ;-) > > > Thanks in advance. > > Graham.
I am trying to create tables from within a funtion i.e.
create function _tree_create(text) retuns int as '
begin;
create table $1_tree (....);
return 1;
end;
...
select _tree_create('item');
An error message refering to $1 gets thrown up. Is this not possible to do
or is there another way of doing it?
Thanks in advance.
Graham
Try:
execute ''create table '' || $1 || ''_tree (....)'';
(That's doubled single quotes)
--- Graham Vickrage <graham@digitalplanit.com> wrote:
> I am trying to create tables from within a funtion
> i.e.
>
> create function _tree_create(text) retuns int as '
> begin;
> create table $1_tree (....);
> return 1;
> end;
> ...
>
> select _tree_create('item');
>
> An error message refering to $1 gets thrown up. Is
> this not possible to do
> or is there another way of doing it?
>
> Thanks in advance.
>
> Graham
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
On Wed, 20 Feb 2002, Graham Vickrage wrote:
> I am trying to create tables from within a funtion i.e.
>
> create function _tree_create(text) retuns int as '
> begin;
> create table $1_tree (....);
> return 1;
> end;
> ...
>
> select _tree_create('item');
>
> An error message refering to $1 gets thrown up. Is this not possible to do
> or is there another way of doing it?
You'll probably need to generate the query string you want to run and
use execute.
Graham, > > Does anyone know where I can get the book 'SQL for smarties' as it > seems to > > be out of print. The first edition is out of print. That's OK, you don't want it. Thesecond edition is in print: Stacy's Bookstore has it: http://www.staceys.com/ As does Powell's: http://www.powells.com/cgi-bin/biblio?inkey=2-1558605762-0 Share & enjoy! -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete informationtechnology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco