cancel
Showing results for 
Search instead for 
Did you mean: 

sp_helpdb output in command prompt unreadable

Yasin
Active Participant
0 Kudos

Hi

when i run sp_helpdb from windows command prompt, the output is not formatted as Columns

results are looking mixed in many rows

how can i format it in proper way.

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member188958
Active Contributor

isql doubles the length of fields when it uses the UTF8 character set.

Try specifying use of a single-byte character set like iso_1 with parameter -Jiso_1

-bret

former_member89972
Active Contributor
0 Kudos

Hi Yaso

sp_helpdb output is not a simple table.

However you can look the source SQL of sp_helpdb which is in database sybsystemprocs.

You can borrow what you need out it and create your own version and name it sp__helpdb

Note the two underscores in sp__helpdb.

Leave the SAP provided sp_helpdb as it is.

For any select statement you can also use sp_autoformat procedure to trim additional spaces.

Also for string columns you may use left(<column>, nn) function to get trimmed version of output.

I think with the two suggestions above you can get what you want.

HTH

Avinash

former_member89972
Active Contributor
0 Kudos

This is a typical DOS window problem.

Right click and change defaults for the DOS window. Save and then reopen the DOS window.

I have attached the settings for options, font, layout and colors (background and text).

Also use the -w1024 option for isql to make sure that columns are expanded as needed.

HTH

Avinash

Yasin
Active Participant
0 Kudos

Hi Avinash

there is a progress, but i have used -w10000 increasing the number the issue looks on dash lines ---- which is too long

and causing the cols to don't fit

however it looks better

Regards

former_member188958
Active Contributor
0 Kudos

Hi Yaso,

Try making the terminal window wider and run the query again.

-bret

former_member188958
Active Contributor
0 Kudos

Hi Yaso,

-w and -X can be used together; don't drop the -X, add the -w.

This output does look like the issue is isql wrapping at it's default screen width, so I think -w will resolve the issue.

Cheers,

-bret

Yasin
Active Participant
0 Kudos

Hi Bert,

by keeping both -X and -W am not getting the error but it is still wrapping the output 😞

Regards

former_member188958
Active Contributor
0 Kudos

What client are you using?
Perhaps the client is using a variable-width font instead of a fixed-width font like courier?
(If you paste the output into Word and select courier as the font, do column values line up?)

Is it that the lines are wrapping so there are multiple lines of output for each database?
If using the isql client, you can specify a wider output with the -w parameter (like -w999).

If neither of these ideas are the cause, a screenshot of what it actually looks like may be helpful.

Cheers,

-bret

Yasin
Active Participant
0 Kudos

Hi Bret

if i tried to use W999 or W300 instead of -X (isql -Usapsa -SMPRD -W999) am getting the bellow error:

Msg 1640, Level 16, State 2:Server 'MPRD':
Adaptive Server requires encryption of the login password on the network.
Msg 4002, Level 14, State 1:
Server 'MPRD':
Login failed.
CT-LIBRARY error:
ct_connect(): protocol specific layer: external error: The attempt to connect to the server failed.<br>

The output look like this.