oci

Problems Compiling OCILIB OCI Wrapper Library

雨燕双飞 提交于 2019-12-08 11:04:16
问题 I'm trying to compile demo in ocilib3.8.1/demo . After successfully installing the ocilib library, I then compile demo source conn.c below : #include "ocilib.h" int main(void) { OCI_Connection *cn; if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT)) return EXIT_FAILURE; cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT); printf("Server major version : %i\n", OCI_GetServerMajorVersion(cn)); printf("Server minor version : %i\n", OCI_GetServerMinorVersion(cn)); printf("Server

How to use XML to create OCI-Lob Object?

℡╲_俬逩灬. 提交于 2019-12-07 21:12:37
问题 I have a Oracle Query, which returns the below output:- stdClass Object ( [START_TIME] => 2015/01/04 06:03:07 [END_TIME] => 2015/01/04 06:27:27 [STATUS] => Error [NODE] => DEVSERVER1 [CTRL_GROUP] => DEV_ORA [SERVER_NUMBER] => 1001 [JOB_NAME] => Oracle Process [STEP_INFORMATION] => OCI-Lob Object ( [descriptor] => Resource id #165 ) ) In this, the step information is coming from a getClobVal() function which present inside the Oracle Query. I have extracted the XML contents by running the

How to fetch single row from Oracle in PHP?

陌路散爱 提交于 2019-12-07 12:30:23
问题 I want to know how to fetch single row from Oracle in PHP? Chedck my script-: I want to fetch single row from ITEM_INFO table & compare that values with variables $sku & $code ...Logic I applied which works in Mysql but not working in Oracle... Each time $sku & $code contains diff. values so I just need to compare them with ITEM_INFO table & if it's matches then update the flag for the same... $query_fetch = "SELECT ITEM_NAME,SITE_CODE FROM app.ITEM_INFO WHERE ITEM_FLAG = 'N'"; $stmt = oci

How do I call an ORACLE function from OCI?

懵懂的女人 提交于 2019-12-06 17:28:07
I can call an ORACLE stored procedure through OCI in a C program by constructing the SQL command for the command, here's a brief snippet from my code: /* build sql statement calling stored procedure */ strcpy ( sql_stmt, "call get_tab_info(:x)" ); rc = OCIStmtPrepare(p_sql, p_err, sql_stmt, (ub4) strlen (sql_stmt), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT); But how do I construct a call (in my C program) to an ORACLE function with the following signature: CREATE OR REPLACE FUNCTION get_seq_number (p_table_name IN VARCHAR2, p_seq_type IN VARCHAR2) RETURN NUMBER IS To call the function in PL/SQL

PHP & Oracle - oci_connect() ORA-12705: Cannot access NLS data files

六月ゝ 毕业季﹏ 提交于 2019-12-06 13:38:39
We've been using Oracle on our server for years, but someone from IT removed it yesterday without clear warning and it's really thrown our systems! I've acted on the advice from cwallenpoole (thank you!) and have made good progress, and PHP is now at least including the oracle functions (ie oci_connect) but I am now experiencing another error message: " Warning: oci_connect() [function.oci-connect]: ORA-12705: Cannot access NLS data files or invalid environment " We have ensured the tnsnames.ora etc files are in the correct place, but still having no joy :( thank you Ok. This is my personal

PHP OCI, Oracle, and default number format

左心房为你撑大大i 提交于 2019-12-06 06:35:01
问题 When I execute a fetch from an Oracle database using PHP OCI, numbers that are less than 1 are shown as .XXXXXX, e.g. .249999 . Is there a way to set this to 0.XXXXXX or to any other format, without modifying every query to use to_char() explicitly? (Perhaps through some session parameters?) 回答1: There is no way to do what you're asking globally short of modifying php/oci-extension source code. The reason for this behavior is because oracle oci omits 0s in results and php converts all results

How to fetch single row from Oracle in PHP?

删除回忆录丶 提交于 2019-12-06 03:51:19
I want to know how to fetch single row from Oracle in PHP? Chedck my script-: I want to fetch single row from ITEM_INFO table & compare that values with variables $sku & $code ...Logic I applied which works in Mysql but not working in Oracle... Each time $sku & $code contains diff. values so I just need to compare them with ITEM_INFO table & if it's matches then update the flag for the same... $query_fetch = "SELECT ITEM_NAME,SITE_CODE FROM app.ITEM_INFO WHERE ITEM_FLAG = 'N'"; $stmt = oci_parse($conn,$query_fetch); oci_execute($stmt); while(($row = oci_fetch_array($stmt, OCI_BOTH))) { $ITEM

PHP OCI, Oracle, and default number format

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 11:43:09
When I execute a fetch from an Oracle database using PHP OCI, numbers that are less than 1 are shown as .XXXXXX, e.g. .249999 . Is there a way to set this to 0.XXXXXX or to any other format, without modifying every query to use to_char() explicitly? (Perhaps through some session parameters?) There is no way to do what you're asking globally short of modifying php/oci-extension source code. The reason for this behavior is because oracle oci omits 0s in results and php converts all results from oci to strings without performing any casting depending on column datatype. Even results in SQL*Plus

OCI runtime error when sending Hyperledger Fabric's chaincode instantiation request to peers

非 Y 不嫁゛ 提交于 2019-12-04 02:35:11
问题 Using the Hyperledger Fabric Java SDK with GO chaincode, I'm getting an error after trying to initiate my chaincode using channel.sendInstantiationProposal(instantiateProposalRequest, company.getPeers()); . This is after I successfully installed the chaincode. After calling said method, I will eventually get this error: [dockercontroller] Start -> ERRO 352 start-could not start container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused

Oracle thin driver vs. OCI driver. Pros and Cons?

ぐ巨炮叔叔 提交于 2019-12-03 22:57:41
When you develop a Java application that talks to oracle DBs, there are 2 options right? One is oracle thin driver, and the other is OCI driver that requires its own installation (please correct if I'm misunderstanding). Now, what are the pros and cons? Obviously thin driver sounds much better in terms of installation, but is there anything that OCI can and the thin one can't? Develop environment is Tomcat6 + Spring 3.0 + JPA(Hibernate) + apache-DBCP The choice of the driver depends several factors. The nature of your calls to database (e.g. it seem like your app won't be using lots of stored