Thursday, 11 March 2004

Sybase output parameter issue with ColdFusion

Using Sybase 12.5 we have a stored procedure that
returns a string in an output parameter.

The Stored procedure is declared like

create proc sp_foobar
@pc_char1 char(10),
@pi_int1 int,
@pvc_vc1 varchar(512),
@pc_char2 char(6),
@pvc_vc2 varchar(40),
@pvc_vc3 varchar(255),
@pb_bit1 bit,
@pvc_vc4 varchar(20),
@pvc_return_code varchar(30) output
as


...

In ColdFusion, we were calling the stored procedure as follows.













But this throws an error,

[Macromedia][Sybase JDBC Driver][Sybase]Operand type clash: VARCHAR is incompatible with VOID TYPE

and it highlights the last cfprocparam (the output variable).as the issue

I worked out that if you pass it a value="" parameter, it stops it from failing.. ie



The sproc, in this example as part of it's internal logic/contract returns "SPROC_SUCCESS" as it's varchar, in @pvc_return_code. What Coldfusion puts in this
v_return_code is now equal to only the first letter. (ie 'S')

Hrmmm, .. so .. I worked a way around this one also... A Fix for this BUG .. make the 'value=""' a string as long as the string you expect to be returned. eg,



and then you would get #v_return_code# equal to "SPROC_SUCCESS"

Odd, any takers? Someone SURELY has seen this before.

Monday, 10 November 2003

(In)Sane Scanner for Linux

I'm blogging this one because I have needed it before today (this time being the 2nd time I have needed to know this info).

I have a BENQ 4300U USB Scanner, was $70 8 months a go and is still great.

Making it work with Linux is not too hard as some might think.
install the sane drivers .. (apt-get install sane) debian-esq

apt-get install xsane (the front gui scanning tool)


and now the firmware,

The sane driver (snapscan.sf.net) needs to know
how to talk to the scanner.
This is all in the scanner driver/bios/something file (i don't care much
for these details. I just need it to work .. gosh I'm changing :-), in the past
I would investigate everything..

so .. find this file on your windows install .. reference the table at snapscan.sf.net
My file is the u176v046.bin

How do I know this ?
Easy .. the device has a number, when you plug the USB scanner in, the linux USB drivers will
detect it and throw a message in /var/log/messages about such event.

In the log message, is the device number, which will correspond to the snapscan device id they know
about.. egc:

# dmesg | grep -i usb
... skip all this to the last lines ..
hub.c: new USB device 00:07.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x4a5/0x20b0) is not claimed by any active driver.

vendor id and product ID .. 0x4a5/0x20b0

These quite cheerily map to the table entry at the aforementioned driver website.

So Search for this file on your windows boxen.
Mine of course is u176v046.bin

So .. I created a directoy /usr/lib/sane/firmware (anyone know where else this is meant to go, seems good to me)

and then edit the /etc/sane.d/snapscan.conf file ,
at the top set the path to your firmware file.

restart xsane and hey presto ..

BUT, something has changed since I did this on the laptop.

As I understand it, previously, sane used to use an object file
scanner.o method to talk to the scanner.
now it is all via /proc/bus/usb, which debian rightly warned me,
only root has access to.

So, a quick check in /usr/src//Documentation/usb
grep usbfs reveals proc_usb.txt, in there reveals
that you set devmode=0666 for the mount and the device entry points will get
-rw-rw-rw-

so my now /etc/fstab entry for the /dev/usbfs looks like

none /proc/bus/usb usbfs defaults,devmode=0666 0 0


Hope that all helps someone (and me next time I have to do it again and forgot
how I did it last time).

cheerios.

Saturday, 11 October 2003

1RY CPU coolers for AMD are hard to find

I am currently in the process of building a lowish spec 1RU server for a project I'm working on.

The Server spec is an AMD XP 2000+ 512MB RAM and IDE Disks. (big whoop I hear - I told you it was low spec).

SO anyways, a 1RU server needs a 1RU CPU heat sink and fan.

