oracle11g

Can't connect to Oracle using tns

倾然丶 夕夏残阳落幕 提交于 2019-12-11 03:56:09
问题 I'm using an Oracle 11g R2 database. I use Oracle SQL Developer. If i create a new connection and check Basic Connection Type and fill the fields i can connect. If i select TNS and select the one i want in the dropdown menu, it says Failure E/S Exception: The Network Adapter could not establish the connection. This is the tnsnames.ora. I use it to connect to 2 database, dblilly and astrea. I can connect correctly to astrea. Listener is on and the instances ready. Do you see something i miss?

Calling oracle stored procedure which start a job in Asp.Net page

纵饮孤独 提交于 2019-12-11 03:42:25
问题 Because in a .net application which use the OracleClient one can't use the method: BeginExecuteNonQuery which allow you to call a procedure and don't wait the end. http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.beginexecutenonquery.aspx I was thinking to create a procedure that fire a job. http://www.ulaska.com/oracle/oracle_procedure_job_submit.html do you think this would works ? 回答1: I think your solution would works I don't see any problem with calling stored

Why does ora_rowscn change without updating a table

China☆狼群 提交于 2019-12-11 03:38:43
问题 I work with ora_rowscn to track the changed rows on a table and to work with updated rows. Last week I noticed that for some (not all) of my tables that I created with rowdependencies , the ora_rowscn changes without any transactions on the table. I mean if I select max(ora_rowscn) I get always higher number. Here is an example how I created my table creating table create table test ( test_id number, txt varchar2(5) ) rowdependencies; Inserted some data into the table insert into test values

SQLPlus varchar2 outputs whitespaces

本小妞迷上赌 提交于 2019-12-11 03:35:14
问题 When I query my table like below, the output of the column "NAME" is way too long. I recently changed the data type to VARCHAR2(150) instead of VARCHAR(150) to not save whitespaces. However, the output seems to include (some?) whitespaces anyway. Can anyone clearify what's going on here? Am I looking at whitespaces here, or is the problem only my terminal/console, or can SQLPLUS itself has something to do with it? Using Windows' terminal. SQL> SELECT * FROM SYS.O1_Orders; ID ---------- NAME -

Oracle 11g - SQL to Calculate time difference between several rows

吃可爱长大的小学妹 提交于 2019-12-11 03:29:19
问题 PROBLEM I'm still finding my feet with SQL and trying to calculate how long a certain user has been scanning items during their shift. Each scan is timestamped generating a unique 9 digit sequence number ( SEQ column) and date/time in the format 05-NOV-16 15:35:24 ( THE_DATE column). The person may be scanning for several hours, and what im trying to do is subtract the first timestamp they generated from the very last timestamp at the end of their shift. So for example given this data sample:

oracle how to alter table add partition by range interval

余生长醉 提交于 2019-12-11 03:26:31
问题 i have searched a lot but i have found nothing about how to add a range partition to an existing table alter table myuser.mytable add PARTITION BY RANGE (mynumber) INTERVAL (1) ( PARTITION p1 VALUES LESS THAN (108)) that gives me ORA:14150 error, SUBPARTITON keyword is missing, but i dont want to give subpartition 回答1: If your existing Table is Non-Partitioned you will have to: CREATE a new TABLE with partition definitions. Lets call this table MYTABLE_NEW INSERT into MYTABLE_NEW all data

How do I fetch values from a DBMS_SQL cursor derived from a SYS_REFCURSOR?

懵懂的女人 提交于 2019-12-11 03:23:11
问题 I'm trying to iterate over a cursor number from DBMS_SQL.TO_CURSOR_NUMBER, and running into problems – when I try to pull a value into a variable, I get ORA-01007 (variable not in select list). Here's a code block that replicates my problem: DECLARE cur SYS_REFCURSOR; nm INTEGER; colDescs DBMS_SQL.DESC_TAB2; numCols INTEGER; val VARCHAR2(3); BEGIN OPEN cur FOR SELECT 'x' AS foo, 2 AS bar FROM dual; nm := DBMS_SQL.TO_CURSOR_NUMBER(cur); DBMS_SQL.DESCRIBE_COLUMNS2(nm, numCols, colDescs); DBMS

Application Express: Anonymous PL/SQL Block and Bind Variables

谁说我不能喝 提交于 2019-12-11 03:18:58
问题 I'm having an issue binding the value of a page item to a declared variable in an anonymous PL/SQL block process. The problem is that the page item (:P4550_REQUESTOR) is not populated with a value until a conditional is met. It appears that the PL/SQL block process is binding the variable to an empty value as soon as the page is loaded, despite the fact that the process does not fire until a specific button has been clicked. Here is my code: DECLARE v_email_to app_user.email%type; v_requestor

ORA-01465: invalid hex number in python django

为君一笑 提交于 2019-12-11 03:07:01
问题 I'm trying to upload multiple files in oracle 11g database using python django. Here's my view for filecol in request.FILES.getlist('file'): filename = filecol.name filetype = filecol.content_type fileblob = filecol.read() FileRecord.objects.create(O_FILE_ID=oID, FILE_NAME=filename, FILE_TYPE=filetype, FILE_BLOB=fileblob, DATE_UPLOADED=datetime.datetime.now().replace(microsecond=0)) Then I received this error message return self.cursor.execute(query, self._param_generator(params)) django.db

USING clause in oracle 11g

 ̄綄美尐妖づ 提交于 2019-12-11 02:56:23
问题 select e.employee_id,e.last_name,e.department_id, d.department_name,l.city,l.location_id from employees e join departments d on e.department_id=d.department_id join locations l on l.location_id=d.location_id and e.manager_id=149; Can we Replace 'ON' clause with 'USING' clause. -used Employees,Departments,Locations table in oracle 11g. Try It. 回答1: No you cannot just replace ON with USING . But you can rewrite the query to contain USING clause in joins. See correct syntax below: select e