Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2011
    Posts
    9

    Unanswered: Varchar data type and current value of proc parameter help

    I need help on two problem which I am facing in Ase 12.05.
    1.Maximum allowed Varchar data type size is 255 charachters.
    I wish to know how can I increase the size of the same or is there any alternative data type like text or long varchar which we have in higher version.My version of sybase is 12.05
    2. how to get the current value of the parameters of stored procedure.I dont have monitoring features enabled. I need this for audit purpose. want to keep a record of number of time a procedure was called, the arguments passed during call,starttime and end time.

    Please guide me how to achieve this

  2. #2
    Join Date
    Aug 2010
    Posts
    19

    Thumbs up

    ad 1) in 12 you can create varchar higher than 255
    create table t1 (ch varchar(300)), the maximum size depends on your pagesize;
    keep in mind that your whole records must fit in one page - overhead.

    ad 2) in higher version you could check the execution via mon tables, but with 12 I would change the procedure and include the statements you need.

    eg
    create proc my proc
    as
    declare @start datetime,@end datetime

    SET @start = getdate()
    -- do stuff
    -- so more stuff

    SET @end = getdate()
    insert into proc_log (getdate(),@start,@end)
    ------------------------------------------------


    where the proc_log could be something like
    create table proc_log (
    fid int identity, -- ever increasing value
    fprocname varchar(150),
    fdate datetime,
    fstart datetime,
    fend datetime
    )

  3. #3
    Join Date
    Feb 2011
    Posts
    9
    Quote Originally Posted by farhy View Post
    ad 1) in 12 you can create varchar higher than 255
    create table t1 (ch varchar(300)), the maximum size depends on your pagesize;
    keep in mind that your whole records must fit in one page - overhead.

    ad 2) in higher version you could check the execution via mon tables, but with 12 I would change the procedure and include the statements you need.

    eg
    create proc my proc
    as
    declare @start datetime,@end datetime

    SET @start = getdate()
    -- do stuff
    -- so more stuff

    SET @end = getdate()
    insert into proc_log (getdate(),@start,@end)
    ------------------------------------------------


    where the proc_log could be something like
    create table proc_log (
    fid int identity, -- ever increasing value
    fprocname varchar(150),
    fdate datetime,
    fstart datetime,
    fend datetime
    )
    My Comments:
    Thanks for your valuable revert.

    Problem 1:
    Would be great if you can please give me more insight on the same.

    Problem 2:
    I dont have mon table.
    I have already implemented the other solution but it is not feasible enough as I have more than 230 procs which accepts more than 7 parameters.
    Hence, I need to do something dynamically.
    My friend has posted a thread on the similar issue under heading
    "Cannot use procedures paramaters dynamically"...I will try to use that solution and get back to you again.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •