Hi…
I have expression sql on Oracle to fill into the custom field below :SELECT ((CASE WHEN ((SYSDATE >= TGL_JATUH_TEMPO_SPPT) AND (STATUS_PEMBAYARAN_SPPT = ‘0’) AND ((ROUND(MONTHS_BETWEEN (SYSDATE,TGL_JATUH_TEMPO_SPPT))) > 23)) THEN ROUND (((0.02 * PBB_YG_HARUS_DIBAYAR_SPPT) * 24) + PBB_YG_HARUS_DIBAYAR_SPPT) WHEN ((SYSDATE >= TGL_JATUH_TEMPO_SPPT) AND (STATUS_PEMBAYARAN_SPPT = ‘0’) AND ((ROUND(MONTHS_BETWEEN (SYSDATE,TGL_JATUH_TEMPO_SPPT))) <= 23)) THEN ROUND (((0.02 * PBB_YG_HARUS_DIBAYAR_SPPT * (ROUND(MONTHS_BETWEEN (SYSDATE,TGL_JATUH_TEMPO_SPPT))) + PBB_YG_HARUS_DIBAYAR_SPPT))) ELSE PBB_YG_HARUS_DIBAYAR_SPPT END)) AS TOTAL_BAYAR FROM SPPT WHERE STATUS_PEMBAYARAN_SPPT = ‘0’;but its error it said like this :
Warning: oci_execute(): ORA-01427: single-row subquery returns more than one row in C:\dev19\adodb5\drivers\adodb-oci8.inc.php on line1302Please, help me…
Thank you
rachmaddt wrote:
single-row subquery returns more than one rowAs the error said, system expects single-row, however the subquery in your query returns more than one row, and this condition will of course raise an error.
The solution for this, make sure that subquery will only return one row.
Yes…
my subquery is only return one row on the listpage, but still got error
It probably return only one row in your List page, however if the subquery actually returns more than one row, then the error still remains.
actually i’d like to add temporary field on the list page, so i have usedfunction Page_Render() {
$TELATBULAN = ExecuteRow(“(SELECT (CASE WHEN (STATUS_PEMBAYARAN_SPPT = ‘0’) AND ((ROUND(MONTHS_BETWEEN (SYSDATE,TGL_JATUH_TEMPO_SPPT))) > 23) THEN 24 WHEN (STATUS_PEMBAYARAN_SPPT = ‘0’) AND ((ROUND(MONTHS_BETWEEN (SYSDATE,TGL_JATUH_TEMPO_SPPT))) < 0) THEN 0 ELSE (ROUND(MONTHS_BETWEEN (SYSDATE,TGL_JATUH_TEMPO_SPPT))) END) AS TELAT_BULAN FROM SPPT WHERE STATUS_PEMBAYARAN_SPPT = ‘0’)”);
}function ListOptions_Load() {
$TELATBULAN = &$this->ListOptions->Add(“TELAT_BULAN”);
$TELATBULAN->Header = “TELAT BULAN”;
$TELATBULAN->OnLeft = FALSE;
$TELATBULAN->MoveTo(-1);
}function ListOptions_Rendered() {
$this->ListOptions->Items[“TELAT_BULAN”]->Body = $this->TELAT_BULAN->CurrentValue;
}but i still got error
Notice: Undefined property: SPPT_list::$TELAT_BULAN in SPPT_list.php on line 2700
Notice: Trying to get property ‘CurrentValue’ of non-object in SPPT_list.php on line 2700
rachmaddt wrote:
function ListOptions_Rendered() {
$this->ListOptions->Items[“TELAT_BULAN”]->Body = $this->TELAT_BULAN->CurrentValue;
}Should be:
function ListOptions_Rendered() {
if (!empty($this->TELAT_BULAN->CurrentValue))
$this->ListOptions->Items[“TELAT_BULAN”]->Body = $this->TELAT_BULAN->CurrentValue;
}
mobhar wrote:
rachmaddt wrote:
function ListOptions_Rendered() {
$this->ListOptions->Items[“TELAT_BULAN”]->Body =
$this->TELAT_BULAN->CurrentValue;
}Should be:
function ListOptions_Rendered() {
if (!empty($this->TELAT_BULAN->CurrentValue))
$this->ListOptions->Items[“TELAT_BULAN”]->Body =
$this->TELAT_BULAN->CurrentValue;
}Alhamdulilah… The Issue was solved… thank you mobhar