Here is my php code with laravel framework below:
$migrationData = array(
'po_code' => 184,
'mnyr' => "06/2022",
'dist_code' => $request->district_code[$i],
'thana_code' => $request->thana_code[$i],
'loan_code' => $request->loan_code[$i],
'cum_disb' => $request->cum_disb[$i] ?? 0,
'member' => $request->member[$i] ?? 0,
'borrower' => $request->borrower[$i] ?? 0,
'loan_fy' => $request->loan_fy[$i] ?? 0,
'cum_borr' => $request->cum_borr[$i] ?? 0,
);
$findRecord = array(
'po_code' => 123,
'mnyr' => "06/2022",
'dist_code' => $request->district_code[$i],
'thana_code' => $request->thana_code[$i],
'loan_code' => $request->loan_code[$i],
);
DB::connection('oracle')->table('PRA_LN_DIST_WISE_DISB')
->updateOrInsert(
$findRecord,
$migrationData
);
Here is table structer:
create table PRA_LN_DIST_WISE_DISB
(
po_code VARCHAR2(4) not null,
mnyr VARCHAR2(7) not null,
dist_code VARCHAR2(4) not null,
thana_code VARCHAR2(6) not null,
loan_code VARCHAR2(7) not null,
cum_disb NUMBER(17,2),
member NUMBER(17,2),
borrower NUMBER(17,2),
loan_fy NUMBER(17,2),
cum_borr NUMBER(17,2),
ins_user VARCHAR2(50),
ins_date DATE,
upd_user VARCHAR2(50),
upd_date DATE,
posting_flag VARCHAR2(3),
status_date DATE
);
alter table PRA_LN_DIST_WISE_DISB
add constraint PK_PRA_LN_DIST_WISE_DISB primary key (PO_CODE, MNYR, DIST_CODE, THANA_CODE, LOAN_CODE);
When I am trying to do Insert/Update this Error is being thrown:
/home/microfinplus/public_html/dus/vendor/laravel/framework/src/Illuminate/Database/Connection.php 647 Error Code: 904 Error Message: ORA-00904: "member": invalid identifier Position: 142 Statement: update "PRA_LN_DIST_WISE_DISB" set "PO_CODE" =:p0, "MNYR" =:p1, "DIST_CODE" =:p2, "THANA_CODE" =:p3, "LOAN_CODE" =:p4, "CUM_DISB" =:p5, "member" =:p6, "BORROWER" =:p7, "LOAN_FY" =:p8, "CUM_BORR" =:p9 where ("PO_CODE" =:p10 and "MNYR" =:p11 and "DIST_CODE" =:p12 and "THANA_CODE" =:p13 and "LOAN_CODE" =:p14) Bindings: [184,06/2022,1009,100965,038,326286984,1473,1108,37558000,8606,184,06/2022,1009,100965,038] (SQL: update "PRA_LN_DIST_WISE_DISB" set "PO_CODE" = 184, "MNYR" = 06/2022, "DIST_CODE" = 1009, "THANA_CODE" = 100965, "LOAN_CODE" = 038, "CUM_DISB" = 326286984, "member" = 1473, "BORROWER" = 1108, "LOAN_FY" = 37558000, "CUM_BORR" = 8606 where ("PO_CODE" = 184 and "MNYR" = 06/2022 and "DIST_CODE" = 1009 and "THANA_CODE" = 100965 and "LOAN_CODE" = 038))
Now what should I do?
hope this helps Why do I have ORA-00904 even when the column is present?
TL:DR Oracle database queries, if enclosed with double-quotes becomes case-sensitive. Please check the database and make sure your member
column is spelled and cased correctly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.