PLSQL在一个字符串中转换单行

时间:2017-05-19 08:58:34

标签: oracle plsql

您好我正在寻找一个Oracle函数来转换单个字符串中一行的所有记录

TABLE_A

| A | B | C | 1 |

| d | E | F | 2 |

| G | H | I | 3 |

select * from TABLE_A where COL4='1';

必须返回

“ABC”

select * from TABLE_A where COL4='2';

“DEF”

我不能使用CONCAT

SELECT COL1||COL2||COL3 from TABLE_A 

Becouse 我不知道表格中的列数<和名称

有可能吗?

1 个答案:

答案 0 :(得分:1)

请尝试此操作,为ID = 1的记录工作,您可以更改它,或者根据需要添加循环:

int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, uint32 AppId)
{
   int32  ReturnCode = CFE_SUCCESS;

   if ( AppInfo != 0 )
   {
      if ( AppId < CFE_ES_MAX_APPLICATIONS )
      {
         if ( CFE_ES_Global.AppTable[AppId].RecordUsed == TRUE )
         {
            CFE_ES_GetAppInfoInternal(AppId, AppInfo);
            ReturnCode = CFE_SUCCESS;
         }
         else
         {
            CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: App ID Not Active: %d\n",(int)AppId);
            ReturnCode = CFE_ES_ERR_APPID;
         }
      }
      else
      {
         CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: App ID Exceeds CFE_ES_APPLICATION_MAX: %d\n",(int)AppId);
         ReturnCode = CFE_ES_ERR_APPID;
      }
   }
   else
   {
      CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: Invalid Parameter ( Null Pointer )\n");
      ReturnCode = CFE_ES_ERR_BUFFER;
   }
   return(ReturnCode);

} /* End of CFE_ES_GetAppInfo() */