Sybase ASE - Output parameters for procedures

Posts   
 
    
erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 01:14:42   

Hi ,

I read this confused :

"Output parameters for procedures aren’t recognized, as Sybase ASE doesn’t store this information in the meta-data, so output parameters are always seen as input parameters."

Do you think this limitation can be surpassed can be solve with Sybase 15.x?

A solution would be very appreciated (we are mainly interested in Sybase code generation). Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Apr-2008 13:17:12   

If sybase doesn't reveal this info, we can't retrieve it from the db, so we can't flag parameters as output/input properly. Does ASE 15 reveal this metadata?

Frans Bouma | Lead developer LLBLGen Pro
erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 13:45:56   

Yes it does, here after the query: "SELECT "+

            "LTRIM(RTRIM(str_replace(sc.name,'@',''))) AS NAME_, "+

            "sc.length AS SIZE_, "+

            "st.name AS TYPE_, " +

            "CASE sc.status2 "+

                "WHEN 2 THEN 1 "+

                "ELSE 0 END AS OUTPUT_, " +

            "1 AS NULLABLE_ "+

            "FROM syscolumns sc " +

            "INNER JOIN sysobjects so ON so.id = sc.id " +

            "INNER JOIN systypes st ON sc.usertype = st.usertype " +

            "WHERE so.name = '" + storedProcedureName + "' " +

            "ORDER BY sc.colid, OUTPUT_"
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Apr-2008 15:46:18   

It can indeed be used as a separate query for parameter i/o direction. The parameter info from the query currently used is better (more info), so if I can join this query with that one it would be the best choice.

I've to see if this was added to v15 or that it was available earlier as well.

(edit) syscolumns.status2 says in the referencemanual of 15:

Indicates parameter mode of a SQLJ stored procedure, and the return type of a SQLJ function.

Three internal bits support computed columns:

*     0x00000010, value16 – the column is a computed column.
*     0x00000020, value 32 – The column is a materialized computed column.
*     0x00000040, value 64 – The column is a computed column in a view.

I tried it on a random proc and it works, but this description is completely nonsense.. simple_smile Unless I'm overlooking something and Sybase is cramming the output direction of a parameter also in this field (undocumented)

Frans Bouma | Lead developer LLBLGen Pro
erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 15:55:11   

I agree your proposal would be the best choice. No, the test we made on sybase 12 doesn't work, I beleive only sybase 15.x retreives the info. The question is; do you think I can have a beta with that fix, because our project is starting and we are looking for an other solution, as architect I'd like to propose LLBLgen as standard for DAL layer on sybase / Oracle?

thanks Eric Laplace.

erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 16:24:12   

erl wrote:

I agree your proposal would be the best choice. No, the test we made on sybase 12 doesn't work, I beleive only sybase 15.x retreives the info. The question is; do you think I can have a beta with that fix, because our project is starting and we are looking for an other solution, as architect I'd like to propose LLBLgen as standard for DAL layer on sybase / Oracle?

thanks Eric Laplace.

0x00000010, value16 – the column is a computed column means OUTPUT parameter.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Apr-2008 16:45:06   

It went wrong with overloaded procs. Though I now have it working. I've attached an updated build of the v2.5 driver.

Place this driver in: <llblgen pro installation folder>\Drivers\SybaseASE

Frans Bouma | Lead developer LLBLGen Pro
erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 18:01:44   

thks OK it works at 98% :

The code generation template must be updated in order to use the right ParameterDirection value. Now it still generates "ParameterDirection.InputOutput" so I get an exception for input parameter (to get it works I have to modify the code ).

an other point how can I renew my demo license cause I have only few days left.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Apr-2008 18:54:15   

erl wrote:

thks OK it works at 98% :

The code generation template must be updated in order to use the right ParameterDirection value. Now it still generates "ParameterDirection.InputOutput" so I get an exception for input parameter (to get it works I have to modify the code ).

I've to check this with older versions of ASE if that works OK, though I think you're right indeed. The code is in the templates actually. I'll do some tests tomorrow.

an other point how can I renew my demo license cause I have only few days left.

