Database administration tool for Windows OS family.
Questions tagged [winsql]
24 questions
0
votes
0 answers
SQL percentage calculation formula issue
Example of my data:
+----------+--------+------------+-------------------+
| Category | Orders | Units | Value |
+----------+--------+------------+-------------------+
| RED | 165 | 9,376,638 | $723,544,659.20 |
| BLUE …

EP31121PJ
- 95
- 2
- 9
0
votes
0 answers
Label Multiple SQL queries
I run 12 different queries simultaneously as part of doing some research. I would like to find a way to give a label to title to each query that shows up in WINSql results window...
i.e.
QUERY #1
RCPT INT# SEX NAME
---- --------- ----…

VanCowboy
- 200
- 3
- 16
0
votes
0 answers
how to disable auto commit when run winsql command-line
I have this code in c#:
string parameters = "-cDriver={IBM DB2 ODBC DRIVER};Database=" + txtDb.Text + ";hostname=" + txtIp.Text + ";port=" + txtPort.Text + ";protocol=TCPIP;uid=" + txtUid.Text + ";pwd=" + txtPws.Text + "";
Process myProcess = new…

Roberto Pegoraro
- 1,313
- 2
- 16
- 31
0
votes
3 answers
SQL: Return a count of 0 with count(*)
I am using WinSQL to run a query on a table to count the number of occurrences of literal strings. When trying to do a count on a specific set of strings, I still want to see if some values return a count of 0. For example:
select letter,…

jamesvphan
- 1,825
- 6
- 23
- 30
0
votes
0 answers
MSSQL Decimal Sum and Float Sum Difference
I am having a strange problem with MSSQL server. I am summing multiple numbers as float and decimal but since the numbers are the same, result must be the same. My number goes like "541,66", "700", "-1241,66". In this scenerio result must be "0",…

Cromwell
- 496
- 1
- 6
- 24
0
votes
2 answers
SQL "WITH" to include multiple derived tables
Can I write something like below. But this is not giving proper output in WinSQL/Teradata
with
a (x) as ( select 1 ),
b (y) as ( select * from a )
select * from b

RRR
- 145
- 1
- 3
- 11
0
votes
1 answer
SQL Schema changed to be "dbo.dbo." after altering table name
I tried to alter a table with a new table name. I successfully changed the name but the schema also changed from "dbo." to be "dbo.dbo.". When I tried selecting data from the new table, it shows in the Message box that the table is invalid so I…

user2979630
- 131
- 1
- 5
0
votes
2 answers
WinSQL and Export with DB2
I am trying to export a row to a DEL file using;
EXPORT TO ExportedFile.DEL OF DEL SELECT * From MyTable
However, when I execute the query I get this;
Error: SQL0104N An unexpected token "ExportedFile" was found following "EXPORT TO ". Expected…

griegs
- 22,624
- 33
- 128
- 205
-2
votes
3 answers
Days between current date and a numeric field stored as DDMMYY
I have a field of dates stored as DDDDMMYY and want to calculate the number of days between this date and the current date.
I am using WINSQL and DB2.
I get a result using the below…

user2990696
- 1
- 2