MySQL data types for net.loadbang-SQL

Apr 11, 2007 at 5:03pm

MySQL data types for net.loadbang-SQL

I’m using Nick Rothwell’s fantastic net.loadbang-SQL library to query and import data into Max 4.5. Everything is running fine until I try to import a db field that contains a text string greater than 255 characters. Basically, right now I’m able to query varchar and integer datatypes, but as soon as I try to query a field that contains data greater than 255 characters (ie. text, or blob), I receive errors from the mxj loadbang.net.sql object. The errors read “sql_type_-1″,”sql_type_-2″,etc… depending on which data type I try.

Is it possible to query data greater than 255 characters using the net.loadbang-SQL object?

Thanks,

B

#31313
Apr 12, 2007 at 12:29am

I had a similar problem with VARCHAR. I fixed it by enclosing the column name in double quotes:

Create table (“” TEXT)

If VARCHAR works for you, but not text or blob, Nick may have made changes that fixed VARCHAR but not the other formats, or it may be something else altogether.

Let me know if that works.

> —– Original Message —–
> From: brendan
> Subject: [maxmsp] MySQL data types for net.loadbang-SQL
> Date: Wed, 11 Apr 2007 11:03:20 -0600
>
>
>
> I’m using Nick Rothwell’s fantastic net.loadbang-SQL library to
> query and import data into Max 4.5. Everything is running fine
> until I try to import a db field that contains a text string
> greater than 255 characters. Basically, right now I’m able to query
> varchar and integer datatypes, but as soon as I try to query a
> field that contains data greater than 255 characters (ie. text, or
> blob), I receive errors from the mxj loadbang.net.sql object. The
> errors read “sql_type_-1″,”sql_type_-2″,etc… depending on which
> data type I try.
>
> Is it possible to query data greater than 255 characters using the
> net.loadbang-SQL object?
>
> Thanks,
>
> B

>

#101601
Apr 12, 2007 at 12:54am

I haven’t understood this thread until just this evening. Sounds very
interesting. I would like to look at N.R.’s net.loadbang-SQL. Where do I
find it?

On 4/11/07 8:29 PM, “Brian Willkie” wrote:

> I had a similar problem with VARCHAR. I fixed it by enclosing the column name
> in double quotes:
>
> Create table (“” TEXT)
>
> If VARCHAR works for you, but not text or blob, Nick may have made changes
> that fixed VARCHAR but not the other formats, or it may be something else
> altogether.
>
> Let me know if that works.
>
>> —– Original Message —–
>> From: brendan
>> Subject: [maxmsp] MySQL data types for net.loadbang-SQL
>> Date: Wed, 11 Apr 2007 11:03:20 -0600
>>
>>
>>
>> I’m using Nick Rothwell’s fantastic net.loadbang-SQL library to
>> query and import data into Max 4.5. Everything is running fine
>> until I try to import a db field that contains a text string
>> greater than 255 characters. Basically, right now I’m able to query
>> varchar and integer datatypes, but as soon as I try to query a
>> field that contains data greater than 255 characters (ie. text, or
>> blob), I receive errors from the mxj loadbang.net.sql object. The
>> errors read “sql_type_-1″,”sql_type_-2″,etc… depending on which
>> data type I try.
>>
>> Is it possible to query data greater than 255 characters using the
>> net.loadbang-SQL object?
>>
>> Thanks,
>>
>> B
>
>>
>
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#101602
Apr 12, 2007 at 1:24am

net.loadbang-SQL can be found here:

http://www.loadbang.net/space/Software/net.loadbang-SQL

On 4/11/07 8:54 PM, “Gary Lee Nelson” wrote:

> I haven’t understood this thread until just this evening. Sounds very
> interesting. I would like to look at N.R.’s net.loadbang-SQL. Where do I
> find it?
>
>
> On 4/11/07 8:29 PM, “Brian Willkie” wrote:
>
>> I had a similar problem with VARCHAR. I fixed it by enclosing the column name
>> in double quotes:
>>
>> Create table (“” TEXT)
>>
>> If VARCHAR works for you, but not text or blob, Nick may have made changes
>> that fixed VARCHAR but not the other formats, or it may be something else
>> altogether.
>>
>> Let me know if that works.
>>
>>> —– Original Message —–
>>> From: brendan
>>> Subject: [maxmsp] MySQL data types for net.loadbang-SQL
>>> Date: Wed, 11 Apr 2007 11:03:20 -0600
>>>
>>>
>>>
>>> I’m using Nick Rothwell’s fantastic net.loadbang-SQL library to
>>> query and import data into Max 4.5. Everything is running fine
>>> until I try to import a db field that contains a text string
>>> greater than 255 characters. Basically, right now I’m able to query
>>> varchar and integer datatypes, but as soon as I try to query a
>>> field that contains data greater than 255 characters (ie. text, or
>>> blob), I receive errors from the mxj loadbang.net.sql object. The
>>> errors read “sql_type_-1″,”sql_type_-2″,etc… depending on which
>>> data type I try.
>>>
>>> Is it possible to query data greater than 255 characters using the
>>> net.loadbang-SQL object?
>>>
>>> Thanks,
>>>
>>> B
>>
>>>
>>
>>
>
>
> Cheers
> Gary Lee Nelson
> Oberlin College
> http://www.timara.oberlin.edu/GaryLeeNelson
>
>

