SQL & PL/SQL :: Sybase To Oracle Conversion

May 6, 2010

I am converting sybase to oracle database. during the migration, i have small doubt in triggers.

sybase source

create trigger testss_dt
on test
for delete
as
if @@rowcount = 0
return
insert into test
select id from deleted
return

I have converted oracle code here

create or replace trigger testss_dt
before delete on test
for each row
begin
insert into test
values(:old.test);
end;

But i have ignores @@rowcount concepts in oracle. what @@rowcount indicates in trigger?

View 10 Replies


ADVERTISEMENT

SQL & PL/SQL :: Migrate Sybase To Oracle Conversion

Apr 23, 2010

i want to migrate sybase stored procedure to oracle stored procedure.

sybase stored procedure:

create proc checkcontract @titleid tid
as
delete from titile where titile_id=@titleid
return 0

we need to migrate this procedure to oracle stored procedure. If we are using return 0 in SP in oracle means, it returns the end of the procedure statements(according to oracle statements). but sybase indicates that return 0 does not return 0 value during the run time. The return 0 implies that SP completed successfully. In oracle, i have converted stored procedure into SP and also stored functions.

Oracle Scripts:
Stored Procedure:

create or replace procedure checkcontract(v_titile varchar2)
as
begin
delete from titile where titile_id=v_titleid;
end;
/

Stored Functions:

create or replace functions checkcontract(v_titile varchar2)
as
return number
begin
delete from titile where titile_id=v_titleid;
return 0
end;

Give the comments which one is correct or accurate.

Oracle SQL developer also recommeds STORED FUNCTION. But in my application code, don't assign any output variable to this procedure. If i am using Stored Functions, we need to assign value and assign the output of the SF. we don't want to change the application code.

View 4 Replies View Related

SQL & PL/SQL :: What Would Be The Sybase Str Equivalent In Oracle

Mar 4, 2010

What would be sybase str(approx_numeric [, length [, decimal] ]) equivalent in oracle.

Sybase call :

select str(10000.5555, 6, 3) as Test.

Tset
-------
10001

View 4 Replies View Related

Zero Downtime Migration From Oracle To Sybase

Aug 3, 2012

Is there any way/ tool to migrate from oracle to sybase with Zero Downtime?

View 2 Replies View Related

SQL & PL/SQL :: Difference Between Sybase Raise Error And Rasie_application_error In Oracle?

May 6, 2010

I try to convert sybase raiseerror into oracle raise application error.

sybase code :

raiserror 20100 "can't add a contact number that's in the contact"

oracle

raise_application_error (
-20002, ':can''t add a contact number that''s in the contact');

the sybase error number 20100 unable to use in oracle due to the limitation of error number.RAISE_APPLICATION_ERROR should be negative and between -20000 and -20999.

how to use sybase error number in oracle?

View 2 Replies View Related

Replication :: Golden Gate - Replicate Data From Oracle To Sybase

Oct 17, 2007

Implemented the Golden Gate replication tool? In particular, to replicate data from Oracle to Sybase?

No details are needed, just a quick nod indicating "yes, it has been done successfully".

View 1 Replies View Related

Server Utilities :: Migration From Sybase To Oracle 1 Table Fails With SQL Error ORA-01841

Jul 17, 2012

im trying to migrate Sybase 12.5 to oracle 11G R2 on linux all tables are fine expect one which fails with error

"SQL Error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0
01841. 00000 - "(full) year must be between -4713 and +9999, and not be 0"
*Cause: Illegal year entered
*Action: Input year in the specified range"

i have change the data type from CHAR to VARCHAR2 etc as for the datatype date shows as date on the tool - I'm using sqldeveloper from oracle.

View 8 Replies View Related

Security :: Moving Application Security To Oracle From Sybase

Aug 18, 2010

In Sybase, my application was using system tables to perform application login security. Those tables obviously don't exist in Oracle. I am looking for ways to provide the following functionality in an Oracle world:

1. How to determine 'x' days of inactivity based on "last login date"?

2. How to determine when a new user logs in for the first time and force them to change their password?

3. If we need to reset a users password, how can we require the user to change their password?

4. Is there any other option other than storing a user-id/password in the application code for locking a user's account if their account needs to be locked due to inactivity?

