简体   繁体   English

插入时间发生错误警告:oci_execute():ORA-01843:无效的月份

[英]Insertion of time an error occurs Warning: oci_execute(): ORA-01843: not a valid month

i am making a inventory system in php using oracle database. 我正在使用oracle数据库在php中创建清单系统。 there is a page where admin clik on "sold" button date and time along with other data will store in oracle database, i can enter date but when enter time an error show in screen "Warning: oci_execute(): ORA-01843: not a valid month " my code is given below. 有一个页面,其中“已售出”按钮的日期和时间以及其他数据的管理员信息将存储在oracle数据库中,我可以输入日期,但是当输入时间时,屏幕“警告:oci_execute():ORA-01843:错误”中显示一个有效的月份”我的代码如下。 please help... 请帮忙...

<?php
$c = oci_connect('STOCK_SYS', 'passward', 'db');
$date1 = date('d-M-y');
$time1 =date('h-i-s');
$orclq = "INSERT INTO STOCK_TABLE(SALE_DATE,SALE_TIME) VALUES (:date1,:time1)";
$compiled = oci_parse($c, $orclq);
oci_bind_by_name($compiled, ':date1', $date1);
oci_bind_by_name($compiled, ':time1', $time1);

?>

regards... 问候...

You may need to check the NLS_DATE_FORMAT settings for your database 您可能需要检查数据库的NLS_DATE_FORMAT设置
SELECT value FROM nls_session_parameters WHERE parameter = 'NLS_DATE_FORMAT'

here's how you can change this setting for your session: 您可以通过以下方法更改会话的此设置:
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取oci_execute():ORA-01843:在插入记录时,php中的有效月份无效吗? - Getting oci_execute(): ORA-01843: not a valid month invalid in php while inserting record? 教义2错误ORA-01843:无效月份 - Doctrine 2 error ORA-01843: not a valid month 常规错误:1843 OCIStmtExecute:ORA-01843:无效月份(ext \\ pdo_oci \\ oci_statement.c:148)&#39; - General error: 1843 OCIStmtExecute: ORA-01843: not a valid month (ext\pdo_oci\oci_statement.c:148)' ORA-01843-无效的Oracle SQL月 - ORA-01843 - not a valid month oracle SQL 警告:oci_execute():ORA-01821:日期格式无法识别 - Warning: oci_execute(): ORA-01821: date format not recognized 警告:oci_execute():ORA-00907:缺少右括号 - Warning: oci_execute(): ORA-00907: missing right parenthesis SQL错误,警告:`oci_execute()`:ORA-00996:连接运算符是||,而不是|| 在C:\\ wa - SQL Error, Warning: `oci_execute()`: ORA-00996: the concatenate operator is ||, not | in C:\wa ORA-00911仅oci_execute错误 - ORA-00911 Error only with oci_execute 如何修复错误“PHP 警告:oci_execute():ORA-00932:不一致的数据类型:预期 DATE 得到 NUMBER”? - How to fix the error “PHP Warning: oci_execute(): ORA-00932: inconsistent datatypes: expected DATE got NUMBER”? 警告:oci_execute():ORA-01400:无法插入NULL值 - Warning: oci_execute(): ORA-01400: cannot insert NULL value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM