Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

ODBC

 [1/21] from: gchiu::compkarori::co::nz at: 10-Dec-2000 11:15


spoke too soon, here the first and fourth inserts work insertrecs: func [] [ insert db-port [ {insert into reboltest (fname ) values ("GRAHAM" )} ] firstname: "Joe" dob: 10-Dec-1950 insert db-port [ {insert into reboltest (fname, birthday) values (?, ?)} firstname dob ] firstname: "Josephine " dob: 10-Dec-1940 insert db-port [ {insert into reboltest (fname, birthday) values (?, ?)} firstname dob ] insert db-port [ {insert into reboltest (fname, birthday) values ("Allen", ?)} to-date "31-Dec-1957" ] ] but where I pass the fname as a variable, I get scrambed data back. -- Graham Chiu

 [2/21] from: gchiu:compkarori at: 10-Dec-2000 10:07


Oops, forget that last message. I see where I've gone wrong. -- Graham Chiu

 [3/21] from: ric_shepard:fishgame:state:ak:us at: 9-Dec-2000 14:21


Your 'scrambled' dat is probably the result of passing 'unquoted' string data to ODBC/ SQL. what you have: >> firstname: "Joe" == "Joe"
>> print firstname
Joe what you need: >> firstname: {"Joe"} == {"Joe"}
>> print firstname
"Joe" so, try this: firstname: {"Joe"} insert db-port [{INSERT INTO reboltest (fname) VALUES (?)} firstname] should make all the difference. Graham Chiu wrote:
> spoke too soon, here the first and fourth inserts work > insertrecs: func [] [
<<quoted lines omitted: 17>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Binary/unsupported file stripped by Listar -- -- Type: text/x-vcard -- File: ric_shepard.vcf -- Desc: Card for Ric Shepard

 [4/21] from: gchiu:compkarori at: 10-Dec-2000 13:06


On Sat, 09 Dec 2000 14:21:01 -0900 Ric Shepard <[ric_shepard--fishgame--state--ak--us]> wrote:
> Your 'scrambled' dat is probably the result of passing > 'unquoted'
<<quoted lines omitted: 4>>
> (?)} firstname] > should make all the difference.
Unfortunately, it makes no difference. The ODBC examples are similar to what I have done here. -- Graham Chiu

 [5/21] from: allenk:powerup:au at: 10-Dec-2000 19:51


----- Original Message ----- From: "Graham Chiu" <[gchiu--compkarori--co--nz]> To: <[rebol-list--rebol--com]> Sent: Sunday, December 10, 2000 10:06 AM Subject: [REBOL] Re: ODBC
> On Sat, 09 Dec 2000 14:21:01 -0900 > Ric Shepard <[ric_shepard--fishgame--state--ak--us]> wrote:
<<quoted lines omitted: 11>>
> Unfortunately, it makes no difference. The ODBC examples > are similar to what I have done here.
Have you checked to see if the date format is the same for the database and your local machine? I've had this problem with databases on servers that are running in a US time zone, when using ASP. So would assume it is also possible problem with command. If you are having trouble using named values like above, why not create the standard SQL string yourself. firstname: "Joe" insert db-port rejoin ["INSERT INTO reboltest (fname) VALUES ('" firstname ') ] To me this is the beauty of the REBOL/Command odbc interface. A connection,a command port and SQL. Much simpler than the multiple methods and objects of ADO. Cheers, Allen K

 [6/21] from: gchiu:compkarori at: 10-Dec-2000 23:11


On Sat, 09 Dec 2000 14:21:01 -0900 Ric Shepard <[ric_shepard--fishgame--state--ak--us]> wrote:
> Your 'scrambled' dat is probably the result of passing > 'unquoted' > string data to ODBC/ SQL.
I've isolated the problem, and it's a Rebol bug. I'll send it to feedback. -- Graham Chiu

 [7/21] from: sqlab:gmx at: 10-Dec-2000 15:06


