sybase 中的默认文本大小

发布于 2024-12-27 20:23:15 字数 443 浏览 3 评论 0原文

sybase 中的默认文本大小为 32768。 当我登录到 sybase 并输入时,我可以看到这一点:

1> select @@textsize
2> go

 ----------- 
       32768 

(1 row affected)

当我进行一些谷歌搜索时,我得到了使用 set 命令的信息,我可以将默认文本大小更改为我自己的值,

1> set textsize 42768
2> go
1> select @@textsize
2> go

 ----------- 
       42768 

(1 row affected)

但我的问题是这不会持续存在。 一旦我关闭会话,它就会设置回 32768。

有谁知道我如何在 sybase 中永久更改默认文本大小。

the default textsize in sybase is 32768.
i can see this when i login to sybase and type:

1> select @@textsize
2> go

 ----------- 
       32768 

(1 row affected)

when i did some googling i got the info that using the set command i can change the default textsize to my own value

1> set textsize 42768
2> go
1> select @@textsize
2> go

 ----------- 
       42768 

(1 row affected)

But my problem here is this is not persisting.
as soon as i close the session,it sets back to 32768.

does anybody know how could i change the default textsize permanently in sybase.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烏雲後面有陽光 2025-01-03 20:23:15

没有办法持久化它,它必须根据需要在每个会话中设置。 sp_configure没有相应的参数。

http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc31654.1570/html/sag1/X68714.htm

如果在存储过程中设置,则该设置将持续存储过程的范围。

select @@textsize
go
create procedure test_textsize as
set textsize 123456
select @@textsize
go
exec test_textsize
go
select @@textsize
go

结果

 session_textsize 
 ---------------- 
            32768 

(1 row affected)
 proc_textsize 
 ------------- 
        123456 

(1 row affected)
(return status = 0)
 session_textsize 
 ---------------- 
            32768 

(1 row affected)

Sybase ASE 16 更新

这可以通过在登录的默认数据库中使用登录触发器来实现。

create procedure login_trigger as
set textsize 12345
go

将登录触发器添加到用户帐户。

sp_modifylogin a_login, "login script", login_trigger
go

在另一个 isql 会话中测试:

$ isql -U a_login -S SOME_ASE
Password: 
1> select @@textsize
2> go

 ----------- 
       12345 

(1 row affected)
1> 

There is no way to persist this it must be set within each session as required. There is no corresponding parameter for sp_configure.

http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc31654.1570/html/sag1/X68714.htm

If it's set within a stored procedure, the setting lasts for the stored procedure's scope.

select @@textsize
go
create procedure test_textsize as
set textsize 123456
select @@textsize
go
exec test_textsize
go
select @@textsize
go

Result

 session_textsize 
 ---------------- 
            32768 

(1 row affected)
 proc_textsize 
 ------------- 
        123456 

(1 row affected)
(return status = 0)
 session_textsize 
 ---------------- 
            32768 

(1 row affected)

Update for Sybase ASE 16

This can be achieved using a login trigger in the login's default database.

create procedure login_trigger as
set textsize 12345
go

Add the login trigger to the user account.

sp_modifylogin a_login, "login script", login_trigger
go

Test in another isql session:

$ isql -U a_login -S SOME_ASE
Password: 
1> select @@textsize
2> go

 ----------- 
       12345 

(1 row affected)
1> 
从此见与不见 2025-01-03 20:23:15

来自此处


set textsize 命令指定通过 select 语句返回的文本或图像数据的限制(以字节为单位)。例如,此命令将 select 语句返回的文本或图像数据的限制设置为 100 个字节:

set textsize 100 

当前设置存储在 @@textsize 全局变量中。 默认设置由客户端程序控制。要重置默认值,请发出:

set textsize 0

我认为默认值是在配置服务器时配置的。

From HERE!


The set textsize command specifies the limit, in bytes, of the text or image data to be returned with a select statement. For example, this command sets the limit on text or image data returned with a select statement to 100 bytes:

set textsize 100 

The current setting is stored in the @@textsize global variable. The default setting is controlled by the client program. To reset the default, issue:

set textsize 0

I think the default value is configured when configuring the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文