Author |
Message |
Topic: Cursor using JOIN and FOR UPDATEM OF |
GuyC
Replies: 4
Views: 4336
|
Forum: Database Posted: Tue Jun 26, 2012 8:36 am Subject: Cursor using JOIN and FOR UPDATEM OF |
No,
you could try to rewrite the query as :
DECLARE CURMARCA CURSOR WITH HOLD FOR
SELECT B.NU_PESSOA,
B.NU_MATRICULA,
B.DT_FIM_VIGENCIA,
B.HH_FIM_VIGENCIA,
B.TS_ATUALIZACAO
FROM P ... |
Topic: Separating integer and decimal parts from comp3 |
GuyC
Replies: 16
Views: 12438
|
Forum: Application Programming Posted: Tue Jun 05, 2012 8:32 am Subject: Separating integer and decimal parts from comp3 |
COMPUTE INT-ANS-WS = FUNCTION INTEGER-PART(123.456) => returns 123
COMPUTE WS-RESULT = FUNCTION REM (123.456, 1) => returns .456 |
Topic: Need help in dates conversion for a query |
GuyC
Replies: 4
Views: 4390
|
Forum: Database Posted: Tue May 15, 2012 7:20 am Subject: Need help in dates conversion for a query |
i think year(), month() and day() should work no matter which DB2 version you are on.
Varchar_format() is indeed a DB2 9 nfm function.
What I am trying to do is :
year(current date) => 2012
... |
Topic: Need help in dates conversion for a query |
GuyC
Replies: 4
Views: 4390
|
Forum: Database Posted: Tue May 15, 2012 6:10 am Subject: Need help in dates conversion for a query |
how about :
(year(CURRENT DATE )-1900) *10000 + month(CURRENT DATE ) * 100 + day(CURRENT DATE)
or
integer(varchar_format(current_timestamp,'IYYYMMDD')) - 19000000 |
Topic: How can I get Version Info of a stopped Db2-System |
GuyC
Replies: 2
Views: 3038
|
Forum: Database Posted: Mon Apr 16, 2012 4:27 am Subject: How can I get Version Info of a stopped Db2-System |
DECP1010 |
Topic: Get three records per group in descending order |
GuyC
Replies: 3
Views: 3338
|
Forum: Database Posted: Tue Mar 20, 2012 6:02 am Subject: Get three records per group in descending order |
select * from
(select CRIT_PART_GRP_NAME
, DIV_OWNER_COD
from tbabe t1
group by CRIT_PART_GRP_NAME
... |
Topic: DB2 SP Calling through .Net windows application |
GuyC
Replies: 6
Views: 8445
|
Forum: Database Posted: Fri Mar 09, 2012 7:08 am Subject: DB2 SP Calling through .Net windows application |
-551 auth-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION operation ON OBJECT object-name
together with the tokens :
DB2ADMIN ... |
Topic: Remote Aliases in DB2 LUW |
GuyC
Replies: 2
Views: 3470
|
Forum: Database Posted: Thu Jan 05, 2012 11:42 am Subject: Remote Aliases in DB2 LUW |
I don't think so.
What you are looking for are federated objects and to set that up , you need to
1. Set up the dbm cfg federated yes
2. catalog the node and database to which u want to connect ... |
Topic: convert numeric code to alpha literal in QMF ? |
GuyC
Replies: 4
Views: 3899
|
Forum: Database Posted: Mon Nov 21, 2011 9:32 am Subject: convert numeric code to alpha literal in QMF ? |
Do you mean without changing the query, directly in the report ?
I guess it's doable wih user defined edit codes : http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.qmf9.doc.iandm/ ... |
Topic: Find tables used by a program- packages |
GuyC
Replies: 9
Views: 6157
|
Forum: Database Posted: Thu Nov 17, 2011 4:42 am Subject: Find tables used by a program- packages |
DBRM PLANs needed all DBRMs of main programs and subroutines.
Someone had to maintain this (just to issue the bind statement)
and it was reflected in SYSTABAUTH.
But this doesn't mean that DB2 mag ... |
Topic: Deleted rows needs to insert into the table |
GuyC
Replies: 5
Views: 3338
|
Forum: Database Posted: Mon Nov 14, 2011 4:01 am Subject: Deleted rows needs to insert into the table |
or create a on-delete trigger on table T1 |
Topic: column of generated sequence numbers ? |
GuyC
Replies: 5
Views: 4022
|
Forum: Database Posted: Wed Nov 02, 2011 12:11 pm Subject: column of generated sequence numbers ? |
no comment, just this :
SELECT POL_NUM, POL_SUFFIX
,SEQ
FROM H2591DB.TCSAU_GENI A ... |
Topic: column of generated sequence numbers ? |
GuyC
Replies: 5
Views: 4022
|
Forum: Database Posted: Wed Nov 02, 2011 5:44 am Subject: column of generated sequence numbers ? |
only a not so performant one :
SELECT FIELDA,FIELDB
,(select 1+count(*) from table1 B where B.uniquesortkey < A.uniquesortkey)
FROM TABLE1 A
order by uniquesortkey
at least I t ... |
Topic: Format in year |
GuyC
Replies: 2
Views: 2249
|
Forum: Database Posted: Wed Oct 19, 2011 6:08 am Subject: Format in year |
max(year(current_date),year(dt_inp)) ? |
Topic: ORDER BY a DB2 varchar column - 1st char being different |
GuyC
Replies: 4
Views: 4166
|
Forum: Database Posted: Wed Oct 19, 2011 3:41 am Subject: ORDER BY a DB2 varchar column - 1st char being different |
thx GuyC,
another keeper. much easier than figuring it out on my own.
you're welcome.
It's just another implementation for 'user defined sortsequence'
I do like this one :
order by position ... |
|