If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Varchar data type and current value of proc parameter help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-11, 15:01
awahidt3 awahidt3 is offline
Registered User
 
Join Date: Feb 2011
Posts: 9
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
Reply With Quote
  #2 (permalink)  
Old 02-23-11, 11:27
farhy farhy is offline
Registered User
 
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
)
Reply With Quote
  #3 (permalink)  
Old 02-23-11, 12:43
awahidt3 awahidt3 is offline
Registered User
 
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.
Reply With Quote
Reply

Tags
datatype, parameter value, procedure, varchar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On