#101603
Apr 12, 2007 at 1:50am

http://www.loadbang.net/space/Software/net.loadbang-SQL

> —– Original Message —–
> From: “Gary Lee Nelson”
> To: Max
> Subject: Re: [maxmsp] MySQL data types for net.loadbang-SQL
> Date: Wed, 11 Apr 2007 20:54:51 -0400
>
>
> I haven’t understood this thread until just this evening. Sounds very
> interesting. I would like to look at N.R.’s net.loadbang-SQL. Where do I
> find it?
>
>
> On 4/11/07 8:29 PM, “Brian Willkie” wrote:
>
> > I had a similar problem with VARCHAR. I fixed it by enclosing the column name
> > in double quotes:
> >
> > Create table (“” TEXT)
> >
> > If VARCHAR works for you, but not text or blob, Nick may have made changes
> > that fixed VARCHAR but not the other formats, or it may be something else
> > altogether.
> >
> > Let me know if that works.
> >
> >> —– Original Message —–
> >> From: brendan
> >> Subject: [maxmsp] MySQL data types for net.loadbang-SQL
> >> Date: Wed, 11 Apr 2007 11:03:20 -0600
> >>
> >>
> >>
> >> I’m using Nick Rothwell’s fantastic net.loadbang-SQL library to
> >> query and import data into Max 4.5. Everything is running fine
> >> until I try to import a db field that contains a text string
> >> greater than 255 characters. Basically, right now I’m able to query
> >> varchar and integer datatypes, but as soon as I try to query a
> >> field that contains data greater than 255 characters (ie. text, or
> >> blob), I receive errors from the mxj loadbang.net.sql object. The
> >> errors read “sql_type_-1″,”sql_type_-2″,etc… depending on which
> >> data type I try.
> >>
> >> Is it possible to query data greater than 255 characters using the
> >> net.loadbang-SQL object?
> >>
> >> Thanks,
> >>
> >> B
> >
> >>
> >
> >
>
>
> Cheers
> Gary Lee Nelson
> Oberlin College
> http://www.timara.oberlin.edu/GaryLeeNelson
>
>

>

#101604
Apr 14, 2007 at 9:13pm

On 11 Apr 2007, at 18:03, brendan wrote:

> Basically, right now I’m able to query varchar and integer
> datatypes, but as soon as I try to query a field that contains data
> greater than 255 characters (ie. text, or blob), I receive errors
> from the mxj loadbang.net.sql object. The errors read
> “sql_type_-1″,”sql_type_-2″,etc… depending on which data type I try.

The actual Java SQL accessors for MySQL, HSQL, Derby or whatever
would be reasonably happy with most of the generic SQL data types
(the numbers come from java.sql.Types, btw), so things should be
relatively easy if you’re working in Java, but if you’re wanting to
build SQL queries in the Max world, and get results the same way,
then it’s not clear that there are reliable mappings between many of
various SQL types and the Max world of Atoms.

The current code base already supports LONGVARCHAR (-1) – I’ll check
that I’ve rolled this out to the web site – but I don’t know offhand
how well the various other bits of Max deal with symbols longer than
255 characters, so even if the MXJ objects are happy with them they
may not work in a wider context. As for -2 (BINARY), or the various
BLOB types: I’m not sure it makes sense to try and do Max symbol
conversions on them – what would you want to pass them to in the Max
world? At that stage, you really want to be working in Java, in order
to roll your own messaging between the database and Max.

– N.

Nick Rothwell / Cassiel.com Limited
http://www.cassiel.com
http://www.myspace.com/cassieldotcom
http://www.loadbang.net

#101605
Apr 14, 2007 at 9:14pm

On 12 Apr 2007, at 01:29, Brian Willkie wrote:

> I had a similar problem with VARCHAR. I fixed it by enclosing the
> column name in double quotes:
>
> Create table (“” TEXT)

I had a look at this workround when Brian first reported it. It’s not
totally clear to me why it works, but if it does, you should probably
stick with it…

– N.

Nick Rothwell / Cassiel.com Limited
http://www.cassiel.com
http://www.myspace.com/cassieldotcom
http://www.loadbang.net

#101606

You must be logged in to reply to this topic.