Sybase stored procs from ADO
Author
Discussion

jimothy

Original Poster:

5,151 posts

267 months

Thursday 19th January 2006
quotequote all
Got a weird one...

I have a Sybase stored proc. When I call this from a SQL tool (RapidSQL in this case) it works. But when I make the same call from ADO it fails.

Has anybody come across such an issue before? Is there anything special I need to do to get ADO working with Sybase properly. Standard SQL statements work fine, just this stored proc...

Thanks

sybaseian

1,826 posts

305 months

Thursday 19th January 2006
quotequote all
jimothy said:
Got a weird one...

I have a Sybase stored proc. When I call this from a SQL tool (RapidSQL in this case) it works. But when I make the same call from ADO it fails.

Has anybody come across such an issue before? Is there anything special I need to do to get ADO working with Sybase properly. Standard SQL statements work fine, just this stored proc...

Thanks


1. Make sure that you are using the same login

2. Make sure that you are calling the correct proc in the correct database.

Sybase firstly looks in your current database for a named proc, if it can't find a match within this database it then looks in sybsystemprocs database - could be that you are in the wrong database and there is another proc with the same name in sybsystemprocs.

to make sure you could try:-

exec <dbname>.<procname>

exec testdatabase.newproc



[exec[ute]] [@return_status = ]
[[[server .]database.]owner.]procedure_name[;number]
[[@parameter_name =] value |
[@parameter_name =] @variable [output]
[,[@parameter_name =] value |
[@parameter_name =] @variable [output]...]]
[with recompile]

sybaseian

1,826 posts

305 months

Thursday 19th January 2006
quotequote all
What error messages are you getting?

jimothy

Original Poster:

5,151 posts

267 months

Thursday 19th January 2006
quotequote all
It's definately the right proc that is being called.

Basically, the proc does some inserts/updates to a table, then checks that these inserts/updates have worked. If they don't work, then proc rolls back and returns an error code.

When it's run from isql etc. it works fine and returns 0
When its run from ADO it returns the error code. So I've no idea whats going wrong. it appears to work up to a point, but not actually do the insert on the table.

Unfortunatly there's no Sybase error being reported that can help...

sybaseian

1,826 posts

305 months

Thursday 19th January 2006
quotequote all
can you run any other procs/SQL from ADO?

jimothy

Original Poster:

5,151 posts

267 months

Thursday 19th January 2006
quotequote all
sybaseian said:
can you run any other procs/SQL from ADO?


I haven't tried any other procs, but have run normal SQL (a stack of deletes) and these run fine...

sybaseian

1,826 posts

305 months

Thursday 19th January 2006
quotequote all

do you have dba priv?

jimothy

Original Poster:

5,151 posts

267 months

Friday 20th January 2006
quotequote all
sybaseian said:

do you have dba priv?


Unfortuantely not, as a mere monkey I have no sa rights and can't even change the proc I'm calling

sybaseian

1,826 posts

305 months

Friday 20th January 2006
quotequote all
jimothy said:
sybaseian said:

do you have dba priv?


Unfortuantely not, as a mere monkey I have no sa rights and can't even change the proc I'm calling


OK - that's going to be a major problem. You will have to go and talk to the DBAs and get them to investigate further.

Ian

jimothy

Original Poster:

5,151 posts

267 months

Friday 20th January 2006
quotequote all
sybaseian said:
jimothy said:
sybaseian said:

do you have dba priv?


Unfortuantely not, as a mere monkey I have no sa rights and can't even change the proc I'm calling


OK - that's going to be a major problem. You will have to go and talk to the DBAs and get them to investigate further.

Ian


Great - they're outsourced so English isn't their first or even second language

Thanks for all you help, and nice car

chim_knee

12,689 posts

287 months

Friday 20th January 2006
quotequote all
Can you post the ADO code? Also, what's the error you get returned?