5. In the USER_USERS view there is a status column. What the different status's can be?

View 3 Replies View Related

SQL Server To Oracle Conversion

Aug 29, 2013

I have one query in SQL server. I want to convert that query to Oracle. Well i am not that good with writing queries in Oracle. Following is the query in SQL server.

DECLARE @StartYear AS INT = 2010;
DECLARE @EndYear AS INT = 2014;

WITH
years
AS (SELECT YYYY = @StartYear
UNION ALL
SELECT yyyy + 1
FROM years
WHERE yyyy < @EndYear)
[code].......

Which Gives output in following format.

id_datedateYearMonthNumberMonthDayOfMonthDayOfWeekNumberDayOfWeekWorkingDay
201001011/1/201020101January16Friday1
201001021/2/201020101January27Saturday0
201001031/3/201020101January31Sunday0
201001041/4/201020101January42Monday1
201001051/5/201020101January53Tuesday1

View 3 Replies View Related

Conversion From SQL Server To Oracle

Nov 6, 2011

is there any licensed version tool available to convert objects from sql server to oracle especially procedures? I have tried with open source tools but that tool didn't convert properly.

View 7 Replies View Related

SQL & PL/SQL :: Oracle Database To Mysql Conversion

Dec 21, 2012

Is it possible to convert oracle data base to MySql?

View 1 Replies View Related

SQL & PL/SQL :: Oracle Date Conversion Errors

Mar 14, 2011

I am having a strange issue with date conversion. The errors encountered are :

PLS-00382: expression is of wrong type
PLS-00306: wrong number or types of arguments in call to '>'

The situation or test case is as follows:

create table sand_programs(prog_code varchar2(20), prog_end_dt date);

create table sand_program1(prog_code varchar2(20), filing_date number(15));
Result : Both the tables are created.

Now I create a procedure below as mentioned, to check if the filing_date is greater than the prog_end_dt or not.If the filing_date is greater than prog_ end_dt, then it should go to the 1st "dbms_output.put_line" message else it should go to the 2nd "dbms_output.put_line" message.

Here's my procedure:

create or replace procedure test_sand(p_program_cd in number) is
v_prog_end_dt date;
v_filing_date number;
begin
[code]....

View 6 Replies View Related

SQL & PL/SQL :: Date Conversion From Unix To Oracle

Jun 14, 2010

I have a UNIX shell script as following,

#runs the selected process
${ORACLE_HOME}/bin/sqlplus -s ${USER_PASS} >${TMP_FILE} <<EOF
set pause off
set verify off
set pagesize 0
set linesize 2000
set timing off
[code].........

I am passing a Date to the Oracle Procedure in `date +'%b_%d-%H:%M:%S'` format.

rmsqa813.2 /home/ashlaksh> echo `date +'%b_%d-%H:%M:%S'`
Jun_14-02:26:37

The oracle Procedure's SQL is as following,

SELECT ffdh.fiscal_doc_id INVOICE_ID,
ffdh.location_id LOCATION_ID
FROM fm_fiscal_doc_header ffdh,
fm_schedule fs
[code]........

The above SQL is not getting the data as the Date format "AND ffdh.last_update_datetime <=i_last_update_datetime " is not matching..

Do I need to convert the Date ? ( But i_last_update_datetime is DATE)

View 1 Replies View Related

JDeveloper, Java & XML :: Oracle PL/SQL Conversion

Jun 24, 2011

How to revert the following so that the output should be '<testPrice>1000</testPrice>'.

select htf.escape_sc('<testPrice>1000</testPrice>') from dual;
<testPrice>1000</testPrice>

View 4 Replies View Related

SQL & PL/SQL :: Oracle Functions Date Conversion

Jan 20, 2011

the data in the column is in below format
---------------------
2/10/2009 9:28:41 PM
mm/dd/yyyy

my requirement is
--------------------
20090210
YYYYMMDD

View 5 Replies View Related

SQL & PL/SQL :: Oracle Date / Time Zone Conversion

Aug 13, 2012

I would like to know how to convert the following:

13-AUG-12 03.30.06.146 PM

to the format:

"MM/DD/YYYY HH:MI:SS AM"...

