Fwd: Using the inet and url type functions
Hi, I noticed in the manual that there are many useful functions for the inet and url types. For example, I would like to convert an inet column to text for use in a Python script (since the python-monetdb module does not support the inet type.) I tried: sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON in: "select wlid, text(" sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; unexpected symbol (:) sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; syntax error, unexpected '(', expecting SCOLON in: "select wlid, inet.text(" I have read through the manual sections on types and functions several times now, and I cannot see how to use the specified functions on these types. Any help would be greatly appreciated. Thanks! -={C}=-
On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson wrote:
Hi,
I noticed in the manual that there are many useful functions for the inet and url types. For example, I would like to convert an inet column to text for use in a Python script (since the python-monetdb module does not support the inet type.)
I tried:
sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON in: "select wlid, text("
Text is a monetdb sql keyword, ie simply double quote text. ie SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; Niels
sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; unexpected symbol (:)
sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; syntax error, unexpected '(', expecting SCOLON in: "select wlid, inet.text("
I have read through the manual sections on types and functions several times now, and I cannot see how to use the specified functions on these types. Any help would be greatly appreciated.
Thanks!
-={C}=-
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER
BY src, ts LIMIT 5;
SELECT: no such unary operator 'text(inet)'
On Thu, May 23, 2013 at 2:33 PM, Niels Nes
On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson wrote:
Hi,
I noticed in the manual that there are many useful functions for the inet and url types. For example, I would like to convert an inet column to text for use in a Python script (since the python-monetdb module does not support the inet type.)
I tried:
sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON in: "select wlid, text("
Text is a monetdb sql keyword, ie simply double quote text.
ie
SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5;
Niels
sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; unexpected symbol (:)
sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; syntax error, unexpected '(', expecting SCOLON in: "select wlid, inet.text("
I have read through the manual sections on types and functions several times now, and I cannot see how to use the specified functions on these types. Any help would be greatly appreciated.
Thanks!
-={C}=-
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
On Thu, May 23, 2013 at 02:35:59PM -0400, Christopher Nelson wrote:
sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; SELECT: no such unary operator 'text(inet)'
The text function should be part of the 14_inet.sql file which is loaded the first time you start (the first) client. Which version are you running? Niels
On Thu, May 23, 2013 at 2:33 PM, Niels Nes
wrote: On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson wrote: > Hi, > > I noticed in the manual that there are many useful functions for the > inet and url types. For example, I would like to convert an inet column > to text for use in a Python script (since the python-monetdb module > does not support the inet type.) > > I tried: > > sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL ORDER > BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON in: > "select wlid, text("
Text is a monetdb sql keyword, ie simply double quote text.
ie
SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5;
Niels > > sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT NULL > ORDER BY src, ts LIMIT 5; > unexpected symbol (:) > > sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT NULL > ORDER BY src, ts LIMIT 5; > syntax error, unexpected '(', expecting SCOLON in: "select wlid, > inet.text(" > > I have read through the manual sections on types and functions several > times now, and I cannot see how to use the specified functions on these > types. Any help would be greatly appreciated. > > Thanks! > > -={C}=- > >
> _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
cnelson@hpvm:/store/meps/db $ mclient -v
mclient, the MonetDB interactive terminal (Feb2013-SP2)
support for command-line editing compiled-in
character encoding: UTF-8
cnelson@hpvm:/store/meps/db $ sudo monetdb version
MonetDB Database Server Toolkit v1.1 (Feb2013-SP2)
On Thu, May 23, 2013 at 2:41 PM, Niels Nes
On Thu, May 23, 2013 at 02:35:59PM -0400, Christopher Nelson wrote:
sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5; SELECT: no such unary operator 'text(inet)'
The text function should be part of the 14_inet.sql file which is loaded the first time you start (the first) client. Which version are you running?
Niels
On Thu, May 23, 2013 at 2:33 PM, Niels Nes
wrote: On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson wrote: > Hi, > > I noticed in the manual that there are many useful functions for the > inet and url types. For example, I would like to convert an inet column > to text for use in a Python script (since the python-monetdb module > does not support the inet type.) > > I tried: > > sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL ORDER > BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON in: > "select wlid, text("
Text is a monetdb sql keyword, ie simply double quote text.
ie
SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL ORDER BY src, ts LIMIT 5;
Niels > > sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT NULL > ORDER BY src, ts LIMIT 5; > unexpected symbol (:) > > sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT NULL > ORDER BY src, ts LIMIT 5; > syntax error, unexpected '(', expecting SCOLON in: "select wlid, > inet.text(" > > I have read through the manual sections on types and functions several > times now, and I cannot see how to use the specified functions on these > types. Any help would be greatly appreciated. > > Thanks! > > -={C}=- > >
> _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
On Thu, May 23, 2013 at 02:45:27PM -0400, Christopher Nelson wrote:
cnelson@hpvm:/store/meps/db $ mclient -v mclient, the MonetDB interactive terminal (Feb2013-SP2) support for command-line editing compiled-in character encoding: UTF-8
cnelson@hpvm:/store/meps/db $ sudo monetdb version MonetDB Database Server Toolkit v1.1 (Feb2013-SP2)
Could you do a sql>select * from functions where name = 'text'; Should result in the following +------+------+---------------------------+------+-------+------+-------+------+ | id | name | func | mod | sql | type | side_ | sche | : : : : : : : effec : ma_i : : : : : : : : t : d : +======+======+===========================+======+=======+======+=======+======+ | 5246 | text | create function "text" (p | inet | true | 1 | false | 2000 | : : : inet) returns clob : : : : : : : : : external name inet."text : : : : : : : : : "; : : : : : : +------+------+---------------------------+------+-------+------+-------+------+ 1 tuple (3.183ms) sql> Niels
On Thu, May 23, 2013 at 2:41 PM, Niels Nes
wrote: On Thu, May 23, 2013 at 02:35:59PM -0400, Christopher Nelson wrote: > sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL > ORDER BY src, ts LIMIT 5; > SELECT: no such unary operator 'text(inet)'
The text function should be part of the 14_inet.sql file which is loaded the first time you start (the first) client. Which version are you running?
Niels > > > > On Thu, May 23, 2013 at 2:33 PM, Niels Nes
wrote: > > On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson wrote: > > Hi, > > > > I noticed in the manual that there are many useful functions for > the > > inet and url types. For example, I would like to convert an inet > column > > to text for use in a Python script (since the python-monetdb > module > > does not support the inet type.) > > > > I tried: > > > > sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL > ORDER > > BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON > in: > > "select wlid, text(" > > Text is a monetdb sql keyword, ie simply double quote text. > > ie > > SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL > ORDER > BY src, ts LIMIT 5; > > Niels > > > > sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER BY src, ts LIMIT 5; > > unexpected symbol (:) > > > > sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER BY src, ts LIMIT 5; > > syntax error, unexpected '(', expecting SCOLON in: "select wlid, > > inet.text(" > > > > I have read through the manual sections on types and functions > several > > times now, and I cannot see how to use the specified functions on > these > > types. Any help would be greatly appreciated. > > > > Thanks! > > > > -={C}=- > > > > > > > _______________________________________________ > > users-list mailing list > > users-list@monetdb.org > > http://mail.monetdb.org/mailman/listinfo/users-list > > > -- > Niels Nes, Centrum Wiskunde & Informatica (CWI) > Science Park 123, 1098 XG Amsterdam, The Netherlands > room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl > url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list > > > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
sql>select * from sys.functions where name = 'text';
+------+------+---------------------------------------------------+------+-------+------+-------+------+
| id | name | func | mod |
sql | type | side_ | sche |
: : : : :
: : effec : ma_i :
: : : : :
: : t : d :
+======+======+===================================================+======+=======+======+=======+======+
| 5246 | text | create function "text" (p inet) returns clob | inet |
true | 1 | false | 2000 |
: : : external name inet."text"; : :
: : : :
+------+------+---------------------------------------------------+------+-------+------+-------+------+
1 tuple (18.424ms)
On Thu, May 23, 2013 at 2:55 PM, Niels Nes
On Thu, May 23, 2013 at 02:45:27PM -0400, Christopher Nelson wrote:
cnelson@hpvm:/store/meps/db $ mclient -v mclient, the MonetDB interactive terminal (Feb2013-SP2) support for command-line editing compiled-in character encoding: UTF-8
cnelson@hpvm:/store/meps/db $ sudo monetdb version MonetDB Database Server Toolkit v1.1 (Feb2013-SP2)
Could you do a
sql>select * from functions where name = 'text';
Should result in the following
+------+------+---------------------------+------+-------+------+-------+------+ | id | name | func | mod | sql | type | side_ | sche | : : : : : : : effec : ma_i : : : : : : : : t : d :
+======+======+===========================+======+=======+======+=======+======+ | 5246 | text | create function "text" (p | inet | true | 1 | false | 2000 | : : : inet) returns clob : : : : : : : : : external name inet."text : : : : : : : : : "; : : : : : :
+------+------+---------------------------+------+-------+------+-------+------+ 1 tuple (3.183ms) sql>
Niels
On Thu, May 23, 2013 at 2:41 PM, Niels Nes
wrote: On Thu, May 23, 2013 at 02:35:59PM -0400, Christopher Nelson wrote: > sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL > ORDER BY src, ts LIMIT 5; > SELECT: no such unary operator 'text(inet)'
The text function should be part of the 14_inet.sql file which is loaded the first time you start (the first) client. Which version are you running?
Niels > > > > On Thu, May 23, 2013 at 2:33 PM, Niels Nes
wrote: > > On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson wrote: > > Hi, > > > > I noticed in the manual that there are many useful functions for > the > > inet and url types. For example, I would like to convert an inet > column > > to text for use in a Python script (since the python-monetdb > module > > does not support the inet type.) > > > > I tried: > > > > sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS NOT NULL > ORDER > > BY src, ts LIMIT 5;syntax error, unexpected '(', expecting SCOLON > in: > > "select wlid, text(" > > Text is a monetdb sql keyword, ie simply double quote text. > > ie > > SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT NULL > ORDER > BY src, ts LIMIT 5; > > Niels > > > > sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER BY src, ts LIMIT 5; > > unexpected symbol (:) > > > > sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER BY src, ts LIMIT 5; > > syntax error, unexpected '(', expecting SCOLON in: "select wlid, > > inet.text(" > > > > I have read through the manual sections on types and functions > several > > times now, and I cannot see how to use the specified functions on > these > > types. Any help would be greatly appreciated. > > > > Thanks! > > > > -={C}=- > > > > > > > _______________________________________________ > > users-list mailing list > > users-list@monetdb.org > > http://mail.monetdb.org/mailman/listinfo/users-list > > > -- > Niels Nes, Centrum Wiskunde & Informatica (CWI) > Science Park 123, 1098 XG Amsterdam, The Netherlands > room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl > url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list > > > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
On Thu, May 23, 2013 at 03:58:55PM -0400, Christopher Nelson wrote:
sql>select * from sys.functions where name = 'text'; +------+------+---------------------------------------------------+------+-------+------+-------+------+ | id | name | func | mod | sql | type | side_ | sche | : : : : : : : effec : ma_i : : : : : : : : t : d : +======+======+===================================================+==== ==+=======+======+=======+======+ | 5246 | text | create function "text" (p inet) returns clob | inet | true | 1 | false | 2000 | : : : external name inet."text"; : : : : : : +------+------+---------------------------------------------------+------+-------+------+-------+------+ 1 tuple (18.424ms)
Are you using a different schema (or default schema)? If so add inet. infront of the "text". That should resolve the function. Niels
On Thu, May 23, 2013 at 2:55 PM, Niels Nes
wrote: On Thu, May 23, 2013 at 02:45:27PM -0400, Christopher Nelson wrote: > cnelson@hpvm:/store/meps/db $ mclient -v > mclient, the MonetDB interactive terminal (Feb2013-SP2) > support for command-line editing compiled-in > character encoding: UTF-8 > > cnelson@hpvm:/store/meps/db $ sudo monetdb version > MonetDB Database Server Toolkit v1.1 (Feb2013-SP2)
Could you do a
sql>select * from functions where name = 'text';
Should result in the following
+------+------+---------------------------+------+-------+------+-------+------+ | id | name | func | mod | sql | type | side_ | sche | : : : : : : : effec : ma_i : : : : : : : : t : d : +======+======+===========================+======+=======+======+== =====+======+ | 5246 | text | create function "text" (p | inet | true | 1 | false | 2000 | : : : inet) returns clob : : : : : : : : : external name inet."text : : : : : : : : : "; : : : : : : +------+------+---------------------------+------+-------+------+-------+------+ 1 tuple (3.183ms) sql>
Niels
> > > > On Thu, May 23, 2013 at 2:41 PM, Niels Nes
wrote: > > On Thu, May 23, 2013 at 02:35:59PM -0400, Christopher Nelson wrote: > > sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER BY src, ts LIMIT 5; > > SELECT: no such unary operator 'text(inet)' > > The text function should be part of the 14_inet.sql file which is > loaded the first time you start (the first) client. Which version > are you running? > > Niels > > > > > > > > On Thu, May 23, 2013 at 2:33 PM, Niels Nes < Niels.Nes@cwi.nl> > wrote: > > > > On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson > wrote: > > > Hi, > > > > > > I noticed in the manual that there are many useful > functions for > > the > > > inet and url types. For example, I would like to convert an > inet > > column > > > to text for use in a Python script (since the > python-monetdb > > module > > > does not support the inet type.) > > > > > > I tried: > > > > > > sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS > NOT NULL > > ORDER > > > BY src, ts LIMIT 5;syntax error, unexpected '(', expecting > SCOLON > > in: > > > "select wlid, text(" > > > > Text is a monetdb sql keyword, ie simply double quote text. > > > > ie > > > > SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER > > BY src, ts LIMIT 5; > > > > Niels > > > > > > sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src > IS NOT > > NULL > > > ORDER BY src, ts LIMIT 5; > > > unexpected symbol (:) > > > > > > sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src > IS NOT > > NULL > > > ORDER BY src, ts LIMIT 5; > > > syntax error, unexpected '(', expecting SCOLON in: "select > wlid, > > > inet.text(" > > > > > > I have read through the manual sections on types and > functions > > several > > > times now, and I cannot see how to use the specified > functions on > > these > > > types. Any help would be greatly appreciated. > > > > > > Thanks! > > > > > > -={C}=- > > > > > > > > > > > _______________________________________________ > > > users-list mailing list > > > users-list@monetdb.org > > > http://mail.monetdb.org/mailman/listinfo/users-list > > > > > > -- > > Niels Nes, Centrum Wiskunde & Informatica (CWI) > > Science Park 123, 1098 XG Amsterdam, The Netherlands > > room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl > > url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl > > > > _______________________________________________ > > users-list mailing list > > users-list@monetdb.org > > http://mail.monetdb.org/mailman/listinfo/users-list > > > > > > > > > _______________________________________________ > > users-list mailing list > > users-list@monetdb.org > > http://mail.monetdb.org/mailman/listinfo/users-list > > > -- > Niels Nes, Centrum Wiskunde & Informatica (CWI) > Science Park 123, 1098 XG Amsterdam, The Netherlands > room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl > url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list > > > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
I was following the instructions on the "getting started" page, so yes, I
created a new schema. I will try that, thanks!
On Thu, May 23, 2013 at 4:51 PM, Niels Nes
On Thu, May 23, 2013 at 03:58:55PM -0400, Christopher Nelson wrote:
sql>select * from sys.functions where name = 'text';
+------+------+---------------------------------------------------+------+-------+------+-------+------+
| id | name | func | mod | sql | type | side_ | sche | : : : : : : : effec : ma_i : : : : : : : : t : d : +======+======+===================================================+==== ==+=======+======+=======+======+ | 5246 | text | create function "text" (p inet) returns clob | inet | true | 1 | false | 2000 | : : : external name inet."text"; : : : : : :
+------+------+---------------------------------------------------+------+-------+------+-------+------+
1 tuple (18.424ms)
Are you using a different schema (or default schema)? If so add inet. infront of the "text". That should resolve the function.
Niels
On Thu, May 23, 2013 at 2:55 PM, Niels Nes
wrote: On Thu, May 23, 2013 at 02:45:27PM -0400, Christopher Nelson wrote: > cnelson@hpvm:/store/meps/db $ mclient -v > mclient, the MonetDB interactive terminal (Feb2013-SP2) > support for command-line editing compiled-in > character encoding: UTF-8 > > cnelson@hpvm:/store/meps/db $ sudo monetdb version > MonetDB Database Server Toolkit v1.1 (Feb2013-SP2)
Could you do a
sql>select * from functions where name = 'text';
Should result in the following
+------+------+---------------------------+------+-------+------+-------+------+
| id | name | func | mod | sql | type | side_ | sche | : : : : : : : effec : ma_i : : : : : : : : t : d : +======+======+===========================+======+=======+======+== =====+======+ | 5246 | text | create function "text" (p | inet | true | 1 | false | 2000 | : : : inet) returns clob : : : : : : : : : external name inet."text : : : : : : : : : "; : : : : : :
+------+------+---------------------------+------+-------+------+-------+------+
1 tuple (3.183ms) sql>
Niels
> > > > On Thu, May 23, 2013 at 2:41 PM, Niels Nes
wrote: > > On Thu, May 23, 2013 at 02:35:59PM -0400, Christopher Nelson wrote: > > sql>SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER BY src, ts LIMIT 5; > > SELECT: no such unary operator 'text(inet)' > > The text function should be part of the 14_inet.sql file which is > loaded the first time you start (the first) client. Which version > are you running? > > Niels > > > > > > > > On Thu, May 23, 2013 at 2:33 PM, Niels Nes < Niels.Nes@cwi.nl> > wrote: > > > > On Thu, May 23, 2013 at 09:35:01AM -0400, Christopher Nelson > wrote: > > > Hi, > > > > > > I noticed in the manual that there are many useful > functions for > > the > > > inet and url types. For example, I would like to convert an > inet > > column > > > to text for use in a Python script (since the > python-monetdb > > module > > > does not support the inet type.) > > > > > > I tried: > > > > > > sql>SELECT wlid, text(src), ts FROM web_log WHERE src IS > NOT NULL > > ORDER > > > BY src, ts LIMIT 5;syntax error, unexpected '(', expecting > SCOLON > > in: > > > "select wlid, text(" > > > > Text is a monetdb sql keyword, ie simply double quote text. > > > > ie > > > > SELECT wlid, "text"(src), ts FROM web_log WHERE src IS NOT > NULL > > ORDER > > BY src, ts LIMIT 5; > > > > Niels > > > > > > sql>SELECT wlid, inet:text(src), ts FROM web_log WHERE src > IS NOT > > NULL > > > ORDER BY src, ts LIMIT 5; > > > unexpected symbol (:) > > > > > > sql>SELECT wlid, inet.text(src), ts FROM web_log WHERE src > IS NOT > > NULL > > > ORDER BY src, ts LIMIT 5; > > > syntax error, unexpected '(', expecting SCOLON in: "select > wlid, > > > inet.text(" > > > > > > I have read through the manual sections on types and > functions > > several > > > times now, and I cannot see how to use the specified > functions on > > these > > > types. Any help would be greatly appreciated. > > > > > > Thanks! > > > > > > -={C}=- > > > > > > > > > > > _______________________________________________ > > > users-list mailing list > > > users-list@monetdb.org > > > http://mail.monetdb.org/mailman/listinfo/users-list > > > > > > -- > > Niels Nes, Centrum Wiskunde & Informatica (CWI) > > Science Park 123, 1098 XG Amsterdam, The Netherlands > > room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl > > url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl > > > > _______________________________________________ > > users-list mailing list > > users-list@monetdb.org > > http://mail.monetdb.org/mailman/listinfo/users-list > > > > > > > > > _______________________________________________ > > users-list mailing list > > users-list@monetdb.org > > http://mail.monetdb.org/mailman/listinfo/users-list > > > -- > Niels Nes, Centrum Wiskunde & Informatica (CWI) > Science Park 123, 1098 XG Amsterdam, The Netherlands > room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl > url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list > > > > _______________________________________________ > users-list mailing list > users-list@monetdb.org > http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Christopher Nelson
-
Niels Nes