Translate function of oracle, equivalent function in informatica?
Hi All,
I know its off topic but i am stuck very very badly and this place turns out to be he best for my issues, here is my problem:
lets say i hve fname coming from a flatfile and the first name is 'rahul' , it should be translated as '12345' usin informatica function, now lets say the 2nd name comes which is 'rohit' it should be translated as '1o3it'. I hope my problem is clear, please help me out.
Regards
Rahul Kalra
Edited by: Mac_Freak_Rahul on Aug 10, 2011 3:18 AM
Something like this ? (just to play with) I know Informatica just by name so I don't have the faintest idea about what if the third name shows up
I don't have a database at hand so I don't dare to produce a sql (using model clause or xmlagg) solution
declare
l_rahul varchar2(9) := 'rahul';
l_rohit varchar2(9) := 'rohit';
l_char varchar2(1);
l_result varchar2(9) := '';
for i in 1 .. length(l_rahul)
loop
l_char := substr(l_rohit,i,1);
if substr(l_rahul,i,1) = l_char then
l_result := l_result || to_char(i);
else
l_result := l_result || l_char;
end if;
end loop;
dbms_output.put_line(l_result);Regards
Etbin
Similar Messages
-
What is the Oracle equivalent of the Microsoft Access FIRST function?
Using: Oracle 10gR2 RAC on SUSE Linux 9 (10.2.0.3)
In the process of converting a Microsoft Access database to Oracle, an Access query is using the FIRST function.
What is the Oracle equivalent of the Microsoft Access FIRST function?
In the attempt to convert, the Oracle FIRST_VALUE function was used. However, the same results was not achieved.
Thanks,
(BLL)
Query:
h2. ACCESS:
SELECT
TRE.GCUSNO,
UCASE([DCUSNO]) AS DCUSNO_STD,
*FIRST(UCASE([DNAME])) AS DNAME_STD*,
*FIRST(UCASE([DADDR])) AS DADDR_STD*,
*FIRST(UCASE([DCITY])) AS DCITY_STD*,
TRE.DSTATE,
FIRST(TRE.DZIP) AS DZIP,
TRE.DREGN,
TRE.DDIST,
TRE.DSLSMN,
TRE.DCHAIN,
TRE.MARKET,
TRE.MKTPGM,
TRE.EUMKT
FROM
TRE
GROUP BY
TRE.GCUSNO,
UCASE([DCUSNO]),
TRE.DSTATE,
TRE.DREGN,
TRE.DDIST,
TRE.DSLSMN,
TRE.DCHAIN,
TRE.MARKET,
TRE.MKTPGM,
TRE.EUMKT;
h2. ORACLE:
SELECT DISTINCT
TRE.GCUSNO,
UPPER(TRIM(TRE.DCUSNO)) AS DCUSNO_STD,
UPPER(TRIM(TRE.DNAME)) AS DNAME_STD,
UPPER(TRIM(TRE.DADDR)) AS DADDR_STD,
FIRST_VALUE(UPPER(TRIM(TRE.DNAME)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DNAME_STD,
FIRST_VALUE(UPPER(TRIM(TRE.DADDR)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DADDR_STD,
FIRST_VALUE(UPPER(TRIM(TRE.DCITY)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DCITY_STD,
TRE.DSTATE,
TRE.DZIP,
FIRST_VALUE(UPPER(TRIM(TRE.DZIP)) IGNORE NULLS) OVER (ORDER BY TRE.DZIP ASC) AS DZIP,
TRE.DREGN,
TRE.DDIST,
TRE.DSLSMN,
TRE.DCHAIN,
TRE.MARKET,
TRE.MKTPGM,
TRE.EUMKT
FROM CRM.TREUP100R TRE
GROUP BY
TRE.GCUSNO,
UPPER(TRIM(TRE.DCUSNO)),
TRE.DNAME,
TRE.DADDR,
TRE.DCITY,
TRE.DSTATE,
TRE.DZIP,
TRE.DREGN,
TRE.DDIST,
TRE.DSLSMN,
TRE.DCHAIN,
TRE.MARKET,
TRE.MKTPGM,
TRE.EUMKT;A slight correction to odie's post. I think you want min not max to replicate the Access first function, but see below to be sure. So:
min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
user10860953 wrote:How does one ignore null values?The min and max functions will ignore nulls automatically, so if there is a null value in tre.dname, it will not be be returned, unless all of the values are null. For example:
SQL> WITH t AS (
2 SELECT 65 id, 'ABCD' col FROM dual UNION ALL
3 SELECT 37, 'DEFG' FROM dual UNION ALL
4 SELECT 65, 'DEFG' FROM dual UNION ALL
5 SELECT 65, null FROM dual UNION ALL
6 SELECT 70, null FROM dual UNION ALL
7 SELECT 70, null FROM dual UNION ALL
8 SELECT 37, 'ABC' from dual)
9 SELECT id,
10 MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
11 MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
12 FROM t
13 GROUP BY id;
ID MIN_ MAX_
37 ABC DEFG
65 ABCD DEFG
70John -
Equivalent of DB2 functions in ORACLE 11g
Hi,
I am trying to convert the SQL queries written in DB2 to ORACLE. There are some db2 specific functions are used in the queries.I am not able to find the equivalent function in ORACLE. The function names are written below:
1) DateDD()
2) SELECT @@IDENTITY
3) SELECT *
FROM (
SELECT ROWNUMBER() OVER() AS rowId_1, INNER_TABLE.*
FROM (----)as innertable
) AS Outertable
Error is: ROWNUMBER is INVALID identifier.
4) DAYOFWEEK()
5) DAYS()
6) dayofyear()
Please help me in finding the equivalent function in ORACLE.
Thanks in advance!!You probably don't need a DateAdd function in Oracle. You can add a number to a date in Oracle-- that adds the number of days to the date.
SELECT sysdate today, sysdate+1 tomorrow
FROM dualWhy are you using DAYS()? If, as in the example, you're just trying to determine the number of days between two dates, you can subtract dates in Oracle and the difference will be a number of days (including a fractional component if applicable)
SELECT date '2011-09-27' - date '2011-09-25' difference_in_days
FROM dualIf you really need the number of days since January 1, 0001, you could subtract the date from Jan 1, 0001, i.e.
SELECT date '2011-09-27' - date '0001-01-01'
FROM dualI would assume that Oracle and DB2 would return the same number but there could well be some differences since the current calendar didn't exist in the year 1 and I know there were issues in the transition from the Gregorian to the Julian calendar where some days were decreed not to exist. It wouldn't shock me if Oracle and DB2 counted some of the days in the 1500's differently.
Justin -
Convert columns to row equivalent to stragg function in oracle sql
Hi,
Sorry i forgot my Oracle version :
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 64-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - ProductionI searched in google but i didn't found the solution.
I looking for a function in discoverer equivalent to stragg sql function.
Note : stragg function convert columns to rows.
Thanks
SELECT deptno, stragg ('-' || ename)
FROM emp_test
GROUP BY deptno;
DEPTNO STRAGG_STR
10 -CLARK-KING-MILLER
20 -SMITH-FORD-ADAMS-SCOTT-JONES
30 -ALLEN-BLAKE-MARTIN-TURNER-JAMES-WARD
3 rows selected.Edited by: Salim Chelabi on 2010-01-29 08:32Hi again,
*1- I created my function in my schema.*
CREATE OR REPLACE TYPE t_string_agg AS OBJECT
g_string VARCHAR2(32767),
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER
SHOW ERRORS
CREATE OR REPLACE TYPE BODY t_string_agg IS
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER IS
BEGIN
sctx := t_string_agg(NULL);
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER IS
BEGIN
SELF.g_string := self.g_string || ',' || value;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER IS
BEGIN
returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER IS
BEGIN
SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
RETURN ODCIConst.Success;
END;
END;
SHOW ERRORS
CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
RETURN VARCHAR2
PARALLEL_ENABLE AGGREGATE USING t_string_agg;
SHOW ERRORS
*2- I ran my query in my schema with sqlplus.*
SELECT deptno,ename,sal, string_agg(ename)over(partition by deptno) AS employees
FROM emp_test
order by deptno;
DEPTNO ENAME SAL EMPLOYEES
10 CLARK 2450 CLARK,KING,MILLER
10 KING 5000 CLARK,KING,MILLER
10 MILLER 1300 CLARK,KING,MILLER
20 JONES 2975 JONES,FORD,ADAMS,SMITH,SCOTT
20 FORD 3000 JONES,FORD,ADAMS,SMITH,SCOTT
20 ADAMS 1100 JONES,FORD,ADAMS,SMITH,SCOTT
20 SMITH 800 JONES,FORD,ADAMS,SMITH,SCOTT
20 SCOTT 3000 JONES,FORD,ADAMS,SMITH,SCOTT
30 WARD 1250 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN
30 TURNER 1500 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN
30 ALLEN 1600 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN
30 JAMES 950 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN
30 BLAKE 2850 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN
30 MARTIN 1250 WARD,TURNER,ALLEN,JAMES,BLAKE,MARTIN
14 rows selected.
*3- I import this function in discoverer administration*
4- My problem :When i use the function string_agg(ename)over(partition by deptno) in discover deskto i got the error you can't use over in this place.
Any ideas.
Thank in advance.
Regards Salim. -
Oracle Spatial functionality with WFS
Hi all
My first post here so be gentle on me ;-)
This may be an obvious question but here goes ...
When using a WFS client can you access the full SDO_... SQL functions within Oracle Spatial? I've had a read of the WFS spec and it is all a bit vague on how the queries get passed through to the data store.
Also with the WFS locking, is this done at the web server level? If so how would that impact on any direct access to the database? A bit dangerous??
Appreciate any advice on WFS implemtations with a 9i back end. I want to retain the full native Oracle functionality and still deploy via WFS ... a pipe dream??
Thanks
RichardThanks for your response Andreas
Sorry, perhaps I wasn't clear, I realise the WFS client will never directly access the data source, that it is the WFS server that makes the request to the data store, not the client, but can the call be passed through to Oracle as native SQL?
I think I found the answer in the OGC Filter Encoding Imp Spec where it desribes in great detail the optional filter component of a WFS request. It desribes the CQL filter operators that include some spatial operators. These could, I understand, be translated from CGL and Feature based schema to SQL (in GML?) and relational based schema.
While I don't think at first glance that the spatial operators in CQL match all the Oracle SDO_ functions they probably go far enough for most normal users.
Am I on the right track?
Does anyone know of any work that has been done in this filter translation to SQL and if it has been implemented successfully anywhere.
I think the locks would still pose a problem, but that's for another day :-)
Thanks
Richard -
Hi :)
I made a new function in PL/SQL transfering BLOB to CLOB.
i made this function, because I know how to translate CLOB in Oracle BI.
with this function for example:
EVALUATE('DBMS_LOB.SUBSTR(%1,40,1)',PACKET_CONTENTS)
but in my case, this Packet_content is BLOB, so i want to translate it to CLOB and than use the substr function to translate it (or part of it).
so I tried doing that:
EVALUATE('DBMS_LOB.SUBSTR(%1,40,1)',EVALUATE('BLOB_2_CLOB(%1)','111'))
the parameter "111" is a param i give to my function (just for test). and my function should return the results from the PACKET_CONTENTS in CLOB type.
the answer error i get is the following one:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14027] The navigator cannot handle the following request containing constants only: Evaluate( DBMS_LOB.SUBSTR(%1,40,1),Evaluate( BLOB_2_CLOB(%1),'111') ) as c1. (HY000)
SQL Issued: SELECT EVALUATE('DBMS_LOB.SUBSTR(%1,40,1)',EVALUATE('BLOB_2_CLOB(%1)','111')) saw_0 FROM RWD ORDER BY saw_0
Any ideas? or any other information you want to know?
thanks :)
P.S: im really new in the Oracle BI things, so I might be do silly things I cant do... so please fix me if you can :)
thanks !Are you trying to return a text string from the BLOB/CLOB? Can you not do this in a database view over the top of your existing table, removing any potential ODBC/OCI issues?
ie.
CREATE VIEW test_view AS
SELECT dbms_lob.substr( blob_column,4000,1) text_column
FROM <table>; -
Hi,
In MySQL while inserting data encode function can be used along with a user key to encode the data. Also decode function can be used to decode the data during selection. Is there any equivalent function available in Oracle for encoding and decoding.
Please advice,
Thanks,
SmithaOnly for your information. DECODE is not a function to encript or decrypt data. Decode is a comparation function. It is a other way to evaluate IF-THEN-ELSE condition.
Bye, Aron -
Hi all,
SELECT HashBytes( 'md5', '1234' )
--returns 0x81DC9BDB52D04DC20036DBD8313ED055
The above is in sqlserver do we have any such function in Oracle,
I have to compare the data in sqlserver with Oracle, I know we have the above function
in sqlserver would like to know, what is the equivalent function in Oracle.
Else if any of u have better Idea for comparasion. plz let me know.
Thanks in Advance.AAK 460425 wrote:
Thanks, I was not knowing sys is the owner,
Is there any more argument I need to pass
select dbms_crypto.hash('HELOO') from dual;
wrong number or type of argument in call to hashExample:
SQL> select dbms_crypto.hash(utl_raw.cast_to_raw('HELLO'),3) from dual;
DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW('HELLO'),3)
C65F99F8C5376ADADDDC46D5CBCF5762F9E55EB7
SQL>http://www.morganslibrary.org/reference/dbms_crypto.html -
What is the DB2 DIGIT FUNCTION equivalent in ORACLE database. We have done a migration from db2 to oracle and many programs just fails where I encounters digit function. Is there any workaroud or function present in oracle database which makes the program working.
Just share your knowledge .
[email protected]Addendum ...
OK I found what the DIGIT function does.
I am not sure if there is a function in Oracle that maps directly to DIGIT function in DB2
but you can do something like this:
select lpad(replace(to_char(abs(n)),'.'),
(select to_number(data_precision) from user_tab_columns where table_name = 'A' and column_name = 'N'),'0')
from a
In the SQL above n is the column in table A. Data_precision column gets the size of the column.
Option 2:
You could write your own function in Oracle to do what the SQL above does
create or replace function digit (col_val in number, col_name IN varchar2, tab_name IN varchar2) return varchar2
as
v_val varchar2(100);
v_prec number;
begin
select to_number(data_precision) into v_prec from user_tab_columns where table_name = upper(tab_name) and column_name = upper(col_name);
v_val := lpad(replace(to_char(abs(col_val)),'.'),v_prec,'0');
return v_val;
end;
Then use the function as follows:
select digit(n,'N','A') from a
Shakti
http://www.impact-sol.com
Developers of Guggi Oracle - Tool for DBAs and Developers
Message was edited by:
skgoel -
Convert Date function to oracle
The follwoing Sql for Sqlserver, what is the equivalent function in oracle. Need help on this.
YTD:
YOUR_DATE_FIELD between DATEADD(yy,
DATEDIFF(yy,0,@Prompt('BEGIN_DATE','D',,mono,free)), 0) AND
@Prompt('END_DATE','D',,mono,free)
MTD:
YOUR_DATE_FIELD between DATEADD(mm, DATEDIFF(mm, 0,
,@Prompt('BEGIN_DATE','D',,mono,free)), 0) AND
@Prompt('END_DATE','D',,mono,free)
WTD
YOUR_DATE_FIELD between (,@Prompt('BEGIN_DATE','D',,mono,free) -
DATEPART(dw, ,@Prompt('BEGIN_DATE','D',,mono,free)))+1 AND
@Prompt('END_DATE','D',,mono,free)Extracting month,year,day from sysdate (You may even opt to use to_char)
SQL> select extract (month from sysdate) from dual;
EXTRACT(MONTHFROMSYSDATE)
4
SQL> select extract (year from sysdate) from dual;
EXTRACT(YEARFROMSYSDATE)
2007
SQL> select extract (day from sysdate) from dual;
EXTRACT(DAYFROMSYSDATE)
5
Adding 5 days to today's date
SQL> select sysdate + 5 from dual;
SYSDATE+5
10-APR-07
Adding Months
SQL> select add_months(sysdate,3) from dual;
ADD_MONTH
05-JUL-07
Date Difference
SQL> select sysdate - to_date('01/04/2007','dd/mm/yyyy') from dual;
SYSDATE-TO_DATE('01/04/2007','DD/MM/YYYY')
4.42670139
Date Difference
SQL> select trunc(sysdate) - trunc(to_date('01/04/2007','dd/mm/yyyy')) from dual
TRUNC(SYSDATE)-TRUNC(TO_DATE('01/04/2007','DD/MM/YYYY'))
4
SQL> -
Can I call MS Excel Function in Oracle
Hi everyone,
I prototyped my application in Microsoft Excel. In this prototype, I'm using the BETADIST() function, which returns the cumulative beta probability density function. And, yes, if you're like me, and not a statistician, it's pretty crazy. Just for fun, check out the wikipedia page on it, and you'll see what I mean. Anyway, so now, I'm trying to perform the same functionality as that function in my Oracle APEX 4.0/Oracle 10g-R2 app.
I've studied this function a bunch, and I couldn't find an equivalent function in Oracle to do what this function does. CUME_DIST... nope, DBMS_STATS_FUNC... nope. So, I assumed I would need to figure out what exactly the function does and basically rewirte it in Oracle using PL/SQL. I've already got questions out on Statistics and Excel forums trying to figure that out.
But, before I go any further and reinvent the wheel by coding out the logic embedded in this function (which is very hairy, of course), I wanted to check with you all and see if there's a way to invoke this MS Excel function through Oracle. Not sure if an external procedure can get to an Excel library, or how to do it if it can.
Any ideas?
Thanks!
MarkI'm pretty sure this BETADIST exists in Java already.Not natively I think.
But one can download Cern's COLT Libraries for High Performance Scientific and Technical Computing in Java.
Loading the libraries via loadjava
loadjava -user michael/xxxx@oracle_server:1521:oracle_sid -verbose -force -order -resolve -thin colt.jar concurrent.jarand creating a function
create or replace function betadist (alpha number, beta number, c number)
return number
as
language java
name 'cern.jet.stat.Gamma.incompleteBeta(double, double, double) return double';
/is rather straightforward.
Calling it
SQL> select betadist(4,5,0.4) from dual
BETADIST(4,5,0.4)
,4059136
1 row selected.the result coincides quite well with the example given in http://www.excelfunctions.net/Excel-Beta-Dist-Function.html. -
What is the equivalent function or combination of functions for the following ASYST code
I'm translating a program from AYSYT (very old out-of-date language)to LABVIEW. Thanks to the help from you guys. I have done 99% of my work. But I still have a small question to ask for help. Dose any body know what function or combination of functions in LABVIEW is equivalent to the folowing ASYST code: 0.5 set cut off frequency MOB(array used in the program) smooth.
After reading the ASYST MANUAL, I know "smooth" is to apply some kind window(e.g. BALCKMAN).but LABVIEW doesn't have the "smooth"functionI got strange result after using balckman window.
the xy-graphs of my data before and after using blackman
window are posted here. the magnitude and the peaks all changed after using blackman window.the peaks magnitude decreased more than ten times. The original ASYST code gives only a little bit lower peak after smoothing(4.2e-6 is the highest peak before smoothing, while 3.6e-6 is the smoothed highest peak).
Attachments:
before_blackman_windowed.bmp 1747 KB
blackman_windowed.bmp 1747 KB -
What is the equivalent function of NIDAQYield in NI-DAQmx?
I have to migrate from traditional NI-DAQ to NI-DAQmx for Window 7 64bits system. I like to find the equivalent function of NIDAQYield in NI-DAQmx?
As far as I can see here, NIDAQYield is simply a way to process system events, so I suppose calling ProcessSystemEvents () will be equivalent to calling it.I do not know of a native DAQmx function that does the same. It is to be said, though, that DAQmx way of handling acquisition process is different from Traditional DAQ one and direct translation is not always possible, so depending on how you migrate your code, calling those functions may be unnecessary.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
LINQ Canonical Functions and Oracle Functions
Hello,
I am using EntityFramework (.NET 4) to access a Oracle Database (11g Express Edition Release 11.2.0.2.0 - 64bit Production).
For the most part it is working fine, but now I've stumble into a issue using LINQ Canonical Functions, that aparently are supported (see : Mapping LINQ Canonical Functions and Oracle Functions)
I am running the following expression :
var expirationDuration = 3000;
var record = Context.Table
.Where(x => x.Created.AddMilliseconds(expirationDuration) > DateTime.Now )
.FirstOrDefault();
And im getting a exception :
"LINQ to Entities does not recognize the method 'System.DateTime AddMilliseconds(Double)' method, and this method cannot be translated into a store expression."
Shouldn't AddMilliseconds be translated to (expression) + INTERVAL like the docs mentions?
Thanks for help
Regards,NunoNeither ODP.NET nor SQLClient recognizes System.DateTime AddMilliseconds(Double) method as a valid method
I would suggest you use EntityFunctions AddMilliseconds instead. -
How can i migrate Power Builder 8.0 Function into oracle PL/SQL
Hi Oracle Experts...
How can i migrate Power Builder 8.0 Function into oracle PL/SQL.. I had migrate some of the coding from PB to PL/SQL. But i don't know how can i convert PB structure(here structure is a data type) into oracle PL/SQL.
Instead of structure what is the equivalent in oracle plsql
Below i pasted my POWER BUILDER FUNCTION:
Long ll_perd,ll_lnperd,ll_mon,ll_effmon,ll_instno,ll_odno
Decimal{5} ldl_actual,ldl_diff,ldl_inst
Datetime ldt_first,ldt_exp,ldt_oddt, ldt_lastprod
String ls_instmode,ls_inst
str_batch lstr_od //Structure to store odamt and oddate
Select pay_c_final,lon_d_expiry, lon_d_lastprod
Into :ls_inst,:ldt_exp, :ldt_lastprod
From loan_mast
Where branch_c_code = :gs_branch and
act_c_type = :as_actype and
act_c_no = :as_acno;
If Sqlca.Sqlcode = -1 Then
f_message('FT-0189',Sqlca.Sqlerrtext)
lstr_od.batchslno = -1
Return lstr_od
End If
If adt_prodt > ldt_exp Then
Select Ceil(months_between(:adt_prodt,:ldt_exp)) Into :lstr_od.batchslno From dual;
lstr_od.cheqdt = ldt_exp
lstr_od.batchslno = DaysAfter(Date(ldt_lastprod), Date(adt_prodt))
Else
If ls_inst = 'N' Then
If adt_prodt > ldt_exp Then
Select Ceil(months_between(:adt_prodt,:ldt_exp)) Into :lstr_od.batchslno From dual;
lstr_od.cheqdt = ldt_exp
Else
lstr_od.batchslno = 1
End If
ElseIf ls_inst = 'Y' Then
Select first_d_due,lon_c_instperd,lon_n_perd
Into :ldt_first,:ls_instmode,:ll_lnperd
From loan_mast
Where branch_c_code = :gs_branch and
act_c_type = :as_actype and
act_c_no = :as_acno;
If Sqlca.Sqlcode = -1 Then
f_message('FT-0189',Sqlca.Sqlerrtext)
lstr_od.batchslno = -1
Return lstr_od // Return Structure
End If
Select Ceil(months_between(:adt_prodt,:ldt_first)) Into :ll_mon from dual;
If ll_mon > 0 Then
Select Nvl(ln_n_balance,0),Nvl(ln_n_instlamt,0),Nvl(ln_n_instlno,0)
Into :ldl_actual,:ldl_inst,:ll_instno
From loan_inst_sch
Where act_c_type = :as_actype and
act_c_no = :as_acno and
ln_d_effdate = (Select Max(ln_d_effdate)
From loan_inst_sch
Where act_c_type = :as_actype and
act_c_no = :as_acno and
ln_d_effdate < :adt_prodt);
If Sqlca.Sqlcode = -1 Then
f_message('FT-0224', Sqlca.Sqlerrtext)
lstr_od.batchslno = -1
Return lstr_od
ElseIf Sqlca.Sqlcode = 100 Then
lstr_od.batchslno = 1
* Return lstr_od*
End If
If adl_bal > ldl_actual Then
If ldl_inst > 0 Then
lstr_od.batchslno = (adl_bal - ldl_actual) / ldl_inst
End If
Else
lstr_od.batchslno = 1
End If
If lstr_od.batchslno = 0 Then lstr_od.batchslno = 1
//For full OD
If ll_mon > ll_lnperd Then
lstr_od.batchslno = (ll_mon - ll_lnperd) + lstr_od.batchslno
End If
If ls_instmode = 'Q' Then
lstr_od.batchslno = lstr_od.batchslno * 3
ElseIf ls_instmode = 'H' Then
lstr_od.batchslno = lstr_od.batchslno * 6
ElseIf ls_instmode = 'Y' Then
lstr_od.batchslno = lstr_od.batchslno * 12
End If
Select :adt_prodt - :lstr_od.batchslno Into :lstr_od.cheqdt From dual;
If ls_instmode = 'M' Then
ll_odno = ll_instno - lstr_od.batchslno // To get OD Date
Select ln_d_effdate
Into :lstr_od.cheqdt
From loan_inst_sch
Where act_c_type = :as_actype and
act_c_no = :as_acno and
ln_n_instlno = :ll_odno;
If Sqlca.Sqlcode = -1 Then
f_message('FT-0224', + Sqlca.Sqlerrtext)
lstr_od.batchslno = -1
Return lstr_od
End If
End If
Else
lstr_od.batchslno = 1
End If
End If
End if
Return lstr_od
Thanks in adance
Arun M MWhat are you going to return the structure to? What I would normally use here if the code was going to be used by other PL/SQL would be a PL/SQL object type.
However, if PowerBuilder is still in the equation (you're moving the logic to PL/SQL but keeping PowerBuilder for the GUI ), then you'll have to return something else, because PowerBuilder doesn't understand PL/SQL object types. Perhaps passing a REF CURSOR as a OUT argument and populating it from the procedure. PowerBuilder could then retrieve the result of the procedure using a stored procedure based DataWindow.
Maybe you are looking for
-
Exchange 2013 CU7 - Frequent Outlook 2013 Disconnections and Delays
We currently have the following environment: Windows 2012 VM on Hyper-V with 24GB of RAM and 4 virtual procs (1 socket) Cisco UCS, B200 M3 Blades Exchange 2013 CU7 Exchange 2007 is in our environment, but public folders have been removed and only a f
-
Internationalization of a WebDynpro Application
Hi, i was writing a WD Application who has to be multilanguage (de, fr ,it). I have translated every View with the xlf-Files. The Application has to run in a SAP Portal EP6 Enviroment with Anonymous- and Authenticated-User. Every time when i start my
-
Logic hangs when loading EXS samples on a session that worked yesterday?
I'm using Logic 8.0.2, I try to open session I was working on yesterday and it now won't open? it seems to not be able to find the EXS samples, as it hangs on the grey bars that show Logic trying to find the relevent samples. it takes forever to look
-
Install EP 6.0 sp2 with cd n°51030419
Hi, I'm installing the Portal with cd n° 51030419. The installation dosn't arrive at the end because the sap j2ee doen't start / stop during the last step. In the previus step I see the j2ee was started, but also disconnect with this message: "[Frame
-
Data source for Profit center wise Receivables
Hi Friends, Is there any data source/query for getting the Profit center wise Receivables and Cost center wise payables. please guide me to get the same. Thanks in advance Karthik