I believe there is a time zone issue here as well, since the should actually be around 11:30am. I am not sure what time zone is being used.

View 2 Replies View Related

Client Tools :: Error When Trying To Connect Sybase Through SQL Developer

Nov 17, 2012

I am getting bellow error message when trying to connect Sybase through Sql developer: status:failure-test failed:IO Error:The network adapter

View 1 Replies View Related

Networking And Gateways :: Can't Connect To Sybase (ASA) Via Database Gateway

Sep 6, 2009

I'm trying to connect from Oracle 11g (11.2.0.1.0) to Sybase Adaptive Server Anywhere (9.0.2.3527). My Oracle environment is running on Linux Centos 5.3, the sybase database runs on a Windows Server.

All my attempts have failed so far - both through Oracle Database Gateway for Sybase and via Oracle Database Gateway for ODBC in combination with freeTDS. Using either way I'm ending up with apparently the same error:

ASA Error -611: Transact-SQL feature not supported

When I use db link created via dg4sybs (Oracle Database Gateway for Sybase) I get this:
SQL> SELECT * FROM aaa@hvx;
SELECT * FROM aaa@hvx
*
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:

[code]....

When I use db link created via dg4odbc (Oracle Database Gateway for ODBC) and freeTDS driver I get this:

SQL> SELECT * FROM aaa@hvx1;
SELECT * FROM aaa@hvx1
*
ERROR at line 1:
ORA-28511: lost RPC connection to heterogeneous remote agent using
SID=ORA-28511: lost RPC connection to heterogeneous remote agent using

[code]....

It seems both drivers use Transact-SQL instructions which are then denied by ASA. I'm not familiar with Sybase products at all, but as far as what my googling revealed the Transact-SQL is only supported in Adaptive Server Enterprise (enterprise-class version of Sybase's database). I couldn't figure out if there's a way how to disable Transact-SQL in the driver configuration. how to connect from Oracle (10g or 11g) to Sybase Adaptive Server Anywhere?

View 3 Replies View Related

SQL & PL/SQL :: Value Conversion?

Apr 23, 2012