There are more bugs with Rebol/Command handling certain SQL datatypes. Take also into account, that almost every database handles even strings differently and/or has more than one character datatype. If I remember right, RT named only a few DB system working correctly with their ODBC API. I know DB systems, where Rebol/Command could not connect or retrieve records. AR
> I've isolated the problem, and it's a Rebol bug. > I'll send it to feedback.
<<quoted lines omitted: 4>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Sent through GMX FreeMail - http://www.gmx.net

 [8/21] from: petr:krenzelok:trz:cz at: 10-Dec-2000 16:39


----- Original Message ----- From: <[sqlab--gmx--net]> To: <[rebol-list--rebol--com]> Sent: Sunday, December 10, 2000 3:06 PM Subject: [REBOL] Re: ODBC
> There are more bugs with Rebol/Command handling certain SQL datatypes. > Take also into account, that almost every database handles even strings
<<quoted lines omitted: 3>>
> or > retrieve records.
So go and report it to feedback .... -pekr-

 [9/21] from: ric_shepard:fishgame:state:ak:us at: 10-Dec-2000 9:19


Glad to see you've found the problem. I've had no success trying to reproduce it, here. One thing, though - I found that my recommendation (double-quoting the strings) was bad advice (unless you want quoted text in your database). Sorry about that. Graham Chiu wrote:
> On Sat, 09 Dec 2000 14:21:01 -0900 > Ric Shepard <[ric_shepard--fishgame--state--ak--us]> wrote:
<<quoted lines omitted: 9>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ric Shepard <[ric_shepard--fishgame--state--ak--us]> Microcomputer/Network Specialist Alaska Department of Fish and Game

 [10/21] from: ric_shepard:fishgame:state:ak:us at: 10-Dec-2000 9:28


Do you have any specifics on the bugs with certain SQL datatypes? We're running REBOL/Command on Windows/NT workstation talking to PostgreSQL 7.0.2 on NetBSD. The ODBC driver is the 'stock' Win32 postodbc driver. So far, this has been an excellent setup for producing reports. Far faster (and IMHO far more flexible) than either Access or R:Base 2000 (the other 'front-ends' we use) when dealing with an SQL server and above average (million+ rows) size tables. So far - we haven't had *any* trouble with Rebol/ODBC. But, since we're about to start using Rebol for datbase updates as well, if you know of specific trouble spots a heads up would be appreciated. TIA [sqlab--gmx--net] wrote:
> There are more bugs with Rebol/Command handling certain SQL datatypes. > Take also into account, that almost every database handles even strings
<<quoted lines omitted: 22>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ric Shepard <[ric_shepard--fishgame--state--ak--us]> Microcomputer/Network Specialist Alaska Department of Fish and Game

 [11/21] from: gchiu:compkarori at: 11-Dec-2000 7:56


On Sun, 10 Dec 2000 09:19:02 -0900 Ric Shepard <[ric_shepard--fishgame--state--ak--us]> wrote:
> Glad to see you've found the problem. I've had no > success
<<quoted lines omitted: 3>>
> bad > advice (unless you want quoted text in your database).
create-table1: "insert db-port [ {create table reboltest ( fname char(20) not null primary key, birthday timestamp default 'NOW' ) } ]" create-table4: "insert db-port [ {create table reboltest ( fname varchar(20) not null primary key, birthday timestamp default 'NOW' ) } ]" I isolated it to the char(20) field. If I change fname to varchar(20), then the character scrambling goes away. -- Graham Chiu

 [12/21] from: gchiu:compkarori at: 11-Dec-2000 20:23


On Sun, 10 Dec 2000 19:51:40 +1000 "Allen Kamp" <[allenk--powerup--com--au]> wrote: Hi Allen, I'm not sure that this will work with other than character data as Rebol won't accept quoted date strings, and wants a date datatype to insert into date fields. But since the problem is just with char fields, I guess what I just said is not relevant! Better if RT debug their ODBC interface. -- Graham Chiu

 [13/21] from: sqlab:gmx at: 11-Dec-2000 9:42


> spoke too soon, here the first and fourth inserts work > insertrecs: func [] [
<<quoted lines omitted: 14>>
> Graham Chiu > --
Probably char fields expect you to fill the remaining space with <spaces> up to the end of the field. We are not always talking about C-strings. AR -- Sent through GMX FreeMail - http://www.gmx.net

 [14/21] from: sqlab:gmx at: 11-Dec-2000 9:37


> ----- Original Message ----- > From: <[sqlab--gmx--net]>
<<quoted lines omitted: 14>>
> So go and report it to feedback .... > -pekr-
I did that months ago and even how to handle them right. AR -- Sent through GMX FreeMail - http://www.gmx.net

 [15/21] from: sqlab:gmx at: 11-Dec-2000 9:58


> Do you have any specifics on the bugs with certain SQL datatypes? > We're running REBOL/Command on Windows/NT workstation talking to
<<quoted lines omitted: 8>>
> you know of specific trouble spots a heads up would be appreciated. > TIA
I remember just without access to the bug reports I sent to Rebol, that Rebol/Command can not handle Streams with Cache at all (an implementation specific datatype also known as LONGVARBINARY an/or LONGVARCHAR), and gives under certain conditions wrong values for numeric datatypes. I don't remember BIT fields, but I guess there is a problem too. I will not tell about the results I had trying to access NonStopSQL with Rebol/Command. If you want to check how compatible Rebol/Comand is, run "Make Table" in ODBC Test (ANSI) with your choosen database and try to work with that table. AR -- Sent through GMX FreeMail - http://www.gmx.net

 [16/21] from: gchiu:compkarori at: 11-Dec-2000 22:24


On Mon, 11 Dec 2000 09:42:18 +0100 (MET) [sqlab--gmx--net] wrote:
> Probably char fields expect you to fill the remaining > space with <spaces> > up to the end of the field. > We are not always talking about C-strings. >
That was one of the first things I tried ... no success. I didn't think it would work as the head of the string is also garbled. -- Graham Chiu

 [17/21] from: gchiu:compkarori at: 11-Dec-2000 22:26


On Mon, 11 Dec 2000 09:58:19 +0100 (MET) [sqlab--gmx--net] wrote:
> I remember just without access to the bug reports I sent > to Rebol, that
<<quoted lines omitted: 6>>
> datatypes. I don't > remember BIT fields, but I guess there is a problem too.
I haven't been able to insert blob data either yet. -- Graham Chiu

 [18/21] from: gchiu:compkarori at: 12-Dec-2000 13:01


This is very odd. I can't retrieve any numeric fields thru ODBC unless I first cast them into char(). I had not tried this before so had not noticed this. On the bright side, inserting data thru ODBC and R/command seems to be a lot faster than how I normally do it going thru Visual dBase - as long as I stick to varchar fields. -- Graham Chiu

 [19/21] from: sterling:rebol at: 11-Dec-2000 20:29


I checked into these things a bit and there are definite issues with Interbase. It isn't one of the DBs we tested with so we didn't catch the problems. They probably affect other dbs too... we just haven't seen it yet... thanks for the help. The problem will get fixed in the next rev of /Command but don't ask me when that is... 'cuz I don't know. :( Sterling

 [20/21] from: gchiu:compkarori at: 12-Dec-2000 20:32


On Mon, 11 Dec 2000 20:29:26 -0800 [sterling--rebol--com] wrote:
> The problem will get fixed in the next rev of /Command > but don't ask > me when that is... 'cuz I don't know. :( > > Sterling >
Hope it gets fixed before my eval copy expires <g> -- Graham Chiu

 [21/21] from: dragongw:yaho:o at: 12-Dec-2000 7:13


did you send this to me? --- [sterling--rebol--com] wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted