oracle11g

Retrieving Data From Returned Oracle Timestamp Column

我是研究僧i 提交于 2021-02-20 09:57:47
问题 We have a ColdFusion 8 (Linux) application that uses an Oracle timestamp. We just converted to Oracle 11g from 10g and we're now using Oracle's thin client on the data sources. We're getting an error in the application where a timestamp column is selected. It seems as though an object of class oracle.sql.TIMESTAMP is being returned. I verified this by dumping the contents of the column. Sure enough, it gives me a break down of the object's methods and their return types. But, I can't seem to

Oracle 11g - run windows batch file to run multiple sql files in sqlplus

陌路散爱 提交于 2021-02-19 04:02:37
问题 I would like to use a single batch file to execute multiple sql in a sequence.. IE: sql2 script calls a table created by sql1 script.. etc.. here is the batch code I have so far.. it works to run a single sql file but I need it to run the first one and then then next.. thanks in advance. @ECHO OFF echo. echo. SET /P uname=Username: echo. echo. SET /P pass=Password: echo. echo. SET /P mydatabase=Database: echo. echo. set oracle_sid=ins sqlplus -s %uname%/%pass%@%mydatabase% @J:/A/scripts/

How to count the rows which contains non zero values in sql

最后都变了- 提交于 2021-02-17 05:09:16
问题 SELECT round(COUNT(dmd_1wk),2) AS NBR_ITEMS_1WK FROM table; Field dmd_1wk has so many zeros in it. How do I Count the non zero values? 回答1: Methinks bluefeets answer is probably what you are really looking for, as it sounds like you just want to count non-zeros; but this will get you a count of zero and non-zero items if that's not the case: SELECT ROUND(SUM(CASE NVL(dmd_1wk, 0) = 0 THEN 1 ELSE 0 END), 2) AS "Zeros", ROUND(SUM(CASE NVL(dmd_1wk, 0) != 0 THEN 1 ELSE 0 END), 2) AS "NonZeros"

Creating table via SQL Command Line, invalid identifier

橙三吉。 提交于 2021-02-17 03:31:18
问题 I'm currently learning SQL and I've installed oracle 11g express on my system. I'm trying to create a table however when I try to run the below command I get the following Error Message: ERROR at line 3: ORA-00904 : invalid identifier CREATE TABLE PROJECTS ( proID NUMBER(4) NOT NULL, Desc CHAR(20), sDate DATE, eDate DATE, Budget NUMBER(7,2), maxStaff NUMBER(2) ); Can anybody please tell me what I'm doing wrong? Thanks for all the replies, I ran this command succesfully: CREATE TABLE PROJECTS

dynamic table name in cursor

风格不统一 提交于 2021-02-16 20:25:24
问题 I am trying to insert data whose schema is dynamic, as in user enters the schema name. For some reason I get ORA-000942: table doesn't exist even though table is there in the correct schema. Here is the code: declare l_ext_files_names varchar2(4000) := '&1'; l_schema_name varchar2(4000) := '&2'; l_table_name varchar2(4000) := l_schema_name||'.files_tbl'; l_int_files_names varchar2(4000); c_file_name sys_refcursor; begin open c_file_name for 'select file_names from '||l_table_name; loop fetch

sql order by with group by rollup

≯℡__Kan透↙ 提交于 2021-02-11 12:58:05
问题 My query looks like below with the foll. output Current Output Role Cases prepped % Completed State Member 1 10 5 50% State Member 2 10 7 70% State President 10 2 20% Summary 30 14 46.6% Output Expected Role Cases prepped % Completed State President 10 2 20% State Member 1 10 5 50% State Member 2 10 7 70% Summary 30 14 46% Roles table id name 30 State President 40 State Member This is my query, SELECT COALESCE(ROLE, 'Summary') ROLE, count(*) AS cases, SUM(CASE WHEN PREPARED = 'Y' THEN 1 ELSE

sql order by with group by rollup

こ雲淡風輕ζ 提交于 2021-02-11 12:57:15
问题 My query looks like below with the foll. output Current Output Role Cases prepped % Completed State Member 1 10 5 50% State Member 2 10 7 70% State President 10 2 20% Summary 30 14 46.6% Output Expected Role Cases prepped % Completed State President 10 2 20% State Member 1 10 5 50% State Member 2 10 7 70% Summary 30 14 46% Roles table id name 30 State President 40 State Member This is my query, SELECT COALESCE(ROLE, 'Summary') ROLE, count(*) AS cases, SUM(CASE WHEN PREPARED = 'Y' THEN 1 ELSE

oracle.dataaccess invalid username/password

笑着哭i 提交于 2021-02-11 09:45:35
问题 I am having a asp.net web application in which I am connecting to a Oracle DB using oracle.DataAccess component. My DBA created a new account and when I try to login with that account in toad, it simply worked fine but when I am passing the values in connection string in SERVER A it is giving me invalid username/password. I double checked the credentials and they are correct. Then I copied the entire website into a new SERVER B and when i tried, I am able to login to the oracle DB. I am very

oracle.dataaccess invalid username/password

点点圈 提交于 2021-02-11 09:44:41
问题 I am having a asp.net web application in which I am connecting to a Oracle DB using oracle.DataAccess component. My DBA created a new account and when I try to login with that account in toad, it simply worked fine but when I am passing the values in connection string in SERVER A it is giving me invalid username/password. I double checked the credentials and they are correct. Then I copied the entire website into a new SERVER B and when i tried, I am able to login to the oracle DB. I am very

oracle.dataaccess invalid username/password

随声附和 提交于 2021-02-11 09:44:07
问题 I am having a asp.net web application in which I am connecting to a Oracle DB using oracle.DataAccess component. My DBA created a new account and when I try to login with that account in toad, it simply worked fine but when I am passing the values in connection string in SERVER A it is giving me invalid username/password. I double checked the credentials and they are correct. Then I copied the entire website into a new SERVER B and when i tried, I am able to login to the oracle DB. I am very