Some app (wich I can't touch) stores a value that I need to modify with a trigger or even with a view.

Original value: 7B751BF0 (2071272432 in decimal)
Stored value: 4028331387 (F01B757B in hexa)

To make things short, I'm getting 4028331387 and I need to convert it to 2071272432.

View 6 Replies View Related

LMT To DMT Conversion?

Mar 12, 2013

I need to move one of my LMT tablespace to DMT, Can I do it , I know that the DMT's are depreciated since Oracle 9i but still need to know this.I am trying the below mentioned method to achieve the same.

SQL> exec DBMS_SPACE_ADMIN.TABLESPACE_MIGRATE_FROM_LOCAL('USERS');But I am facing the below mentioned error:
BEGIN DBMS_SPACE_ADMIN.TABLESPACE_MIGRATE_FROM_LOCAL('USERS'); END;

*
ERROR at line 1:
ORA-10616: Operation not allowed on this tablespace
ORA-06512: at "SYS.DBMS_SPACE_ADMIN", line 216
ORA-06512: at line 1

View 10 Replies View Related

SQL & PL/SQL :: Date Conversion

Jan 12, 2012

I have an issue with date conversion. In my table dates are in this formate:

04-DEC-90 10:46:46

I need to convert it in To_date.

SQL> select to_date('04-DEC-90','dd-mon-yy') from dual;

TO_DATE('04-DEC-90','DD-MON-YY
------------------------------
04/12/2090

SQL>

But the year shoul be 1990 not 2090.

View 3 Replies View Related

SQL & PL/SQL :: Number Conversion

Jan 4, 2013

I have a table datatype number (12,10) that I am reading out of. I am taking the value from this source table and inserting it into a destination table of datatype number (12,15).

I do not have the ability to alter the tables. How can i convert this number so i can insert. I am currently getting the error "ORA-01438: value larger than specified precision allowed for this column"

I am trying to use the to_number, but it not working. How can i format this number field so i can read it from source where i have number (12,10) and insert it successfully in a higher precision table of number(12,15)

View 1 Replies View Related

Example For Conversion Functions

Mar 27, 2012

Again i getting confused with conversion function especially Explicit data type conversions. some cases oracle server automatically converts the data to the required type. This is called IMPLICIT CONVERSION. Explicit conversions are done by using the conversion functions.

Oracle Explicit Data Type Conversions are

1 TO_CHAR
2 TO_DATE
3 TO_NUMBER

View 1 Replies View Related

SQL & PL/SQL :: Row To Column Conversion 2

Jan 13, 2011

SELECT EMPNO ,ESAL,DEPTNO FROM EMP;

O/P

EMPNO ESAL DEPTNO
101 1000 10

I WANT O/P LIKE THIS

REQUIRED O/P

101
1000
10

View 5 Replies View Related

PL/SQL :: Column To ROW Conversion?

Jan 21, 2013

My requirement is to converts row to Column information and sum of column in Weight kg in below manner Data in columns are not of same nature they can keep on changing

Item Supplier Consumer Package DWP_NO DWP_ED Quality_code Pakaging Material WEIght kg
80026020 13984
90225217 21385 1 1 3 Not Applicable 22-paper .001
90218863 16578 1 1 1 Not Applicable 04-low density polyethylene (0.002+.002+.002)=.008
90218349 14507 1 1 1 Not Applicable 05-polypropylene,22-paper (.02+.05) =.07
40221108 21519 3,2,1 1 2 IKEA-CB-60 22-paper (.32+0.3+0.45)=1.07

find table structure

CREATE TABLE TEST_ROW_TO_COL
(
ITEM_CODE VARCHAR2(10 CHAR),
SUPPLIER_CODE VARCHAR2(10 CHAR),
"Consumer Package" NUMBER(2),

[code]...

ans insert statement of sample data

--SQL Statement which produced this data:
-- select * from Test_row_to_col where
item_code in ('80026020','90225217','90218863','90218349','40221108')

[code]...

I am using Oracle 11g

View 1 Replies View Related

Epoch Date Conversion

May 31, 2011

My company uses Remedy which stores date/time as an integer. I use the following formula to convert it to a readable date:

TO_CHAR(TO_DATE('01/01/1970', 'MM/DD/YYYY HH:MI:SS AM')+ ((createdate - 4*3600)/(60*60*24)),'MM/DD/YYYY HH:MI:SS AM') as Create_Date

I have to use the "4*3600" in order to get the date to show up correctly, but even then the date sometimes comes up wrong. If the date occurs in the morning, then the date shows up as the previous day. I am sure this is probably due to the offset I am adding in the above formula. If I don't add the 4 hour offset, then the date shows up 4 hours off.

View 3 Replies View Related

Number To Float Conversion

Aug 11, 2010

I have coluum value like 00000000399. i need to convert the float like i mentioned

00000000399 should be loaded as 3.99

00000001197 should be loaded as 11.97

00000000003 should be loaded as 0.03

wat option i try to change the value

View 1 Replies View Related

Ora-01460 With No Conversion Attempts?

Feb 1, 2007

This is my query:

DELETE FROM GR_GUEST WHERE GUEST_NAME='Ambassador Jack Binns bring Patrick Clawson' AND RESERVATION_ID_FK=21635

It gives an ORA-01460 which is "unimplemented or unreasonable conversion requested"Removing the " AND RESERVATION..." gives the same error.

The problem is that GUEST_NAME is a VARCHAR (150) and RESERVATION_ID_FK is an INT so I don't see where any conversion is coming in.I had changed the name a little bit as it used to a (, ) and a : in the GUEST_NAME. I thought that might be causing the issue so I removed them with a REPLACE through an UPDATE query. However, the record still needs to be deleted.

It should be a simple query as it happens on this table all the time, so I don't know why this one is different.

View 3 Replies View Related

Time Conversion To Yyyy - Dd - Mm

Mar 5, 2008

1075329297.572

This is unix time where 1075329297 is seconds 572 is milliseconds.

first il store this time in oracle database.when i am retrieving it i want this date into yyyy-dd-mm format. Is it possible to do it in oracle.(using convert function) or is there some other way?

View 8 Replies View Related

SQL & PL/SQL :: Char To Date Conversion?

Feb 7, 2013

converting a string to date, my string looks like '01022013' '04022013', I tried to_date('01022013', 'dd-mm-yyyy') but couldn't work.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved