Error message

User error: Failed to connect to memcache server: rpc4010:11222 in dmemcache_object() (line 415 of /appl2/devx/drupal/sites7/all/modules/memcache/dmemcache.inc).
All Forums Tools
Sean Graflund 1 post Joined 10/04
27 Oct 2004
Teradata Select Case Statement Help

I am primarily a SQL Server developer but working on an App with Teradata backend.I am having problems developing some SQL code for Teradata ...This is what I am needing ...I have one table that holds the following:APPL.FR_DETAILPO_NBR PO_LINE_NBR AD_NO_ADD ADMIN_FEE ------ ----------- --------- ---------12345 1 A 012345 2 A 012345 3 A 012345 4 N 012345 5 N 012344 1 A 012344 2 A 012344 3 N 012344 4 N 0OK, then i have a table that stores the admin_fee values ..APPL.ADMIN_TBLAD_FEE NO_AD_FEE------ ---------400 200now, i need to update the above data to look like the following:PO_NBR PO_LINE_NBR AD_NO_ADD ADMIN_FEE ------ ----------- --------- ---------12345 1 A 40012345 2 A 012345 3 A 012345 4 N 20012345 5 N 012344 1 A 40012344 2 A 012344 3 N 20012344 4 N 0The fee's are grouped at a PO_NBR level.in SQL Server, I could do the statement like this:UPDATE APPL.FR_DETAIL SET ADMIN_FEE = CASE WHEN AD_NO_ADD = 'A' THEN SELECT AD_FEE FROM APPL.ADMIN_TBL ELSE SELECT NO_AD_FEE FROM APPL.ADMIN_TBL ENDTHEN, I'D do the deletion of the extra admin fees, so it will only have one fee for each PO / AdNoAd combo ...but, the sub select in the case statmeent doesn't work in Teradata ... is there any other way i can do this?Thanks,

hitenchavan 1 post Joined 01/06
11 Jan 2006

BOTH THE QUERIES WILL WORK******************************************************UPDATE APPL.FR_DETAILFROM APPL.ADMIN_TBLSET ADMIN_FEE = CASE WHEN APPL.FR_DETAIL.AD_NO_ADD = 'A' THEN APPL.ADMIN_TBL.AD_FEE ELSE APPL.ADMIN_TBL.NO_AD_FEE END******************************************************UPDATE APPL.FR_DETAILFROM APPL.ADMIN_TBLSET ADMIN_FEE = CASE APPL.FR_DETAIL.AD_NO_ADD WHEN 'A' THEN APPL.ADMIN_TBL.AD_FEE ELSE APPL.ADMIN_TBL.NO_AD_FEE END******************************************************

You must sign in to leave a comment.