You need more time evaluating? We can send you a time-fixed build of the designer if you need more time to evaluate.

Frans Bouma | Lead developer LLBLGen Pro
erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 18:54:59   

find attached the updated template for Sybase ASE stored procedure generation.

It must be copied under: "C:\Program Files\Solutions Design\LLBLGen Pro v2.5 Demo\Templates\SybaseAseSpecific\Net2.x\C#"

HTH simple_smile

Attachments
Filename File size Added on Approval
retrievalProceduresAdapter.template 11,686 10-Apr-2008 18:55.18 Approved
erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 10-Apr-2008 19:07:47   

_You need more time evaluating? We can send you a time-fixed build of the designer if you need more time to evaluate. _

Yes please ; give me enough time to make demo Sybase / Oracle (mainly Sybase) here and prove that it is what we need to improve our efficiency. Then we'll buy it for sure.

Thanks you for the quick response.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 11-Apr-2008 10:14:51   

Thanks simple_smile

We'll mail you a demo extension today.

Frans Bouma | Lead developer LLBLGen Pro
Aglaia avatar
Aglaia
LLBLGen Pro Team
Posts: 535
Joined: 07-Sep-2003
# Posted on: 11-Apr-2008 10:26:08   

Just emailed a demo extension to the address you used to register on the forums simple_smile

tbergmen
User
Posts: 9
Joined: 14-Apr-2008
# Posted on: 14-Apr-2008 14:35:06   

Aglaia wrote:

Just emailed a demo extension to the address you used to register on the forums simple_smile

Could you kindly e-mail it to me as well?

Aglaia avatar
Aglaia
LLBLGen Pro Team
Posts: 535
Joined: 07-Sep-2003
# Posted on: 14-Apr-2008 16:09:26   

tbergmen wrote:

Aglaia wrote:

Just emailed a demo extension to the address you used to register on the forums simple_smile

Could you kindly e-mail it to me as well?

Could you tell me why you need more time evaluating please? Usually people know if LLBLGen Pro will suit their needs within the 30 day trial period.

tbergmen
User
Posts: 9
Joined: 14-Apr-2008
# Posted on: 15-Apr-2008 13:02:41   

Aglaia wrote:

Could you tell me why you need more time evaluating please? Usually people know if LLBLGen Pro will suit their needs within the 30 day trial period.

We have already bought and using LLBLGen Pro for quite a long time. What makes you think that we are evaluating it?

Aglaia avatar
Aglaia
LLBLGen Pro Team
Posts: 535
Joined: 07-Sep-2003
# Posted on: 15-Apr-2008 13:30:51   

tbergmen wrote:

Aglaia wrote:

Could you tell me why you need more time evaluating please? Usually people know if LLBLGen Pro will suit their needs within the 30 day trial period.

We have already bought and using LLBLGen Pro for quite a long time. What makes you think that we are evaluating it?

Now I'm confused simple_smile You asked to be emailed the demo extension we sent the OP, so why would you need it if you've already got the full version?

tbergmen
User
Posts: 9
Joined: 14-Apr-2008
# Posted on: 15-Apr-2008 16:14:46   

Aglaia wrote:

tbergmen wrote:

Aglaia wrote:

Could you tell me why you need more time evaluating please? Usually people know if LLBLGen Pro will suit their needs within the 30 day trial period.

We have already bought and using LLBLGen Pro for quite a long time. What makes you think that we are evaluating it?

Now I'm confused simple_smile You asked to be emailed the demo extension we sent the OP, so why would you need it if you've already got the full version?

My bad, sorry. I had the 2.0 version installed on my machine. That is why I couldn't find Sybase templates. Now I have version 2.5 installed. Thanks anyway.

erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 15-Apr-2008 17:14:09   

VERY SORRY for being so long !

I did receive the demo version it works fine THANKS YOU!

erl
User
Posts: 38
Joined: 28-Feb-2008
# Posted on: 15-Apr-2008 17:55:41   

In fact, when I installed LLBLGen I Had only Sybase 12 it wasn't enough to finish evaluating the product. Since I just received my access to our new Sybase 15 more time is necessary. I think the 30 days demo you send will be sufficient.