Finder/sql - scalar functions

Hi , I am running WLS7sp1, oracle 8.1.7 with the classes12.zip drivers
I have a finder method as follows:
<query>
          <query-method>
               <method-name>findDistinctDrivenFields1</method-name>
               <method-params>
               <method-param>java.lang.String</method-param>
               <method-param>java.lang.String</method-param>
               <method-param>java.lang.String</method-param>
               <method-param>java.lang.String</method-param>
          </method-params>
          </query-method>
     <ejb-ql>
     <![CDATA[
SELECT o FROM DrivingDrivenMatrix AS o
WHERE
o.paramId = ?1 and
((o.drivingField = ?2 and
(o.drivingCondition = 'BETWEEN' and
(?4 BETWEEN {fn substring(o.drivingValue,1,{fn
locate(o.drivingValue, 'and') } - 1) } and
{fn substring(o.drivingValue,{fn
locate(o.drivingValue, 'and')} +3,{fn length(o.drivingValue)})}
]]>
</ejb-ql>
</query>
When ejbc runs ,
it throws the error:
[java] ERROR: Error from ejbc: Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'.
The error was:
[java]
[java] weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:
[java] While trying to process Query
[java] Method Name: findDistinctDrivenFields1
[java] Parameter Types: (java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
[java] EJB Query: ......
[java] Could not parse EJB QL expression: .....
[java] weblogic.ejb20.ejbc.EJBCException: antlr.TokenStreamRecognitionException:
unexpected char: {
[java] Error in 'BETWEEN' expression.
[java] Check the BETWEEN syntax: expr1 [NOT] BETWEEN expr2 AND expr3
[java] Check that no EJB QL keywords are being used as arguments: expr1, expr2
or expr3.
[java] Error in WHERE clause.
[java] Check that no EJB QL keywords are being used as:
[java] variable names.
I guess if I have use functions like substring, locate, length in my finder I
have to use it as
eg: {fn substring() }
which is what I am doing above.
If I do not put the fn keyword in the finder, at runtime I get the following error
java.sql.SQLException: Non supported SQL92 token at position: 757: fn
java.sql.SQLException: Non supported SQL92 token at position: 757: fn
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:829)
at oracle.jdbc.driver.OracleSql.handleToken(OracleSql.java:152)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:112)
at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:64)
at oracle.jdbc.driver.OracleConnection.nativeSQL(OracleConnection.java:762)
at oracle.jdbc.driver.OracleStatement.expandSqlEscapes(OracleStatement.java:4790)
at oracle.jdbc.driver.OracleStatement.parseSqlKind(OracleStatement.java:4779)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:209)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:165)
at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:604)
at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:485)
at weblogic.jdbc.jts.Connection.prepareStatement(Connection.java:138)
at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:139)
at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:92)
at com.bofa.news.business.entity.drivingdrivenmatrix.DrivingDrivenMatrixBean_g8txe4__WebLogic_CMP_RDBMS.ejbFindDistinctDrivenFields1(DrivingDrivenMatrixBean_g8txe4__WebLogic_CMP_RDBMS.java:1105)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:314)
at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:739)
at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:712)
at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:476)
at com.bofa.news.business.entity.drivingdrivenmatrix.DrivingDrivenMatrixBean_g8txe4_LocalHomeImpl.findDistinctDrivenFields1(DrivingDrivenMatrixBean_g8txe4_LocalHomeImpl.java:123)
whatz am I missing ?
Thanx,
Krish

