Call userdefined function on sql server 2000 from a rpt/crystalviewer CR11

Post Author: schste0
CA Forum: Data Connectivity and SQL
Hi, i have userdefined functions in an sql2k database and look for a way to use them in cr11 and in the reportviewer with RAS. Thx in advance.

Use a SQL Expression if the Driver supports it. Or a Command Object.

Similar Messages

  • Want to convert function in SQL Server 2000

    Hi ,
    i am writing this function in oracle.Could you please convert this function in SQL Server 2000 because i am new in this and dont know how to use decode function in sql.
    Please following is the code for oracle.
    CREATE OR REPLACE function fun ( localex varchar2,titlex varchar2)
    return number
    as  x number;
    begin
    select sum ( decode (count (username),max(prereq_count),1,0) ) x into x from
       SELECT
                       prereq_count,
                       username
                 FROM
                         table1
    group by     username ;
    return x;
    end fun;
    Regards
    Vishal

    Just take a look example below might give you idea :
    create or replace function f_makeAddress_tx (
    i_address_tx VARCHAR2,
    i_city_tx VARCHAR2,
    i_state_tx VARCHAR2,
    i_zip_tx VARCHAR2)
    return VARCHAR2
    is
    e_badZip EXCEPTION; u279E8
    pragma EXCEPTION_init(e_badZip,-20998); u279E9
    v_out_tx VARCHAR2(256);
    begin
    p_validateZip (i_zip_tx); u279E12
    v_out_tx:= i_address_tx||u2019, u2018|| u279E13
    i_city_tx ||u2019, u2018||
    i_state_tx ||u2019, u2018||
    i_zip_tx;
    return v_out_tx; u279E17
    exception
    when e_badZip then u279E19
    return i_zip_tx || u2018: Invalid zip code.u2019;
    end;
    Regards,
    Clint

  • Have anyone connected to sql server 2000 from forms 6i release 2

    Have anyone connected to sql server 2000 from forms 6i release 2
    on winNT 2000. sql server is also on same machine.
    If yes then pls tell me details regarding
    oca version
    any patch required for forms 6i release 2(download location of
    patch)
    version of odbc drivers
    or any other detils
    urgent
    thanks
    yogesh

    refresh

  • Can't connect  to SQL Server 2000 from serlet

    Hi,
    I can connect to SQL Server 2000 from standalone program after set the classpath properly.
    but I Can't connect to SQL Server 2000 from serlet, I am using Tomcat 4.1 and Win2K pro now. Do I need to set something for servlet just like CLASSPATH?
    Any help will be appreciated.
    package usingjsp;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    public class JDBCServlet extends GenericServlet
    protected Connection conn;
    public void init()
    try
    // Make sure the JdbcOdbcDriver class is loaded
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // Try to connect to a database via ODBC
    conn = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://hu:1433", "sa","");
    catch (Exception exc)
    // If there's an error, use the servlet logging API
    getServletContext().log(
    "Error making JDBC connection: ", exc);
    public void service(ServletRequest request, ServletResponse response)
    throws java.io.IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<HTML>");
    out.println("<BODY>");
    out.println("<PRE>");
    out.println("The JDBC connection is:");
    out.println(conn);
    out.println("</PRE>");
    out.println("</BODY>");
    out.println("</HTML>");

    i also have this problem..do u have any solution?

  • How to load data to a SQL Server 2000 from a text file ( fixed / delimited)

    I am a navie user to ODI, just installed some time back. And I wanted to load text data ina file ( fixed length/ delimited ) to SQL server 2000 database.
    Iam intrested to know the steps I need to take to achieve this. I mean for example first creating topology,next designer..
    Could you please provide some books/articles or any documents that talt about these steps clearly one-by-one.

    Hi,
    Oracle Data Integrator - Getting Started with an ETL Project
    follow this manuel step by step and you will be able to load data from file to any database...

  • Connecting to SQL Server 2000 from Oracle 9iDS

    hi
    I want to connect Forms Developer 9i to a SQL Server 2000 Database for integration purposes. Mentioning that I don't have any Oracle servers on my system.
    Thanks

    hi
    I want to connect Forms Developer 9i to a SQL Server 2000 Database for integration purposes. Mentioning that I don't have any Oracle servers on my system.
    Thanks

  • Creating user defined function in sql server 2000

    I have created a udf an i want to call it in another udf. will u please help me out how to create.
    thank you

    And you ask that in an ORACLE forum? Brilliant idea... ;)

  • Calling Function in SQL Server through DBLINK

    Hello
    I need to call a function that exists in other database (*SQL Server*) through DBLINK
    Is It possible? If yes, please give me the syntax
    Thanks

    Hi,
    You can call remote functions on SQL*Server if you create the database link using the Database Gateway for SQL*Server (DG4MSQL).
    You need to install and configure DG4MSQL then you can call remote functions as follows -
    SELECT function1@Remote_DB(7782) FROM dual;
    You need to set the parameter -
    HS_CALL_NAME
    in the DG4MSQL init<sid>.ora file with the owner and name of the function, for example -
    HS_CALL_NAME = "owner1.function1, owner2.function2 "
    and if you want to return values using the function you need to set the parameter in the gateway init file -
    HS_FDS_PROC_IS_FUNC=TRUE
    For full details you need to refer to the documentation -
    Oracle® Database Gateway for SQL Server User’s Guide, 11g Release 2 (11.2)
    Oracle® Database Heterogeneous Connectivity User’s Guide 11g Release 2 (11.2)
    which is available from -
    http://www.oracle.com/pls/db112/homepage
    and click on the 'Integration Information' option on the left.
    The documentation has further details on how to call and use remote functions.
    For information about installing and configuring the gateway and links to further information have a look at the following note -
    Note.1083703.1 Master Note for Oracle Gateway Products
    available in My Oracle Support
    You cannot use the Database Gateway for ODBC (DG4ODBC) to create the database link as it does not supported stored procedures or remote functions.
    Regards,
    Mike
    Edited by: mkirtley on Sep 2, 2011 11:09 AM

  • Invalid session : connecting from developer 6i to sql server 2000

    Hi ,
    I am facing the following problem for connecting to sql server
    2000 from oracle forms 6i.
    Oracle developer 6i(form builder 6.0.8.11.3)
    sql server 2000
    o/s windows 2000 server
    plus80.exe <username>/<password>@odbc:<dsn_name>
    SQL*Plus: Release 8.0.6.0.0 - Production on Tue Oct 24 17:36:56
    2000
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    Server not available or version too low for this feature
    ORA-00022: invalid session id; access denied
    Connected to:
    Oracle Open Client Adapter for ODBC 6.0.5.29.0
    Microsoft SQL Server 08.00.0194
    SQL>
    pls help
    Thanks in advance
    Yogesh

    Hello ,
    this forum must have a attachment option , so it very easy for others to update their development
    Now how can i paste the procedure it have 6 - 8 pages and when i paste it, the words merge or join with others word, it become very difficult to read,,
    anyhow
    mail me i send the document
    [email protected]

  • Oracle 9i to SQL Server 2000 Connectivity

    I want to connect to SQL Server 2000 from an Oracle 9i on Solaris.
    Both these machines are within the same TCP/IP network and can be pinged.
    Please tell me what I need to do.
    Thanks.

    Hi,
    You have 2 major options:
    1. Use Generic Connectivity with your Oracle 9i database running on Solaris. However it requires a proper ODBC-Driver to be installed on Solaris capable of connecting to Microsoft SQL Server
    MetaLink DocID: 245549.1 - How to setup Generic Connectivity - HSODBC - on SUN Solaris
    Remark: Oracle 9i has been de-supported, should you run into new bugs they wouldn't be fixed by Oracle
    2. Install and use the Database Gateway for ODBC 11g on the same machine which hosts the SQL Server database. Usage of this gateway is included in the Oracle database license. DG4ODBC also requires an ODBC-Driver but this one is mostly already present.
    Another option would be to install the Database Gateway for MS SQL Server (DG4MSQL) 11g on the same machine which hosts the SQL Server database. However this gateway requires an additional license. The big advantage of this gateway over DG4ODBC is that it supports the two phase commit protocol (distributed updates) and calling of SQL Server stored procedures. Also the dataype mapping is better compared to DG4ODBC.
    One thing though; in order for you Oracle 9i database to cooperate with one of the 11g gateways a patch for bug 5965763 on top of 9.2.0.8.0 is required. See also MetaLink DocID: 457808.1 for more details.
    I hope this get you going.
    Regards,
    Ed

  • SQL Server 2000 Driver for JDBC

    I am trying to learn how to connect to SQL Server 2000 and I keep getting errors. I have set my classpath and read through the online books, but I can't fix it. I'm not sure if I'm missing something in the configuration, or at the database level. Here are the errors I'm getting followed by my code: By the way, is there a limit on how long the classpath can be?
    C:\j2sdkP>java TableMaker
    Exception in thread "main" java.lang.NoClassDefFoundError: com/microsoft/jdbc/ba
    se/BaseDriver
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:130)
    at TableMaker.registerDriver(TableMaker.java:34)
    at TableMaker.<init>(TableMaker.java:22)
    at TableMaker.main(TableMaker.java:77)
    import java.sql.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class TableMaker
    static String jdbcDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    static String dbName = "Contacts";
    static String SQLCreate =
         "Create Table Contact_Info (" +
         "Contact_ID     Integer          Not null     Primary Key, " +
         "First_Name     Varchar(20)     Not null," +
         "MI          Char(1)          Null," +
         "Last_Name     Varchar(30)     Not null," +
         "Street          varchar(50)     Not null," +
         "City          varchar(30)     Not null," +
         "State          Char(2)          Not null," +
         "Zip          varchar(10)     Not null," +
    public TableMaker()
    registerDriver();
    public void setDatabaseName( String dbName )
    this.dbName=dbName;
    public void registerDriver()
    try {
    Class.forName( jdbcDriver );
    catch ( ClassNotFoundException e ){
    System.err.println(e.getMessage());
    public void execute( String SQLCommand )
    Connection con = null;
    Statement stmt = null;
    try {
    con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433","test","test"); // test is both login and password
    stmt = con.createStatement();
    stmt.execute(SQLCommand);
    con.close();
    catch(Exception e) {
    System.err.println(e.getMessage());
    finally {
    try {
    if (con != null)
         con.close();
         if (stmt != null)
         stmt.close();
    catch (Exception ex) { }
    public static void main(String[] args)
    TableMaker tableMaker = new TableMaker();
    tableMaker.execute(SQLCreate);
    }

    Finally, I fix the problem! Can't put white space after ";" for CLASSPATH!!! for instance classpath=.; c:\..\*.jar doesn't work! it must be classpath=.;c:\..\*.jar The stupid JAVA!!! Thanks a lot.
    I have another problem, right now I can connect to SQL Server 2000 from standalone program, but I can't connect to my DB from servlet.
    ie. the following codes works for standalone program. but it doesn't work for servlet. Any help will be appreciated!
    // Make sure the JdbcOdbcDriver class is loaded
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // Try to connect to a database via ODBC
    conn = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://127.0.01:1433", "sa","");

  • JDBC connection for SQL Server 2000

    How to connect SQL Server 2000 from java?
    If i can get any sites where i can get examples also fine.
    Thanks in advance
    Praveen.

    Developer's Daily  Java Education 
      front page | java | perl | unix | DevDirectory 
      Front Page
    Java
    Education
    Pure Java
       Articles
    JDBC 101: How to connect to an SQL database with JDBC
    Introduction
    If you're interested in connecting your Java applets and applications to standard SQL databases like Oracle, Informix, Sybase, and others, JDBC is your ticket to paradise.  The combination of Java's JDBC and standard SQL makes a simple and powerful database solution. JDBC makes the simple things easy -- without making the complex tasks too difficult either.
    In this first article in our series, we'll show you step-by-step how to establish a connection from your Java programs to an SQL database using JDBC. In the process we'll show you how to connect to two different databases -- Mini SQL (mSQL), and Interbase -- just so you can see how the code changes when you switch from one database to another.
    Obtaining the JDBC driver
    Before you start working with JDBC, you'll need a copy of the Java JDK. If you don't have it already, you can get the JDK for free at Sun's Java web site, or it will also be included with many IDE's that you can purchase, such as JBuilder or Visual Cafe.
    Once you have the JDK, the next thing you need to do is to get the correct JDBC driver for your database. In most cases the JDBC driver will be provided by your database vendor. For instance, if you purchase the Interbase database, the driver will be provided with the software, or you can obtain the most recent version at http://www.interbase.com/.
    (An exception to this rule is Mini SQL, or mSQL. Because it's a very low-cost database, the JDBC driver has actually been developed by a separate group of people, led by George Reese at imaginary.com. You can download the mSQL JDBC driver from the imaginary.com web site.)
    Once you have the correct JDBC driver for your database, install it according to the instructions that came with it. Installation instructions will vary somewhat for each vendor.
    Establishing a connection is a two-step process
    Once you have the correct JDBC driver installed, establishing a connection from your Java programs to your SQL database is pretty easy.
    Regardless of whether you're trying to connect to Oracle, Sybase, Informix, mSQL, or Interbase (or any other JDBC data source), establishing a connection to an SQL database with Java JDBC is a simple two-step process:
    Load the JDBC driver.
    Establish the connection.
    We'll show you two examples just so you can see how easy it is, and how little the code changes when you migrate from one database server to another.
    A Mini SQL Example
    Listing 1 provides the full source code required to establish a connection to a mSQL database on a server named "www.myserver.com".
      //  Establish a connection to a mSQL database using JDBC. 
    import java.sql.*; 
    class JdbcTest1 { 
        public static void main (String[] args) { 
            try { 
                // Step 1: Load the JDBC driver. 
                Class.forName("com.imaginary.sql.msql.MsqlDriver"); 
                // Step 2: Establish the connection to the database. 
                String url = "jdbc:msql://www.myserver.com:1114/contact_mgr"; 
                Connection conn = DriverManager.getConnection(url,"user1","password");  
            } catch (Exception e) { 
                System.err.println("Got an exception! "); 
                System.err.println(e.getMessage()); 
      Listing 1: This source code example shows the two steps required to establish a connection to a Mini SQL (mSQL) database using JDBC. 
    An Interbase Example
    Listing 2 provides the full source code required to establish a connection to an Interbase database. In this example, we're connecting to a local Interbase server (i.e., the server is running on the same PC that we're running the Java code on).
      //  Establish a connection to an Interbase database using JDBC. 
    import java.sql.*; 
    class JdbcTest1 { 
        public static void main (String[] args) { 
            try { 
                // Step 1: Load the JDBC driver. 
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
                // Step 2: Establish the connection to the database. 
                String url = "jdbc:odbc:contact_mgr"; 
                Connection conn = DriverManager.getConnection(url,"user1","password");  
            } catch (Exception e) { 
                System.err.println("Got an exception! "); 
                System.err.println(e.getMessage()); 
      Listing 2: This source code example shows the two steps required to establish a connection to an Interbase database using JDBC. 
    What's the difference?
    The difference between the two source code listings is very small, so we highlighted them in a dark blue color. The only difference between connecting to the two databases is:
    The name of the JDBC driver.
    The URL used to connect to the database.
    Everything else in the two source code listings -- except for the comment at the top -- is identical. Here's a slightly more detailed discussion of the two differences:
    1. The JDBC Driver
    The name of the JDBC driver will be supplied to you by your database vendor. As you can see in the class.forName() statements, these names will vary. In the first case we're using the mSQL-JDBC driver. In the second case we're using the JDBC-ODBC Bridge driver supplied with the Interbase server.
    2. The URL
    The syntax of the DriverManager.getConnection() method is:
    DriverManager.getConnection(String url, String username, String password);
    The username and password are the normal names you use to log into your database. The URL you use will again vary with the database you use. In both examples shown, we're establishing a connection to a database named contact_mgr. (We'll use this database for all of our examples in this series of JDBC articles.)
    If you stick with standard SQL commands, it can be very easy to switch from one database server to another. In fact, I've heard from several developers who are using mSQL to prototype their software (because it's so inexpensive), and then switching to another commercial vendor when it's time to take their product "live".
    Conclusion
    Establishing a connection to an SQL database with Java JDBC is a simple, two-step process. The process is nearly identical for all SQL databases, and the only real differences are (a) the driver name, and (b) the URL used to connect to the database. Your database vendor will provide this information in their documentation.
    Resources mentioned in this article
    Here are a few links to resources we mentioned in this article:
    Interbase
    The Mini SQL (mSQL) database
    The mSQL-JDBC driver at imaginary.com
      [an error occurred while processing this directive]
     

  • Connection String SQL SERVER 2000

    Hi everybody:
    I have a problem:
    I want to connect to Sql Server 2000 from Java Server Pages but I can not do it.
    In Active Server Pages I connect using:
    "Provider=SQLOLEDB;Data Source=" SERVIDOR";Initial Catalog=IntranetHipohard;User id=sa;Password="
    I would like that somebody write me by email.
    This string not is valid for Java Server Pages.
    How can I do it?
    Thank you very much and sorry my language.

    Well, it entirely depends on the JDBC driver you are using. If you are using Microsoft's driver currently in beta 2 (http://www.microsoft.com/sql), you use the following:
    Driver Name
    com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection URL
    jdbc:microsoft:sqlserver://<HOST>:1433;DatabaseName=<DATABASE>;User=<USER>;Password=<PASSWORD>
    Where <HOST> is the IP or hostname of the machine running SQL Server 2000, and <DATABASE> is the name of the database you are connecting to (optional).
    Hope this is what you need.

  • MS SQL Server 2000 Service Pack 4 upgrade

    Hi,
    I need to upgrade my actual SAP DataBase SQL Server 2000 from Service Pack 2 to Service Pack 4 in order to be more secure as a MS consultant is requesting, but following the comments on the SAP note 1026116 attached file, which references this MS article:
    http://download.microsoft.com/download/1/B/D/1BDF5B78-584E-4DE0-B36F-C44E06B0D2A3/ReadmeSql2k32sp4.htm
    Referenced Text:
    "If your instance of SQL Server 2000 is being used by an application, first check with the provider of the application whether there are any SQL Server 2000 upgrade considerations specific to that application. "
    So following this instructions is there any SQL Server 2000 upgrade to Service Pack 4 considerations for a SAP Database of an ERP R3 ECC 6.0.
    Could anyone can help me please with this question?
    Best Regards,
    Erik Espinosa

    Hi,
    Service Pack 4 is supported and recommended for SAP ERP ECC 6.0. There are currently no known issues with upgrading to this service pack. The mentioned collation change don't have to be performed as long as you are not planning to upgrade to SQL Server 2005.
    Best regards
      Clas

  • Solman 4.0 with MS SQL Server 2000

    I want to install Solution Manager 4.0 with MS SQL Server 2000. But I've the dvd's of Solution manager 4.0 with MS SQL Server 2005.
    I've still the software for MS SQL Server 2000 from an other installation .
    Is there any problem to install Solution Manager 4.0 with this software?

    Hi,
    I would suggest better to have a backup of existing database remove your existing SQL server. Install the  one given by SAP. And restore your previous databases.
    --Ragu

Maybe you are looking for

  • Getting error while working with jsr168 portlet in weblogic portal 10.1

    Hi, I have configured jsr168 portlet to display RSS feed.I am not getting any error when I have logged in for 2 to 3 times. It's displaying fine.After that when I again login I am getting this error. I am not knowing what's the problem is?Let me know

  • MSI KM4M-V and Athlon XP2800

    When I boot this I just get a beep, every 3-4 seconds ish Tried it with everything out of the case, no memory, memory.any ideas ?different sticks of memory. (PC2100 DDR266) anyt ideas ? Could it be the power supply ?

  • Queries on Oracle Lite

    1. We use ADOCE to connect to databaseon WINCE PDA. What about for Palm ? 2. Is the Oracle DB store in the same format on WINCE and Palm ? null

  • Vacation message breaks sieve filter

    Hi, Sun Java(tm) System Messaging Server 6.2-4.03 (built Sep 22 2005) libimta.so 6.2-4.03 (built 04:37:42, Sep 22 2005) SunOS mta1 5.10 Generic_118822-11 sun4u sparc SUNW,Sun-Fire-V240 User have created several sieve filters via UWC and they work ok.

  • Translate Microsoft Works 3.0 into OS 10.5.5

    Help me if you can. I wrote a book on my old Apple II computer on Microsoft Works 3.0. Is there a program I can use to recreate my book without retyping it onto my newly purchased Mac Book Pro OS 10.5.5? Peace and Love.