oracle12c

Why does Oracle 12c query require double quotes around table [duplicate]

廉价感情. 提交于 2020-01-03 04:25:29
问题 This question already has an answer here : ORA-00942: table or view does not exist - Oracle (1 answer) Closed 4 years ago . The database I'm querying is Oracle 12c. Detailed info about database version is as follows: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production PL/SQL Release 12.1.0.2.0 - Production I'm trying to eliminate the need to have double quotes around every view or table in my SQL query. Following works (from Oracle Sql Developer GUI) select m.

ORA-00119: invalid specification ORA-00132: syntax error

寵の児 提交于 2020-01-01 12:05:50
问题 Below are outputs from my SQLPLUS startup , LSNRCTRL SERVICES, LSNRCTRL STATUS and TNSPING. Also included are my LISTENER.ORA file, TNSNAMES.ORA and my PFILE. As you can see from the SQLPLUS startup output the database will not startup because init.ora file local_listener is setup as LISTENER and it says its unable to resolve that name. However the LSNCTRL status shows the name of the LISTENER to be LISTENER, so I'm not sure how LSNCTRL utility is seeing the LISTENER and SQLPLUS can't. My

oracle how to transpose columns into rows without UNION

情到浓时终转凉″ 提交于 2019-12-31 04:42:21
问题 Assume, i have 4 columns in a table id | col1 | col2 | col3 now i want to transpose that into one column but in 4 rows: result ------- someid col1data col2data col3data How can i achieve that? Thanks! 回答1: This can be done using unpivot . select result from tablename unpivot (result for colnames in (id,col1,col2,col3)) 来源: https://stackoverflow.com/questions/39450776/oracle-how-to-transpose-columns-into-rows-without-union

Convert decimal year to date

十年热恋 提交于 2019-12-30 12:15:44
问题 I have dates in a table that are stored as decimal years. An example is 2003.024658 which translates to January 9, 2003 . I would like to convert the decimal years to Oracle's date format. I've found someone who's done this in Excel: Decimal year to date formula? =DATE(INT(B1),1,MOD(B1,1)*(DATE(INT(B1)+1,1,1)-DATE(INT(B1),1,1))) However, I can't quite figure out how to convert the logic to Oracle PL/SQL. 回答1: If you start from the assumption that the decimal portion was calculated according

How to prevent SQL injection when the statement has a dynamic table name?

久未见 提交于 2019-12-30 02:20:08
问题 I am having code something like this. final PreparedStatement stmt = connection .prepareStatement("delete from " + fullTableName + " where name= ?"); stmt.setString(1, addressName); Calculation of fullTableName is something like: public String getFullTableName(final String table) { if (this.schemaDB != null) { return this.schemaDB + "." + table; } return table; } Here schemaDB is the name of the environment(which can be changed over time) and table is the table name(which will be fixed).

SQL to check the free space allocated for a user who doesn’t have DBA access in oracle 12c

半腔热情 提交于 2019-12-25 08:31:35
问题 SQL to check the free space allocated for a user who doesn’t have DBA access. preciously in oracle 11G it was possible to use the “user_free_space” View but from oracle 12 c this view access is restricted to DBA users. (source: Release changes) SELECT ufs.tablespace_name ,(SUM(bytes) /(1024*1024)) AS FREESPACE FROM user_free_space ufs WHERE EXISTS (SELECT DISTINCT tablespace_name FROM all_tables WHERE tablespace_name IS NOT NULL AND ufs.tablespace_name = tablespace_name AND tablespace_name =

Using between operator for string which stores numbers

↘锁芯ラ 提交于 2019-12-25 06:59:25
问题 I have a column in which numbers are stored as string because of the nature of the column where any kind of data type is expected like date, numbers, alpha numeric, etc. Now i need to check if the values in that column is in defined range or not here is sample data for testing create table test (val varchar2(10)); insert into test values ('0'); insert into test values ('67'); insert into test values ('129'); insert into test values ('200'); insert into test values ('1'); Here expected range

Solution for “Could not load file or assembly 'Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' ” required

佐手、 提交于 2019-12-25 02:44:08
问题 I am trying to connect my application to ORACLE 12c but while i run the application specific windows service, getting the below error. Earlier I had both 11g and 12c and the issue appeared. So, I removed both of them and installed fresh 12c. Checked the frameworks folder for the said Oracle.DataAccess File. It is there. Also checked in odp.net folder of oracle installation. File is there with correct version. Can anyone help me out???? Assembly Load Trace: The following information can be

Problem with Embedded R Execution: SQL Interface (ORE)

你说的曾经没有我的故事 提交于 2019-12-24 22:00:19
问题 I'm new to ORE and I'm expected to work with it. To fulfill this goal, I'm studying related documents and trying to implement and practice their samples and examples. In this regard, to practice an example of embedded r script , I've faced with an error by executing below script in SQL: first I created the script: begin sys.rqScriptCreate('Example6','function(){ res <- 1:10 plot( 1:100, rnorm(100), pch = 21, bg = "red", cex = 2 ) res }');end; Then I ran it: select value from table(rqEval(

VPD policy function Modified

限于喜欢 提交于 2019-12-24 20:13:30
问题 Hello, I have asked this question yesterday but thanks to your help, I did a lot of modifications so now I'm putting the new version of my code because it's getting better but still not working. Let's assume i have the following table which is called payroll created by a user called PCM EMP_ID DEPT TOTAL TAXES -------------------- -------------------- ---------- ---------- E1 accounting 2400 100 E2 sales 2500 75 E3 research 3000 110 E4 operations 4200 120 E5 sales 4800 130 E6 sales 2500 75 E7