If I do not put the fn's in the finder explicitly, then at runtime I see the following
in the log-file
DRVR DBG1 SQL: "SELECT WL0.DRIVEN_FIELD, WL0.DRIVEN_VALUE, WL0.DRIVING_FIELD,
WL0.DRIVING_VALUE, WL0.PARAM_ID, WL0.DEPENDENCY, WL0.DRIVEN_SCREEN_ID, WL0.DRIVING_CONDITION,
WL0.LAST_UPDATE_TIME, WL0.LAST_USER_ID, WL0.MATRIX_DESC, WL0.RULE_DEFN, WL0.VERSION
FROM DRIVING_DRIVEN_MATRIX WL0 WHERE ( (((WL0.PARAM_ID = ?)) AND ( (((WL0.DRIVING_FIELD
= ?)) AND ( ( ( (((WL0.DRIVING_CONDITION = 'EQUAL')) AND ( ((? = WL0.DRIVING_VALUE)
) OR ((? = WL0.DRIVING_VALUE) ) ) ) OR (((WL0.DRIVING_CONDITION = 'NOTEQUAL'))
AND ( ((? <> WL0.DRIVING_VALUE) ) OR ((? <> WL0.DRIVING_VALUE) ) ) ) ) OR
(((WL0.DRIVING_CONDITION = 'LIKE')) AND ( ((WL0.DRIVING_VALUE LIKE ? ) ) OR
((WL0.DRIVING_VALUE LIKE ? ) ) ) ) ) OR (((WL0.DRIVING_CONDITION = 'BETWEEN'))
AND ( (((? >= { fn SUBSTRING( WL0.DRIVING_VALUE, 1, { fn LOCATE( WL0.DRIVING_VALUE,
'and' ) } - 1 ) } )) AND ((? <= { fn SUBSTRING( WL0.DRIVING_VALUE, { fn LOCATE(
WL0.DRIVING_VALUE, 'and' ) } + 3, { fn LENGTH( WL0.DRIVING_VALUE ) } ) } ))
) OR (((? >= { fn SUBSTRING( WL0.DRIVING_VALUE, 1, { fn LOCATE( WL0.DRIVING_VALUE,
'and' ) } - 1 ) } )) AND ((? <= { fn SUBSTRING( WL0.DRIVING_VALUE, { fn LOCATE(
WL0.DRIVING_VALUE, 'and' ) } + 3, { fn LENGTH( WL0.DRIVING_VALUE ) } ) } ))
) ) ) ) ) OR (((WL0.DRIVING_FIELD = ?)) AND ((WL0.DRIVING_VALUE = ?)) ) )) AND
( ((WL0.DRIVEN_SCREEN_ID = ?) ) OR ((WL0.DRIVEN_SCREEN_ID = ?) ) ) ) "
DRVR FUNC OracleStatement.OracleStatement(conn, batchValue=1, rowPrefetchValue=10)
DBAC FUNC DBDataSetImpl.DBDataSetImpl(conn, nrows=0 ,dataSetType= 0)
DRVR FUNC OraclePreparedStatement.OraclePreparedStatement(conn, sql, batchValue,
rowPrefetchValue)
DBAC FUNC DBDataSetImpl.DBDataSetImpl(conn, nrows=1 ,dataSetType= 1)
DRVR FUNC OracleConnection.nativeSQL(sql)
DRVR DBG1 Input SQL: "SELECT WL0.DRIVEN_FIELD, WL0.DRIVEN_VALUE, WL0.DRIVING_FIELD,
WL0.DRIVING_VALUE, WL0.PARAM_ID, WL0.DEPENDENCY, WL0.DRIVEN_SCREEN_ID, WL0.DRIVING_CONDITION,
WL0.LAST_UPDATE_TIME, WL0.LAST_USER_ID, WL0.MATRIX_DESC, WL0.RULE_DEFN, WL0.VERSION
FROM DRIVING_DRIVEN_MATRIX WL0 WHERE ( (((WL0.PARAM_ID = ?)) AND ( (((WL0.DRIVING_FIELD
= ?)) AND ( ( ( (((WL0.DRIVING_CONDITION = 'EQUAL')) AND ( ((? = WL0.DRIVING_VALUE)
) OR ((? = WL0.DRIVING_VALUE) ) ) ) OR (((WL0.DRIVING_CONDITION = 'NOTEQUAL'))
AND ( ((? <> WL0.DRIVING_VALUE) ) OR ((? <> WL0.DRIVING_VALUE) ) ) ) ) OR
(((WL0.DRIVING_CONDITION = 'LIKE')) AND ( ((WL0.DRIVING_VALUE LIKE ? ) ) OR
((WL0.DRIVING_VALUE LIKE ? ) ) ) ) ) OR (((WL0.DRIVING_CONDITION = 'BETWEEN'))
AND ( (((? >= { fn SUBSTRING( WL0.DRIVING_VALUE, 1, { fn LOCATE( WL0.DRIVING_VALUE,
'and' ) } - 1 ) } )) AND ((? <= { fn SUBSTRING( WL0.DRIVING_VALUE, { fn LOCATE(
WL0.DRIVING_VALUE, 'and' ) } + 3, { fn LENGTH( WL0.DRIVING_VALUE ) } ) } ))
) OR (((? >= { fn SUBSTRING( WL0.DRIVING_VALUE, 1, { fn LOCATE( WL0.DRIVING_VALUE,
'and' ) } - 1 ) } )) AND ((? <= { fn SUBSTRING( WL0.DRIVING_VALUE, { fn LOCATE(
WL0.DRIVING_VALUE, 'and' ) } + 3, { fn LENGTH( WL0.DRIVING_VALUE ) } ) } ))
) ) ) ) ) OR (((WL0.DRIVING_FIELD = ?)) AND ((WL0.DRIVING_VALUE = ?)) ) )) AND
( ((WL0.DRIVEN_SCREEN_ID = ?) ) OR ((WL0.DRIVEN_SCREEN_ID = ?) ) ) ) "
DRVR FUNC DBError.check_error(errNum=34, obj=757: fn)
DRVR FUNC DBError.throwSqlException(errNum=34, obj=757: fn)
DRVR FUNC DBError.findMessage(errNum=34, obj=757: fn)
DRVR FUNC DBError.throwSqlException(reason="Non supported SQL92 token at position:
757: fn", SQLState=null, vendorCode=17034)
SQLException: SQLState(null) vendor code(17034)
java.sql.SQLException: Non supported SQL92 token at position: 757: fn
     at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
     at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
     at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:829)
     at oracle.jdbc.driver.OracleSql.handleToken(OracleSql.java:152)
     at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:112)
     at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:64)
     at oracle.jdbc.driver.OracleConnection.nativeSQL(OracleConnection.java:762)
     at oracle.jdbc.driver.OracleStatement.expandSqlEscapes(OracleStatement.java:4790)
     at oracle.jdbc.driver.OracleStatement.parseSqlKind(OracleStatement.java:4779)
     at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:209)
     at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:165)
     at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:604)
     at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:485)
     at weblogic.jdbc.jts.Connection.prepareStatement(Connection.java:138)
     at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:139)
     at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:92)
     at com.bofa.news.business.entity.drivingdrivenmatrix.DrivingDrivenMatrixBean_g8txe4__WebLogic_CMP_RDBMS.ejbFindDistinctDrivenFields1(DrivingDrivenMatrixBean_g8txe4__WebLogic_CMP_RDBMS.java:1105)
     at java.lang.reflect.Method.invoke(Native Method)
     at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:314)
     at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:739)