the AMD Chip was the lowest in the Athlon range at the moment. I think it's around 1.6Ghz
but, being the lower end, puts it in the workstation class of course, so do you think I
could find a CPU heat sink and fan for it easy. Nope, issue was (here is Aussie World) that
most suppliers won;t stock it, not a "fast moving item".

Since it is a 'desktop' class CPU most people just answered, "Nope, don't have any, won't have any"

So anyway, thanks to the nice mag I buy monthly (just to keep my ear on the hardware ground)
Computer Market (not related to www.computermarket.com.au)
(where was I.. ). Yeah, this mag, I find an ad
for some guy selling lots of Fan stuff. This is after 2 weeks of calling about 20 suppliers,
going straight to thermaltake.com.au in Melbourne even and asking them. (it's one of their fans I was
after)

This guy, www.comparts.com.au had one of the Tsunami fans I wanted.
A Socket 462 AMD Athlon 1U (1RU) Heatsink and fan.So $40 later it should be in my mailbox on Monday.

I'd just like to add that so far service from there is great!

Also, the 1RU case I have purchased (if your interested also)
was a good buy..
1RU server case: Maccase 101 1RU ATX Case
From: Online Marketing Pty Ltd (Sydney - Often good prices)
Direct Product Listing here

Wednesday, 8 October 2003

Had a birthday the other day

As you do most every year, I have had my 28th birthday.

Got myself a CD or two
* Grandaddy's 2003 album, title escapes me. Fine listening there
* The Beatles White Album (laying now)

some parfume (is it perfume for guys or aftershave ?) some nice
smelly Gucci Stuff that is.. and an egg cooker. Bit of a funny
one that..

Growing up my mum had a Sunbeam Egg Center. It cooked your eggs. :-)
It was shaped like a flying saucer (like a bad B-Grade Movie FLying Saucer).

The eggs sat it a tray (5 or 6 I think). You filled the lid (had a measure
in it) to your desired 'softness', poured that water into tha base,
turned it on and waited.

I gues it detects a rise in temp to know when it's boiled off all the water.

Anyway, a few months back, that got me thinking (I was never getting the
cooked egg thing right by guessing the timing).
I grabbed a saucepan, put in 1/2 cup of water, but on top of the saucepan
the 'asian style' steamer (made of bamboo). Put in my 4 eggs (standard issue
700 grammers).

Put on the lid, gas on high, and waited.

I waited probably 5 minutes, the trick I figured was, given I got the amount
of water correct, all I had to do was listen and detect the lack of
water in my pot.

First few goes weren;t too bad, overcooked them really. I like
a soft/mushy centre.

SO .. I worked out that 1/2 a cup of water was just right, and you
could just hear when there was no more boiling
water, thus eggs a ready.

BUT, I wanted a better way. My next thought (untested) is to put
in the saucepan (with the water), some light balls, like ceramic
balls the size of marbles. This way, they would get tossed by the water
making a sound until the water is no more, then you know the eggs
are ready. reduce the amount of water to soften your eggs etc..

So little beknownst to I, Sara had bought me a 'real egg cooker'

It's shaped like a chicken, fancy that. and it cheeps when the eggs are
ready.

Ahh the joys of the XBox

Just today, I've noticed my xbox has stopped a responding on the network.
Not hardware related as the EvoX menu responds with pings (Phew).

Bit of a fiddle here and there, looks like my XBox ethernet card is failing
to be picked up by the kernel.

No matter, on to debian xbox 0.4.1 I say.

I installed this on my brothers XBox and it went ithout a hitch,
my issue is going to be if it will allow me to install over the top of the existing filesystem
since I have my full datastore on there.

I _think_ it's time to get the datastore (aka my 80G drive) _out_ of the XBox and back
into the server. Im a little nervous about not having that nice control
of the drive when it's in the XBox. Putting it on
the server again means I can still have nfs'd.

Ahh ramblings. .. and All I want to do is get on with the other big project
Im working on.

Bah!

Current 5 booksmarks @ del.icio.us/pefdus