Click here to Skip to main content
15,918,258 members
Home / Discussions / Database
   

Database

 
GeneralRe: Sort GetChildRow datarow array Pin
BobW99912-Oct-15 17:34
BobW99912-Oct-15 17:34 
GeneralRe: Sort GetChildRow datarow array Pin
Mycroft Holmes12-Oct-15 17:40
professionalMycroft Holmes12-Oct-15 17:40 
SuggestionNeed to Optimize this Query Pin
Member 1205173711-Oct-15 23:33
Member 1205173711-Oct-15 23:33 
QuestionTimeline for Work Completion Pin
macca249-Oct-15 0:48
macca249-Oct-15 0:48 
AnswerRe: Timeline for Work Completion Pin
CHill609-Oct-15 2:12
mveCHill609-Oct-15 2:12 
QuestionMSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
px058-Oct-15 21:32
px058-Oct-15 21:32 
AnswerRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
GuyThiebaut8-Oct-15 23:04
professionalGuyThiebaut8-Oct-15 23:04 
GeneralRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
px058-Oct-15 23:26
px058-Oct-15 23:26 
AnswerRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
Eddy Vluggen9-Oct-15 1:39
professionalEddy Vluggen9-Oct-15 1:39 
AnswerRe: MSSQL behavior: I need to round instead of truncation when number scale is exceeded Pin
Wombaticus10-Oct-15 8:00
Wombaticus10-Oct-15 8:00 
QuestionSql Server Back-end with Access or Asp.net Front-end Pin
macca247-Oct-15 23:23
macca247-Oct-15 23:23 
AnswerRe: Sql Server Back-end with Access or Asp.net Front-end Pin
CHill608-Oct-15 14:29
mveCHill608-Oct-15 14:29 
AnswerRe: Sql Server Back-end with Access or Asp.net Front-end Pin
Daniel Miller19-Oct-15 14:18
professionalDaniel Miller19-Oct-15 14:18 
Questiondatagrid code Pin
Maristello7-Oct-15 3:47
Maristello7-Oct-15 3:47 
AnswerRe: datagrid code Pin
CHill608-Oct-15 14:25
mveCHill608-Oct-15 14:25 
QuestionSQL server query Pin
Swap96-Oct-15 4:04
Swap96-Oct-15 4:04 
AnswerRe: SQL server query Pin
Richard Andrew x646-Oct-15 7:10
professionalRichard Andrew x646-Oct-15 7:10 
AnswerRe: SQL server query Pin
RNA Team10-Oct-15 8:33
RNA Team10-Oct-15 8:33 
QuestionHOW TO COPY DBF Files in VB.NET Pin
sunil8800891-Oct-15 22:17
sunil8800891-Oct-15 22:17 
AnswerRe: HOW TO COPY DBF Files in VB.NET Pin
phil.o1-Oct-15 23:55
professionalphil.o1-Oct-15 23:55 
AnswerRe: HOW TO COPY DBF Files in VB.NET Pin
Patrice T2-Oct-15 0:56
mvePatrice T2-Oct-15 0:56 
GeneralRe: HOW TO COPY DBF Files in VB.NET Pin
sunil8800893-Oct-15 21:50
sunil8800893-Oct-15 21:50 
Questionreturn the results from Query union the external proc in DB2 Pin
sudevsu30-Sep-15 8:49
sudevsu30-Sep-15 8:49 
Hello experts,

I am pretty new to DB2. I have a query that returns some result. For each row of the results, I should pass a value from results to external Procedure. Now I want an union of both the results. Here is what I have tried. And I am banging my head to wall since last three days. Can someone please help me with this? It is really really important now.
BEGIN

DECLARE EOF_COND INTEGER DEFAULT 0 ;
DECLARE @ITEM CHAR ( 30 ) ;
DECLARE @BIN CHAR ( 10 ) ;
DECLARE @SIZE CHAR ( 30 ) ;
DECLARE @TIRERACK CHAR ( 10 ) ;
DECLARE @RACKSBIN CHAR ( 10 ) ;
DECLARE @DESC CHAR ( 100 ) ;
DECLARE @DESC1 CHAR ( 100 ) ;
DECLARE @ONHAND CHAR ( 10 ) ;
DECLARE @COMTD CHAR ( 10 ) ;
DECLARE @USEDRACKS CHAR ( 10 ) ;
DECLARE @OPENRACKS CHAR ( 10 ) ;
DECLARE @TEMP CHAR ( 10 ) ;
DECLARE RESULT INTEGER DEFAULT 0 ;


DECLARE CR1 CURSOR WITH RETURN FOR

SELECT T2 . ICITEM , T2 . BABLOC , C . ISSIZE , D . UNITSPER
, E . NBRRCKBINB , F . ICDSC1 , F . ICDSC2 , T2 . TQOH , T2 . TQCM
, CEIL ( INTEGER ( ( T2 . TQOH ) ) / D . UNITSPER )
NBR_USED_RACKS
, E . NBRRCKBINB - ( CEIL ( INTEGER ( ( T2 . TQOH ) ) / D . UNITSPER ) )
NBR_OPEN_RACKS , ( E . NBRRCKBINB * D . UNITSPER ) - T2 . TQOH
FROM (
SELECT A . BACMP , A . BALOC , MIN ( A . BAITEM ) ICITEM
, A . BABLOC , INTEGER ( SUM ( A . BAQOH ) ) TQOH ,
INTEGER ( SUM ( A . BAQCM ) ) TQCM
FROM TESTDATA . VINBINI A WHERE A . BALOC = '13' AND 1 = A . BACMP AND
A . BAQOH - A . BAQCM > 0 GROUP BY A . BACMP , A . BALOC , A . BABLOC HAVING
MIN ( A . BAITEM ) = MAX ( A . BAITEM )
AND SUM ( A . BAQOH - A . BAQCM ) > 0
) AS T2
, TESTDATA . PALITMLOC B , TESTDATA . VINITEMSIZ C , TESTDATA . PALSIZQTY D , TESTDATA . PALBINPF E
, TESTDATA . VINITEM F
WHERE T2 . BACMP = B . TACOMP AND T2 . ICITEM = B . ICITEM
AND T2 . BALOC = B . IALOC AND T2 . ICITEM = F . ICITEM
AND T2 . ICITEM = C . ISITEM
AND B . PALLETID = D . PALLETID
AND C . ISSIZE = D . ISSIZE
AND E . TACOMP = T2 . BACMP
AND E . IALOC = T2 . BALOC
AND E . IMBLOC = T2 . BABLOC
AND E . PALLETID = B . PALLETID
ORDER BY 1 , 2 ;


OPEN CR1 ;
SET EOF_COND = 0 ;
FETCH CR1 INTO @ITEM , @BIN , @SIZE , @TIRERACK , @RACKSBIN , @DESC , @DESC1 , @ONHAND , @COMTD , @USEDRACKS , @OPENRACKS , @TEMP ;

CALL TESTDATA . PARECR24SP ( '01' , '13' , @BIN , RESULT ) ;

RETURN ;

END 

Your help is much appreciated.
Thanks
Happy Coding!

QuestionDatabase relationship for tables Pin
maugonza30-Sep-15 8:43
maugonza30-Sep-15 8:43 
AnswerRe: Database relationship for tables Pin
Jörgen Andersson1-Oct-15 2:12
professionalJörgen Andersson1-Oct-15 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.