"thorick" <[email protected]> wrote:
>
Right, the JDBC escapes 'fn' are not supported in EJB QL or WebLogic
QL.
What does the EJB QL query look like that does not have the 'fn' escapes
-thorick

Similar Messages

  • SQL 2012 not recognizing modification of scalar function

    I have two scalar functions which are both very similar. Both required three variables. Then I realized that I needed another variable in both functions so I added it to both.  I then modified the call to each function (e.g. select dbo.function(var1,
    var2, var3, var4)), but within Management Studio editor, only the change in the first function is recognized. Below is the function that is not recognized and the call to it.  The error is 'insufficient number of arguments'.  Its as if Management
    Studio doesn't realize I made the change.
    ALTER FUNCTION [dbo].[InvoicePaidLateInFull](@Invoice bigint, @DueDate datetime, @Total decimal(14, 4), @EndDate datetime)
    RETURNS bit
    AS
    BEGIN
    DECLARE @PaidLate bit, @Paydate datetime, @Amount decimal(14, 4)
    declare @Check int, @CurrentStatus bigint
    declare @AmtTol decimal(14,4), @CID bigint
    Set @PaidLate = 0
    Set @CurrentStatus = (Select top 1 StatusID from RebateData Where InvoiceNo = @Invoice order by ID)
    if @CurrentStatus <> 1
    Begin
    Goto NotDueYet
    End
    Set @CID = (Select top 1 CID from RebateData Where InvoiceNo = @Invoice order by ID)
    Set @AmtTol = (Select AmountTolerance from MasterCustomerProgramContracts where ID = @CID)
    If datediff(dd, @DueDate, @EndDate) < 0
    Begin
    GoTo NotDueYet
    End
    Set @Check = (Select count(*) from Payments Where InvoiceNo = @Invoice)
    if @Check = 0
    Begin
    --No payments have been received at all. Consider as 'Unpaid'
    GoTo NotDueYet
    End
    Set @Amount = isnull((Select round(sum(Amount) , 2)
    from Payments
    where invoiceno = @Invoice
    and PayDate <= @DueDate
    Group by InvoiceNo), 0)
    Set @Amount = -(@Amount)
    If @Amount between (@Total - (@Total * @AmtTol)) and (@Total + (@Total * @AmtTol))
    Begin
    Set @PaidLate = 0
    End
    If @Amount < (@Total - (@Total * @AmtTol))
    Begin
    Set @PaidLate = 1
    End
    NotDueYet:
    RETURN @PaidLate
    END
    The Call:
    Set @PL = (Select dbo.InvoicePaidLateInFull(@Inv, @DueDate, @Total, @EndDate))
    Seems like I read the other day of a script that can be run to 'update' SQL, but I can't remember it now.
    Thanks.
    Ross

    Leaving the Intellisense issue, permit me to point out that incorrectly used, this function can be a performance killer. An occasional call - no problem. But if you do something like:
    SELECT ..., dbo.InvoicePaidLateInFull(invoice_id, due_date) AS PaidLade
    FROM   MillionRowTable
    This is a performance disaster. SQL Server cannot optimize the function, so you will have a cursor in disguise.
    Overall, you should be very restrictive with scalar functions that perfoms data access.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Where to find info on function based indexes

    Hello,
    Using Oracle 11.2, can someone tell me where I can find information about existing Function Based indexes in my database?
    I want to shrink the unused space on a table, but there is a FB index that I have to drop in order to shrink the space.
    Then, I need to recreate it after I shrink the space.
    But how do I find out what functions the index is created to be used for?
    I've already looked at dba_indexes, and dba_ind_expressions with no luck.
    I see the index, but I don't see what the functions are that are being applied for the FB index.
    Thanks in advance.

    Yes, this is why I'm also confused, which is what I pointed out in the first entry of this thread.
    Notice here:
    SQL> select index_name, index_type from dba_indexes where table_name = 'TQR1';
    INDEX_NAME                     INDEX_TYPE
    IDX$$_0FFD0001                 NORMAL
    IDX$$_211C0002                 NORMAL
    TQR1_C3                        FUNCTION-BASED NORMAL
    . . .Now, let's confirm another way....
    select OWNER, INDEX_NAME, INDEX_TYPE, TABLE_OWNER, TABLE_NAME
    from dba_indexes where index_name = 'TQR1_C3';
    OWNER      INDEX_NAME INDEX_TYPE                  TABLE_OWNER  TABLE_NAME
    TQ         TQR1_C3    FUNCTION-BASED NORMAL       TQ           TQR1
    1 row selected.Now, let's show the selection from dba_ind_expressions...
    INDEX_OWNER  INDEX_NAME TABLE_OWNER  TABLE_NAME COLUMN_EXPRESSI COLUMN_POSITION
    TQ           TQR1_C3    TQ           TQR1       "C3"                          1I don't know the password for the TQ owner, so I'll have to wait until I can find that out before I can run DBMS_METADATA.

  • Improve built in SQL MAX function

    Hi
    I am trying to improve the performance of the built in SQL max function. right now searching through over 500,000 rows takes lot of time which can be reduced. Can anyone suggest me something which would be helpful in this or may be give me a link if it has been discussed before?
    Anything is appreciated.
    Thanks

    Tolls wrote:
    Um...considering you were planning on improving on the MAX function, I sort of thought you might actually know how to use it. Otherwise how would you know it was running slowly?thanks Tolls i'd figured it out right after i posted it. i guess i was too excited after reading (you got it in milliseconds) that posted right away without doing anything myself..but yeah it did make it super fast..thanks a lot for your help and time..
    cotton.m wrote:
    d_khakh wrote:
    hi tolls thanks for getting back
    could u explain how did u do that? i found out how to create index..i have the following statement:
    create index col on table2 (col2);
    cud u tell me how to go from here and find the max in col2..thanks again for ur help?
    sigh
    Where to go from here? Just execute your damn query. If you really did create the index on the right column and your database isn't stupid and there isn't a lot more to this problem then you told us about like some where clauses then that's it. She's as fast as she's going to get.
    And remember, it's impolite to converse in a public forum while chewing your cud. Unless of course you actually meant "could" but were just too lazy to type it. Don't be lazy, use full words. Thanks.like i said above..i figured it out after some time.
    i wasn't being lazy ..thats msn talk..i thought people understood that..anyways your point noted too.

  • Calling SQL Server function in ODI

    Hi All,
    In the Target data store in the interface I have a column called COUNT_BY_CERTDATE column and in the mapping I have teh following syntax, which does not work.
    SUM(CASE WHEN ((dbo.getcertdate(person_id,getdate()) >= current_timestamp) THEN 1 ELSE 0 END). The 'getcertdate' is a SQL Server function which returns a date.
    I am getting a "Expression is not valid for this DBMS error" with the details as getcertdate is not a recognized built in function name. Please help on fixing this issue.
    Thanks for your time and help.

    Its defined on the source.
    I am getting the following error, when I execute it.
    ODI-1228: Task Load_Fact_Table1 (Integration) fails on the target MICROSOFT_SQL_SERVER connection SQLSERVER_USAASC.
    Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]Cannot find either column "main" or the user-defined function or aggregate "main.dbo.getCertDate", or the name is ambiguous.
    Edited by: ssk1974 on Dec 20, 2012 6:30 AM

  • UDB scalar functions and parameter markers

    Hello,
    While using Prepared Statements in combination with UDB scalar functions (translate UDB function, for example), I get a Parameter marker error. The SQL statement works fine as an independent query.
    SQL Query example from UDB manual used as is:
    UPDATE EMPLOYEE
    SET LASTNAME = TRANSLATE(CAST(? AS VARCHAR(12)))
    WHERE EMPNO = ? When the above query is used as a Java prepared statement, an invalid parameter marker error occurs.
    Any ideas?
    Thanks.

    Personally, I'd try that SQL as:
    UPDATE EMPLOYEE
    SET LASTNAME =  CAST (UPPER(?) AS VARCHAR(12) )
    WHERE EMPNO = ? not least because it makes the action of the translation explicit, but mostly because other DBs that have a TRANSLATE function don't support the "1 parameter implicitly means upper case" form you're using (at first, I thought you were getting a bogus message for a mangled function call, but then I dug out the old DB2 docs and saw what the hell the TRANSLATE was intended to do here..)
    Also, my (old) reference doesn't list a CAST function, although it's certainly not up to date; instead it shows casting done in this style:
    UPDATE EMPLOYEE
    SET LASTNAME =  VARCHAR (UPPER(?) , 12)
    WHERE EMPNO = ? It doesn't show a VARCHAR2 function either, but I'd guess they're type-compatible in this application... hope this gives you something else to try...

  • Implementing JDBC / scalar functions

    Hi,
    I am part of a team implementing a JDBC driver to allow third party software to query our data stores. We want to implement the full range of scalar functions listed in the JDBC spec. At the start of Appendix C there is a reference to the Open Group CLI specification for "more information on the semantics of the scalar functions". However, I cannot find any reference to scalar functions in the CLI spec found here:
    http://www.opengroup.org/bookstore/catalog/c451.htm
    Does anyone know where detailed specifications of the scalar functions may be found? I am particularly interested in behaviour when encountering null arguments.
    Thanks for any help,
    Rob

    Thanks for the link. However, I've already found definitions of a similar detail. I'm really interested in tracking down the original specification that the authors of JDBC were looking at, which will hopefully offer detailed desciptions of the required behaviour when dealing with null and invalid arguments.
    Rob

  • Scalar function For Identity Or Row Number

    Hi
    I need to create a scalar Function that works in the same way as Row Number or a Identity column
    I've not really used functions before so what would be the best way to do this?
    Regards

    Well I'm taking over a ETL process for a OLAP cube which is using SQL scripts and views and Not SSIS, any other logic other than what is available in the design mode of the view are done in functions. If i use the built in one I lose the
    design view.
    If you are making your database design from what you see in some "design mode" you are putting the cart before the horse.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Logical Operations in SQL decode function ?

    Hi,
    Is it possible to do Logical Operations in SQL decode function
    like
    '>'
    '<'
    '>='
    '<='
    '<>'
    not in
    in
    not null
    is null
    eg...
    select col1 ,order_by,decode ( col1 , > 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , <> 10 , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 , not in (10,11,12) , 0 , 1)
    from tab;
    select col1 ,order_by,decode ( col1 ,is null , 0 , 1)
    from tab;
    Regards,
    infan
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:07 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:08 AM
    Edited by: user780731 on Apr 30, 2009 12:09 AM

    example:
    select col1 ,order_by,case when col1 > 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 &lt;&gt; 10 then 0 else 1 end
    from tab;
    select col1 ,order_by,case when col1 not in (10,11,12) then 0 else 1 end
    from tab;As for testing for null, decode handles that by default anyway so you can have decode or case easily..
    select col1 ,order_by,decode (col1, null , 0 , 1)
    from tab;
    select col1 ,order_by,case when col1 is null then 0 else 1 end
    from tab;

  • How to find the existing function module is used in another function module

    Hi all,
    I created a function module and the same one is called from another function module.
    When I tried to find where the  first function module is used  using  Where-used List , I am getting the message "function module not found in selected areas" .
    Please  guide me what is other method to find whether the function module is used in another one.
    Thanks,
    Vengal Rao.

    hi,
    Go to UTILITIES-> Update Navigation index.
    or go to fucntion group and Generate the Funtion group once.
    it will detect all fucntion modules under that function group.
    regards,
    Rama

  • How to find the Obsolete function module in ECC 6.0

    Hi Guys,
    How we can find the all obsolete function in ECC 6.0, is any T-code to finding the obsolete function modules, or any other way to find.
    Could you please help me.
    Thanks,
    Gourisankar.

    Hi Gouri,
    If you are looking at determining whether a single FM is obsolete or not is by this method:
    Go to FM in SE37 -> Goto Attributes Tab -> General Data section -> look above the Edit Lock field ... where SAP places the release status and date of the FM, if the FM is obsolete, the text Function Obsolete appears
    This is one way of finding out one FM @ a time
    However if you want to check on a mass scale, I dont have a SAP system here hence cant confirm, however, all FMs are stored in TFDIR database table. Please scroll through the fields of the DB table to check whether any field relates to release status or the like. If it does, then from SE16, you can put the value corresponding to "Obsolete" in the field and run to check all FMs.
    Cheers,
    Aditya

  • How to Passing clob to PL/SQL pipeline function

    I have a PL/SQL stored function which takes clob as input parameter and sends the results in a pipe line.
    create or replace function GetIds(p_list clob, p_del varchar2 := ',') return ideset_t pipelined is
    I am using ojdbc14.jar (Oracle 10g driver) with oracle 9i (9.2.0.1.0).
    I want to use the following SQL Query select * from table(GetIds(clob))
    Now the question is how can I pass the clob from JDBC?
    Here is my client code
    PreparedStatement stmt = con.prepareStatement("SELECT COLUMN_VALUE FROM TABLE(GETIDS(?, ','))");
    stmt.setCharacterStream(1, new StringReader(str), str.length());
    stmt.executeQuery();
    I get the following error when I try to run the program. The same thing works fine if the chracter lenght is less than some chaaracters.
    java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:420)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:452)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2960)
         at Test.main(Test.java:42)
    Exception in thread "main"
    The setChracterStream works for any insert/update clob. Example when I tried the query (INSERT INTO CLOB_TEST VALUES(?)) setCharacterStream just works fine.
    Please any one can help me how to solve this.
    Thanks in advance.

    Hóla LuÃs,
    when you pick the PL/SQL function body returning a boolean, it implicitly means that TRUE means OK, while FALSE means error, always.
    In order to associate such error to a given form field, you have to go back to the page definiton / validations and specify the name of the item in the corresponding field.
    When you first create the validation rule, this value is not present even if you ask for the error message inline with the field.
    The error message text can be specified in the validation definition, if I am not wrong.
    When you need to return special error messages, including dynamic content for instance, you can use the Function Returning Error Message type, which reports an error when the string returned by the function is not null. This comes in handy when you want to display an item's code, for example, rather than generic text.
    Even in this case, you must go back to the validation and specify the name of the field if you want to see it inline.
    Hope it helps,
    Flavio

  • How can i convert the firefox-history-timestamp in places.sqlite into a normal date format? The firefox-timestamp is not equivalent to the unix-timestamp, that's why I ask. I could not find a conversion function. Does anyone know something about this?

    As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?

    Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.

  • HT201365 Find My iPhone no longer works for me to know where my wife and children's phones are. In earlier IOS versions, I added my iCloud account to their devices and only had Find My iPhone function active.  Can't do that now; what do I do?

    Before IOS 7, I created an account on my wife and childrens iPhones, iPads and iPod devices with my iCloud account, only having the Find My iPhone function turned on.  It worked great.  Now, with IOS 7, it is not working and I don't have the option to have the Find My iPhone function on my iCloud account on their devices.  Does anyone know how to make this work?  My family loses their devices frequently and I am concerned I won'e be able to help them find them.  Thanks!!

    They only need their main iCloud account to have Find My iPhone on. If your account is not their main account it won't work. Only one account can enable that function on a device. They don't need to have the app on their devices unless you want them to find you.
    If you can see the devices when you log into their accounts on your Find My iPhone app they are being recognized by the app. But as Winston said if they're not turned on, if they are not on a network, cell or wifi, then they will read as offline. This often happens when I look for my wife's phone when she is at work, her wifi system there does not keep the connection active when the device goes to sleep and in some areas of the building there is poor to no cell connection. And sometimes the service just doesn't pick them up for no obvious reason.
    iOS 7 has several annoying glitches right now that hopefully will be resolved soon and this could be one for you. I would try this again by having all the devices in one location , restart all of them, make certain the function is enabled on all of them and that wifi is connected ( if you have a wifi network available ) or that they are connected to a cell network with a strong signal. Then launch the app on your phone and log in with their accounts, their locations should show up.

  • SQL query, function or SP for converting varbinary to image(.jpg format).

    Dear Sir/Mam
    I want SQL query, function or SP which converts binary data to image (.jpg format).
    I m able to convert image (.jpg format) to varbinary. But not able to convert vice versa.
    thanks in advance.

    Binary data is binary data - "image" is only an intrepretation of binary data.  Therefore your question makes little sense in the context of sql server since it does not have any facilities to utilize images.  Since you provide no context, I'm
    guessing that you are trying to retrieve an image stored in the database in a varbinary column and have your application use it as an image.  If so, you should post your question to a forum that is specific to your development environment.  

Maybe you are looking for

  • My IPod was stolen, how do I retrieve it?

    My IPod was stolen, how do I go about finding it and getting it back?

  • Microsoft Office 2003

    Hi,  I recently purchased a new computer to replace my other one that died of old age. I was running Windows XP professional and I had Microsoft Office 2003 on it. My new computer is running Windows 7 but no Office. So I installed my Microsoft Office

  • How to Enable/Disable suppressUpload and suppressDownload

    my xml doesnt have this attribute how to enable /disable supressUpload and suppressDownload. <?xml version="1.0" encoding="utf-8" ?> - <MeRepApplication schemaVersion="1.1" id="ZAM_09" version="09">   <Property name="CLIENT.BUILDNUMBER" />   <Propert

  • How can i get fire fox on a computer that does not have a web browser loaded

    i have a computer which has firefox loaded and wish transfer firefox to a computer which has no web browser loaded so i am unable to download the program from the internet i tried copying the program to a cd but it fails to load properly thanks.

  • Indesign is not showing up on my download apps

    I clicked on InDesgn CC update but now Indesign is not available on my computer and it is not available as a downloadable app in Creative Cloud.