[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ODBC and Ruby

Lorenzo

11/23/2007 1:51:00 PM

hello, I'm new in ruby, I've problems conneting ruby odbc with informix
db, in tbles with thousand records my program always retruns no rows,

this is the test program:

sth=c.prepare("select * from anopta")

sth.execute
if sth.ncols == 0 then
puts "Statement has no result set"
printf "Number of rows affected: %d\n", sth.nrows
else
puts "Statement has a result set"
sth.fetch_all
printf "Number of rows: %d\n", sth.nrows
printf "Number of columns: %d\n", sth.ncols
end


this is the output

Statement has a result set
Number of rows: -1
Number of columns: 5

The table has 5 colums and 300 rows

I don't know if this problem is specific for informix databases

thank u very much


10 Answers

Gerardo Santana Gómez Garrido

11/23/2007 4:32:00 PM

0

Hello Lorenzo,

On Nov 23, 2007 7:55 AM, lorenzo <me@me.it> wrote:
> hello, I'm new in ruby, I've problems conneting ruby odbc with informix
> db, in tbles with thousand records my program always retruns no rows,
>
> this is the test program:
>
> sth=c.prepare("select * from anopta")
>
> sth.execute
> if sth.ncols == 0 then
> puts "Statement has no result set"
> printf "Number of rows affected: %d\n", sth.nrows
> else
> puts "Statement has a result set"
> sth.fetch_all
> printf "Number of rows: %d\n", sth.nrows
> printf "Number of columns: %d\n", sth.ncols
> end
>
>
> this is the output
>
> Statement has a result set
> Number of rows: -1
> Number of columns: 5
>
> The table has 5 colums and 300 rows
>
> I don't know if this problem is specific for informix databases
>
> thank u very much

May I suggest you to try the Informix extension instead?

http://ruby-informix.rub...

--
Gerardo Santana

lorenzo

11/23/2007 5:16:00 PM

0

On 2007-11-23 17:32:25 +0100, Gerardo Santana Gómez Garrido
<gerardo.santana@gmail.com> said:
Hello,
Is not so easy, I'm using Macosx and I don' have informix sdk for it
Have you any ideas?
Thank you :)


> Hello Lorenzo,
>
> On Nov 23, 2007 7:55 AM, lorenzo <me@me.it> wrote:
>> hello, I'm new in ruby, I've problems conneting ruby odbc with informix
>> db, in tbles with thousand records my program always retruns no rows,
>>
>> this is the test program:
>>
>> sth=c.prepare("select * from anopta")
>>
>> sth.execute
>> if sth.ncols == 0 then
>> puts "Statement has no result set"
>> printf "Number of rows affected: %d\n", sth.nrows
>> else
>> puts "Statement has a result set"
>> sth.fetch_all
>> printf "Number of rows: %d\n", sth.nrows
>> printf "Number of columns: %d\n", sth.ncols
>> end
>>
>>
>> this is the output
>>
>> Statement has a result set
>> Number of rows: -1
>> Number of columns: 5
>>
>> The table has 5 colums and 300 rows
>>
>> I don't know if this problem is specific for informix databases
>>
>> thank u very much
>
> May I suggest you to try the Informix extension instead?
>
> http://ruby-informix.rub...


Gerardo Santana Gómez Garrido

11/23/2007 5:50:00 PM

0

On Nov 23, 2007 11:20 AM, lorenzo <quadrilor@mac.com> wrote:
> On 2007-11-23 17:32:25 +0100, Gerardo Santana G=F3mez Garrido
> <gerardo.santana@gmail.com> said:
> Hello,
> Is not so easy, I'm using Macosx and I don' have informix sdk for it

I see.

> Have you any ideas?
> Thank you :)

Yes. I have just remembered (I used to use ruby-odbc with Informix two
years ago) that nrows didn't return any useful value to me for
Informix. Ignore it. You can't know how many records a SELECT returns
in Informix before fetching them.

--=20
Gerardo Santana

lorenzo

11/23/2007 7:18:00 PM

0

On 2007-11-23 18:50:22 +0100, Gerardo Santana Gómez Garrido
<gerardo.santana@gmail.com> said:

> On Nov 23, 2007 11:20 AM, lorenzo <quadrilor@mac.com> wrote:
>> On 2007-11-23 17:32:25 +0100, Gerardo Santana Gómez Garrido
>> <gerardo.santana@gmail.com> said:
>> Hello,
>> Is not so easy, I'm using Macosx and I don' have informix sdk for it
>
> I see.
>
>> Have you any ideas?
>> Thank you :)
>
> Yes. I have just remembered (I used to use ruby-odbc with Informix two
> years ago) that nrows didn't return any useful value to me for
> Informix. Ignore it. You can't know how many records a SELECT returns
> in Informix before fetching them.

Yes, but querying the table, the rs seems to be empty, ruby give me
warning message for no methods for NilClass in each. So I supose the rs
is empty, anywhere nrows doesn't work you are right.

Anim8rFSK

11/2/2013 8:19:00 PM

0

In article <l538ne$7l6$1@dont-email.me>,
John McWilliams <jpmcw@comcast.net> wrote:

> On 11/1/13 PDT, 10:35 PM, Adam H. Kerman wrote:
> > RichA <rander3127@gmail.com> wrote:
> >
> >> A radioactive source designed to act in a dirty bomb. The Cobalt-60
> >> source was fine, it's can be a potent radioactive element. However, if
> >> the source was large enough and capable of being blown up and
> >> effectively contaminating a five mile radius, anyone in proximity to the
> >> source for any length of time would be killed. Also, the car in which
> >> it was housed would not provide any kind of shielding, the source would
> >> have to be housed in a couple tons of lead.
> >> Meanwhile, the agent accelerates the contaminated car fast for about 7
> >> seconds, but is still able to jump out of it and sustain no injuries.
> >> Are they putting Smart Car engines in German performance cars now?
> >
> > I couldn't understand why contaminating the water was desireable or
> > how it shielded anyone on land.

Because a wimmin suggested it. If a man had said that the water would
contain the radiation, they'd have pointed and laughed or maybe shot him
dead for good measure.
>
> Just don't eat the clams or mussels!
>
> Did he put the windows down? Otherwise, a well made modern car could
> take quite a few minutes to sink....
>
> I was more intrigued by the bomb timer, and it made me ask myself this:
> Has a bomb with a visible timer ever been disarmed with more than a few
> seconds remaining? I can't recall any.
>
> Also: Has anyone on a bomb squad gone chicken in the last ten seconds
> and run away screaming??

Gibbs.

--
Wait - are you saying that ClodReamer was wrong, or lying?

Cat_in_awe

11/4/2013 3:54:00 PM

0

Adam H. Kerman wrote:
> RichA <rander3127@gmail.com> wrote:
>
>> A radioactive source designed to act in a dirty bomb. The Cobalt-60
>> source was fine, it's can be a potent radioactive element. However,
>> if the source was large enough and capable of being blown up and
>> effectively contaminating a five mile radius, anyone in proximity to
>> the source for any length of time would be killed. Also, the car in
>> which it was housed would not provide any kind of shielding, the
>> source would have to be housed in a couple tons of lead.
>> Meanwhile, the agent accelerates the contaminated car fast for about
>> 7 seconds, but is still able to jump out of it and sustain no
>> injuries. Are they putting Smart Car engines in German performance
>> cars now?
>
> I couldn't understand why contaminating the water was desireable or
> how it shielded anyone on land.

That's how radioactivity is contained in reactors, immersing the
uranium/plutonium/whatever in water. Water 'captures', for lack of a better
word, all the particles being emitted.

Granted, you wouldn't want to go swimming in the bay for a while.


Cat_in_awe

11/4/2013 3:55:00 PM

0

John McWilliams wrote:
> On 11/1/13 PDT, 10:35 PM, Adam H. Kerman wrote:
>> RichA <rander3127@gmail.com> wrote:
>>
>>> A radioactive source designed to act in a dirty bomb. The Cobalt-60
>>> source was fine, it's can be a potent radioactive element. However, if
>>> the source was large enough and capable of being blown
>>> up and effectively contaminating a five mile radius, anyone in
>>> proximity to the source for any length of time would be killed. Also,
>>> the car in which it was housed would not provide any kind of
>>> shielding, the source would have to be housed in a couple tons of
>>> lead. Meanwhile, the agent accelerates the contaminated car fast for
>>> about 7 seconds, but is still able to jump out of it and sustain no
>>> injuries. Are they putting Smart Car engines in German performance
>>> cars now?
>>
>> I couldn't understand why contaminating the water was desireable or
>> how it shielded anyone on land.
>
> Just don't eat the clams or mussels!
>
> Did he put the windows down? Otherwise, a well made modern car could
> take quite a few minutes to sink....
>
> I was more intrigued by the bomb timer, and it made me ask myself
> this: Has a bomb with a visible timer ever been disarmed with more
> than a few seconds remaining? I can't recall any.

And exactly who's benefit is being considered when installing the large
digit, bright red countdown timer. (Snark in every show with every bomb
every made.)



Capricorne

11/4/2013 4:05:00 PM

0

WrongWayWade wrote :
> John McWilliams wrote:
>> On 11/1/13 PDT, 10:35 PM, Adam H. Kerman wrote:
>>> RichA <rander3127@gmail.com> wrote:
>>>
>>>> A radioactive source designed to act in a dirty bomb. The Cobalt-60
>>>> source was fine, it's can be a potent radioactive element. However, if
>>>> the source was large enough and capable of being blown
>>>> up and effectively contaminating a five mile radius, anyone in
>>>> proximity to the source for any length of time would be killed. Also, the
>>>> car in which it was housed would not provide any kind of
>>>> shielding, the source would have to be housed in a couple tons of
>>>> lead. Meanwhile, the agent accelerates the contaminated car fast for
>>>> about 7 seconds, but is still able to jump out of it and sustain no
>>>> injuries. Are they putting Smart Car engines in German performance
>>>> cars now?
>>>
>>> I couldn't understand why contaminating the water was desireable or
>>> how it shielded anyone on land.
>>
>> Just don't eat the clams or mussels!
>>
>> Did he put the windows down? Otherwise, a well made modern car could
>> take quite a few minutes to sink....
>>
>> I was more intrigued by the bomb timer, and it made me ask myself
>> this: Has a bomb with a visible timer ever been disarmed with more
>> than a few seconds remaining? I can't recall any.
>
> And exactly who's benefit is being considered when installing the large
> digit, bright red countdown timer. (Snark in every show with every bomb
> every made.)

Oh yeah, and what about the color of the wires? lol


Adam H. Kerman

11/4/2013 11:51:00 PM

0

WrongWayWade <rl3166pls@excite.com> wrote:
>Adam H. Kerman wrote:
>>RichA <rander3127@gmail.com> wrote:

>>>A radioactive source designed to act in a dirty bomb. The Cobalt-60
>>>source was fine, it's can be a potent radioactive element. However,
>>>if the source was large enough and capable of being blown up and
>>>effectively contaminating a five mile radius, anyone in proximity to
>>>the source for any length of time would be killed. Also, the car in
>>>which it was housed would not provide any kind of shielding, the
>>>source would have to be housed in a couple tons of lead.
>>>Meanwhile, the agent accelerates the contaminated car fast for about
>>>7 seconds, but is still able to jump out of it and sustain no
>>>injuries. Are they putting Smart Car engines in German performance
>>>cars now?

>>I couldn't understand why contaminating the water was desireable or
>>how it shielded anyone on land.

>That's how radioactivity is contained in reactors, immersing the
>uranium/plutonium/whatever in water. Water 'captures', for lack of a better
>word, all the particles being emitted.

>Granted, you wouldn't want to go swimming in the bay for a while.

Well... that's a container. You're sure it wouldn't dissipate or escape
into the atmosphere upon exploding?

Cat_in_awe

11/5/2013 3:19:00 PM

0

Adam H. Kerman wrote:
> WrongWayWade <rl3166pls@excite.com> wrote:
>> Adam H. Kerman wrote:
>>> RichA <rander3127@gmail.com> wrote:
>
>>>> A radioactive source designed to act in a dirty bomb. The
>>>> Cobalt-60 source was fine, it's can be a potent radioactive
>>>> element. However, if the source was large enough and capable of
>>>> being blown up and effectively contaminating a five mile radius,
>>>> anyone in proximity to the source for any length of time would be
>>>> killed. Also, the car in which it was housed would not provide
>>>> any kind of shielding, the source would have to be housed in a
>>>> couple tons of lead.
>>>> Meanwhile, the agent accelerates the contaminated car fast for
>>>> about 7 seconds, but is still able to jump out of it and sustain no
>>>> injuries. Are they putting Smart Car engines in German performance
>>>> cars now?
>
>>> I couldn't understand why contaminating the water was desireable or
>>> how it shielded anyone on land.
>
>> That's how radioactivity is contained in reactors, immersing the
>> uranium/plutonium/whatever in water. Water 'captures', for lack of
>> a better word, all the particles being emitted.
>
>> Granted, you wouldn't want to go swimming in the bay for a while.
>
> Well... that's a container. You're sure it wouldn't dissipate or
> escape into the atmosphere upon exploding?

If it was deep enough, you'd avoid the vast majority of airborne
contamination. The way it looked on the show, though, it was barely
submerged when it went off. Still much better than just sitting there
watching it go off on the dock. Remember, a dirty bomb is supposed to send
tiny fragments of the radioactive stuff miles wide because of the explosion;
having it go off underwater would be very helpful in avoiding that.