How to use lexical parameters with Sql Server Stored Procedure?

Hi,
I'm developing a BI Publisher report on a sql server database. I need to execute a stored procedure to dynamically build the query by replacing the lexical parameters with the values of varaibles of the stored procedure. With Oracle stored procedures, I have used data template and had reference the varaiable in SP by prefixing it with '&'.
It doesn't work if I try to do the same thing with SQL server. Is there anyone who has come across the similar situation? Please let me know if anyone has got any ideas...
Thanks in Advance
Rag

TopLink currently doesn't support multiple ResultSets. Multiple ResultSets support is considered for a future release.

Similar Messages

  • How to use OEM to moniter sql server 2000

    Hi,
    I need to learn How to use OEM to moniter sql server 2000.
    Can anyone help me and give me some website or documents
    to read?
    So I can learn to do this job.
    Thanks.

    See Note 115302.1 in Metalink.oracle.com
    in how to use OEM Diagnostic pack addon for SQL Server
    Or search for
    oem "user events"
    to build your own monitor script.

  • How to call a sql server stored procedure from oracle

    Hi all,
    Please anybody tell me how to call a sql server stored procedure from oracle.
    I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
    "dbo"."CreateReceipt"@hsa
    where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
    my database version is 10g
    Please help me how can i call it... I need to pass some parameters too to the SP
    thanking you

    hi,
    thank you for the response.
    when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
    my code is,
    declare
    c INTEGER;
    nr INTEGER;
    begin
    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
    DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
    nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
    end;
    Create_Receipt is the sp which requires two parameters.
    please give me a solution
    thanking you
    sreejith

  • How to run a SQL Server Stored Procedure

    I need to run a SQL Server Stored Procedure in answer, the stored procedure use a hash table (temporary table) and I nedd to pass a parameter to stored procedure
    anyone know if is it possible in OBIEE, if yes how.
    thank you
    max

    thank you, but I'm not understand what you mean. I need to run this command in answer "direct access database"
    exec storedprocedure 1,1,1
    if I run this I receive thi error:
    error : [nQSError: 16001] ODBC error state: S0002 code: 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server]object name '#TempList' not valid.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000).
    here is the code of stored procedure:
    ROC [dbo].[GetOrderListmax]
    @OrderList varchar(500)
    AS
    BEGIN
    SET NOCOUNT ON
    CREATE TABLE #TempList
    OrderID int
    DECLARE @OrderID varchar(10), @Pos int
    SET @OrderList = LTRIM(RTRIM(@OrderList))+ ','
    SET @Pos = CHARINDEX(',', @OrderList, 1)
    IF REPLACE(@OrderList, ',', '') <> ''
    BEGIN
    WHILE @Pos > 0
    BEGIN
    SET @OrderID = LTRIM(RTRIM(LEFT(@OrderList, @Pos - 1)))
    IF @OrderID <> ''
    BEGIN
    INSERT INTO #TempList (OrderID) VALUES (CAST(@OrderID AS int)) --Use Appropriate conversion
    END
    SET @OrderList = RIGHT(@OrderList, LEN(@OrderList) - @Pos)
    SET @Pos = CHARINDEX(',', @OrderList, 1)
    END
    END
    SELECT o.OrderID, CustomerID, EmployeeID, OrderDate
    FROM dbo.Orders AS o
    JOIN
    #TempList t
    ON o.OrderID = t.OrderID
    END

  • Converting SQL Server Stored Procedure to Oracle

    Hi there,
    I tried to use SwisSQL to convert my SQL Server stored procedure to Orcale without much success.
    Is there anyone who could help me out with this?
    My SQL Server Stored Procedure is:
    CREATE PROCEDURE [dbo].[SP_BackgroundCheckRequest]
         --MASTER Table
         @MASTER_ID int,
         @PERSONNEL_ID int = NULL,
    @DATE_OF_BIRTH datetime = NULL,
         @GENDER varchar(1) = NULL,
         @COUNTRY_OF_BIRTH varchar(3) = NULL,
    @TOWN_OF_BIRTH varchar(100) = NULL,
         @STATE_OF_BIRTH varchar(50) = NULL,
         @CHECK_CATEGORY varchar(10) = NULL,
         @CHECK_TYPE varchar(10) = NULL,
         @PRIORITY varchar(10) = NULL,
         @PRIORITY_REASON varchar(100) = NULL,
         @SCREENING_LEVEL nchar(1) = NULL,
         @POSITION nchar(50) = NULL,
         @REQUEST_SOURCE varchar(60) = NULL,
         --NAME_TYPE Table
         @NAME_TYPE varchar(5) = NULL,
         @FAMILY_NAME varchar(50) = NULL,
         @FIRST_NAME varchar(50) = NULL,
         @MIDDLE_NAME varchar(50) = NULL,
         @TITLE varchar(10) = NULL,
         @PREFFERED_NAME varchar(40) = NULL,
         @PREVIOUS_NAME varchar(140) = NULL,
         --ADDRESS_TYPE Table
         @ADDRESS_TYPE varchar(10) = NULL,
         @ADDRESS_LINE_1 varchar(30) = NULL,
         @ADDRESS_LINE_2 varchar(30) = NULL,
         @ADDRESS_LINE_3 varchar(30) = NULL,
         @COUNTRY varchar(3) = NULL,
         @SUBURB varchar(50) = NULL,
         @STATE varchar(50) = NULL,
         @POSTCODE varchar(15) = NULL,
         @START_DATE varchar(10) = NULL,
         @END_DATE varchar(10) = NULL,
         --LICENSE_TYPE Table
         @LICENSE_TYPE varchar(5) = NULL,
         @LICENSE_AGENCY varchar(15) = NULL,
         @LICENSE_NUMBER varchar(100) = NULL,
         @LICENSE_SIGHTED varchar(1) = NULL,
         --PHONE_TYPE Table
         @TELEPHONE_TYPE varchar(5) = NULL,
         @TELEPHONE_NUMBER varchar(20) = NULL,
         @MOBILE_TYPE varchar(5) = NULL,
         @MOBILE_NUMBER varchar(20) = NULL,
         @EXTENSION_TYPE varchar(5) = NULL,
         @EXTENSION_NUMBER varchar(20) = NULL,
         --PASSPORT_TYPE Table
         @PASSPORT_TYPE varchar(5) = NULL,
         @PASSPORT_NUMBER varchar(50) = NULL,
         @PASSPORT_COUNTRY varchar(3) = NULL,
         @PASSPORT_SIGHTED varchar(1) = NULL
    AS
    BEGIN TRANSACTION
    INSERT into MASTER (MASTER_ID, PERSONNEL_ID, DATE_OF_BIRTH, GENDER, COUNTRY_OF_BIRTH,
         TOWN_OF_BIRTH, STATE_OF_BIRTH, CHECK_CATEGORY, CHECK_TYPE, PRIORITY, PRIORITY_REASON,
         SCREENING_LEVEL, POSITION, REQUEST_SOURCE)
         VALUES (@MASTER_ID, @PERSONNEL_ID, @DATE_OF_BIRTH, @GENDER, @COUNTRY_OF_BIRTH,
         @TOWN_OF_BIRTH, @STATE_OF_BIRTH, @CHECK_CATEGORY, @CHECK_TYPE, @PRIORITY, @PRIORITY_REASON,
         @SCREENING_LEVEL, @POSITION, @REQUEST_SOURCE)
    IF @@ERROR <> 0
    BEGIN
         ROLLBACK
         RAISERROR ('Error inserting values into MASTER table!', 16, 1)
         RETURN
    END
    INSERT into NAME_TYPE (MASTER_ID,NAME_TYPE,FAMILY_NAME,FIRST_NAME,MIDDLE_NAME,TITLE)
         VALUES (@MASTER_ID,@NAME_TYPE,@FAMILY_NAME,@FIRST_NAME,@MIDDLE_NAME,@TITLE)
    IF @@ERROR <> 0
    BEGIN
         ROLLBACK
         RAISERROR ('Error inserting values into NAME_TYPE table!', 16, 1)
         RETURN
    END
    INSERT into ADDRESS_TYPE (MASTER_ID,TYPE,ADDRESS_LINE_1,ADDRESS_LINE_2,ADDRESS_LINE_3,
              COUNTRY,SUBURB,STATE,POSTCODE,START_DATE,END_DATE)
         VALUES (@MASTER_ID,@ADDRESS_TYPE,@ADDRESS_LINE_1,@ADDRESS_LINE_2,@ADDRESS_LINE_3,
              @COUNTRY,@SUBURB,@STATE,@POSTCODE,@START_DATE,@END_DATE)
    IF @@ERROR <> 0
    BEGIN
         ROLLBACK
         RAISERROR ('Error inserting values into ADDRESS_TYPE table!', 16, 1)
         RETURN
    END
    INSERT into LICENSE_TYPE (MASTER_ID,TYPE,AGENCY,NUMBER,SIGHTED_YN)
         VALUES (@MASTER_ID,@LICENSE_TYPE,@LICENSE_AGENCY,@LICENSE_NUMBER,@LICENSE_SIGHTED)
    IF @@ERROR <> 0
    BEGIN
         ROLLBACK
         RAISERROR ('Error inserting values into LICENSE_TYPE table!', 16, 1)
         RETURN
    END
    INSERT into PHONE_TYPE (MASTER_ID,TYPE,NUMBER)
         VALUES (@MASTER_ID,@TELEPHONE_TYPE,@TELEPHONE_NUMBER)
    IF @@ERROR <> 0
    BEGIN
         ROLLBACK
         RAISERROR ('Error inserting Telephone number into PHONE_TYPE table!', 16, 1)
         RETURN
    END
    IF ((@MOBILE_TYPE <> NULL) AND (@MOBILE_NUMBER <> NULL))
    BEGIN
         INSERT into PHONE_TYPE (MASTER_ID,TYPE,NUMBER)
              VALUES (@MASTER_ID,@MOBILE_TYPE,@MOBILE_NUMBER)
         IF @@ERROR <> 0
         BEGIN
              ROLLBACK
              RAISERROR ('Error inserting Mobile number into PHONE_TYPE table!', 16, 1)
              RETURN
         END
    END
    IF ((@EXTENSION_TYPE <> NULL) AND (@EXTENSION_NUMBER <> NULL))
    BEGIN
         INSERT into PHONE_TYPE (MASTER_ID,TYPE,NUMBER)
              VALUES (@MASTER_ID,@EXTENSION_TYPE,@EXTENSION_NUMBER)
         IF @@ERROR <> 0
         BEGIN
              ROLLBACK
              RAISERROR ('Error inserting Extension number into PHONE_TYPE table!', 16, 1)
              RETURN
         END
    END
    INSERT into PASSPORT_TYPE (MASTER_ID,NUMBER,COUNTRY,SIGHTED_YN)
         VALUES (@MASTER_ID,@PASSPORT_NUMBER,@PASSPORT_COUNTRY,@PASSPORT_SIGHTED)
    IF @@ERROR <> 0
    BEGIN
         ROLLBACK
         RAISERROR ('Error inserting values into PASSPORT_TYPE table!', 16, 1)
         RETURN
    END
    COMMIT

    First, a basic concept. That also illustrates how different Oracle is (and PL/SQL) from SQL-Server (and T-SQL).
    PL/SQL integrates two different languages. The PL language. The SQL language. It allows you to code SQL source code natively inside the PL language. The PL compiler is clever enough to do the rest - make calls to the SQL engine to create SQL cursors, bind PL variable values to bind variables in the SQL code. Etc.
    PL is a "proper" programming language. It is much like Pascal (it is based on Ada, a close family member of Pascal). It is nothing at all like T-SQL.
    Okay, now for the very basic rule for Oracle development.
    Maximize SQL. This means using the SQL language to crunch data. It is the "closest" to the data. It is designed and optimised for dealing with data. Do your data processing using SQL.
    Minimize PL/SQL. This means using the PL language not to crunch data, but to provide the conditional logic. Implement business rules. And then have the SQL language crunch the data as the data processing language.
    Attempting to directly translate T-SQL code into PL/SQL is flawed. It is like trying to make coffee with teabags. Yeah, the tea may have caffeine it, but it is not coffee.
    To do what that T-SQL script does, insert a row into a table, a typical PL/SQL equivalent will look as follows:
    create or replace procedure InsertMaster( masterRow master%rowtype ) authid definer is
    .. types and variables declared here
    begin
      -- masterRow is a record structure that matches the actual MASTER table
      .. apply business rules and validation to the data.. raising user exceptions as needed
      -- e.g. the POSITION column must be upper case
      masterRow.position := upper(masterRow.position);
      -- after the business logic and data validation we can add the row to the table
      -- (PL will make the INSERT call to the SQL engine)
      insert into master values masterRow;
    end;No commit. The caller does the business transaction. It needs to decide when to commit to maintain the integrity of the data in the database. It may need to do several more calls, before committing.
    With this approach, we can give the application schema (the caller) execute privs on this procedure. This procedure is defined with definer rights. This means it runs with the privs of owner of that procedure and MASTER table. It is trusted code. It does all the correct stuff to add a valid and checked row to the MASTER table. So we give the app schema execute privs on the procedure and no insert priv on the MASTER table.
    The only way the caller can add row to the MASTER table is via this trusted procedure of ours.
    And this is a typical approach in Oracle - using the PL/SQL (both PL language and SQL language) code to create an interface to a logical database in Oracle. Abstracting the complexities of SQL from the caller. Moving business and validation into PL. Allowing us the flexibility of modifying business and validation logic, without touching a single byte of caller/client code. Allowing us to manage and tune SQL performance without dealing with (badly designed and coded) SQL from a client - as the SQL resides in PL/SQL packages and procedures and functions.

  • Can a SQL Server stored procedure call an SAP function module?

    Can a SQL Server stored procedure call an SAP function module.? The stored procedure will be called via a trigger when data records are added to a Z table.

    You have two options:
    - the other software can use the RFC SDK and call directly in the system
    - the other software can use a database connect
    Markus

  • Use of PVKConverter with SQL Server 2012 SP2

    I am trying to convert a certificate that was exported from our database server to be used by SQL Server for database encryption.  When I run the PVKConverter, not Private Key File (PVK) is generated.
    The certificate has Server and Client Authentication as the purposes of the certificate. 
    What purpose or purposes does the certificate need in order to be able to be used by SQL Server 2012 SP2?
    Why doesn't the PVKConverter generate a private key file?
    I can use the command makecerts to generate a self signed certificate and have it work with SQL Server database encryption.
    Thanks.
    DJ

    Hi DJ,
    Based on my research, SQL Server supports the importing of existing security certificates, specified as a pair of files that are encoded in PVK/DER format. Below Transact-SQL script displays the basic key file format for SQL Server database encryption.
    CREATE CERTIFICATE <Certificate name>
    FROM FILE = '<PVK/DER format file>.cer'
    WITH PRIVATE KEY (FILE = '<PVK/DER format file>.pvk',
    DECRYPTION BY PASSWORD = '<Encryption password>');
    According to your description, PVKConverter doesn’t generate a private key file. PVKConverter is used to generate PVK/DER encoded security certificates from existing PFX encoded security certificates. Thus, please ensure that your certificate is encoded in
    PFX format and make sure you perform all the steps properly as described in the
    KB article.
    There is also a related blog for your reference.
    http://blogs.msdn.com/b/sql_pfe_blog/archive/2014/02/04/generating-a-trusted-tde-certificate-in-the-proper-format-from-a-certificate-authority.aspx
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • How To Use Reporting Services On SQL Server 2000 ?

    Hi all .
    Today , I has a issue .
    Normal , if the customer use SQl Server 2005 , it is no proplem , so if use SQL Server 2000 ,  Now , I want to use Reporting services on SQL Server 2000 , but , I am searching  on Internet , so I know , if I want to use SQL 2000 reporting server , I must have license of SQL server 2000 .
    is Every body  idea for this issue  ? .
    Please help me .
    Thanks alot .

    Ok ,anyway thanks alot ,.

  • SQL Server Stored Procedures

    Is there a way of firing up SQL Server stroed procedures from
    Flash 8?
    If so could someone explain how to do it please, as I would
    like to pass parameters from choices made via drop down lists
    (populated from xml pages) to query a SQL Server 2000 database.
    Any help appreciated.
    Thanks

    Yes, I understand. But Flash doesn't talk directly to your
    SQL API.
    The SQL interface is only available through ASP (in your
    case, or any number of server-side technologies). That's why you
    use getUrl() (or other http request) to send data to an ASP script
    which then executes the SQL statement 'execute <blah>
    <blah> <blah>'.
    You then take the results of that SQL, format it, and return
    something to Flash all as part of the one and only HTTP request.
    Does this make sense?

  • How to use update trigger in sql server 2008 with specific column

    Hello friends currently my trigger updates on table update, and I need to change this to only fire when specific column changes.
    /****** Object: Table [dbo].[User_Detail] ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[User_Detail](
    [sno] [int] IDENTITY(1,1) NOT NULL,
    [userid] [nvarchar](50) NULL,
    [name] [nvarchar](max) NULL,
    [jointype] [nvarchar](50) NULL,
    [joinside] [nvarchar](50) NULL,
    [lleg] [nvarchar](50) NULL,
    [rleg] [nvarchar](50) NULL,
    [ljoining] [int] NULL,
    [rjoining] [int] NULL,
    [pair] [int] NULL
    ) ON [PRIMARY]
    GO
    /****** Object: Table [dbo].[User_Detail] table data ******/
    SET IDENTITY_INSERT [dbo].[User_Detail] ON
    INSERT [dbo].[User_Detail] values (1, N'LDS', N'LDS Rajput', N'free', N'Left', N'jyoti123', N'SUNIL', 6, 4, 4)
    INSERT [dbo].[User_Detail] VALUES (2, N'jyoti123', N'jyoti rajput', N'free', N'Left', N'mhesh123', N'priya123', 3, 2, 2)
    SET IDENTITY_INSERT [dbo].[User_Detail] OFF
    /****** Object: Table [dbo].[User_Detail] trigger ******/
    CREATE TRIGGER triggAfterUpdate ON User_Detail
    FOR UPDATE
    AS
    declare @userid nvarchar(50);
    declare @pair varchar(100);
    select @userid=i.userid from inserted i;
    select @pair=i.pair from inserted i;
    SET NOCOUNT ON
    if update(pair)
    begin
    insert into Complete_Pairs(userid,pair)
    values(@userid,1);
    end
    GO
    /****** Object: Table [dbo].[Complete_Pairs] Script Date: 05/22/2014 21:20:35 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Complete_Pairs](
    [Sno] [int] IDENTITY(1,1) NOT NULL,
    [userid] [nvarchar](50) NULL,
    [pair] [int] NULL
    ) ON [PRIMARY]
    GO
    my query is TRIGGER triggAfterUpdate is fired only when pair column in User_Details table is update only and when we update other column like ljoin or rjoin then my trigger is not fired
    please any one can suggest us how it can done or provide solution
    Jitendra Kumar Sr. Software Developer at Ruvixo Technologies 7895253402

    >select @userid=i.userid
    frominserted i;
            select
    @pair=i.pair
    frominserted i;
    The code above assumes a single row UPDATE.
    You have to setup the trigger for set processing like when 100 rows are updated in a single statement.
    UPDATE trigger example: http://www.sqlusa.com/bestpractices2005/timestamptrigger/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How configure reporting services configuration with sql server business development studio

    I have installed sql server 2008 r2 mixed mode(sql server authentication) with native mode
    I want to run report using reporting  services config manager.
    I made report in ssrs and I have configured reporting services configuration and  web url from RSCM( reporting  services config manager), i put on ssrs report.
    report is build and deployed but when i take deployed url on Internet explorer, it shows the window below:
    when I put the password nothing happened . if I put url in google chrome then it shows authentication required window like the same in IE
    if I passed username=(levent/sa) and password then goes on window but does not see on page,  if I passed only administrator name (levent) not passed sql server login name (sa) then does not close 'Authentication window'
    'Computer connect net with modem'
    before i tried on earlier PC, it worked fine.
    setting is below link like this.
    only set service Account is Use_built=NetworkSrvice 
    link
    http://www.azurecurve.co.uk/2012/02/how-to-configure-sql-server-reporting-services-in-order-to-deploy-reporting-services-reports-in-gp/
    what is the problem 
    Plz give suggestion quickly

    Hi tusharshinde,
    Per my understanding that when you log in the report Manager you got the pop-up window ask for credential, you try to enter  the SA account and the window account as the username and password but both not work, right?
    Your issue related to the authentication. As you mentioned you have choose the ”Network Service” as the Service account, generally using this account in RSCM and RSWindowsNegotiate is added to the RSReportServer.config file as the default setting. With this
    setting, the report server can accept requests from client applications requesting Kerberos or NTLM authentication. If Kerberos is requested and the authentication fails, the report server switches to NTLM authentication and prompts the user for credentials
    unless the network is configured to manage authentication transparently.
    The issue can be caused by many factors and please check one by one.
    Did you enter the username and password for three times and got blank page or got some error? If you got some error, please provide the error information.
    you can delete the specific Authorization Types inside rsreportserver.config  file, open path:” \Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config”. 
    Search the file for the “AuthenticationTypes” section. Remove RSWindowsNegotiate and RSWindoeBasic to ensure only “RSWindowsNTLM” is specified in the file rsreportserver.config file.
    Before do any modification, back up the files and remember to restart the ReportServer instance in the RSCM after the modification.
    If step1 doesn’t work ,please also do the trusted Site Setting in the Browser, article with details steps for your reference:
    http://technet.microsoft.com/en-us/library/bb630430.aspx 
    Please check the Report Manager's authentication mode.Have a look in the Report Manager's web.config file to check if you can find below information under the <system.web> (Path is “C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting
    Services\ReportManager\Web.config ” ).
    authentication mode="Windows"
    identity impersonate="True"
    Similar threads for your reference:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/23c5daa0-3232-4e8c-89c9-4526960c9d14/ssrs-2008-credentials-login-prompt?forum=sqlreportingservices
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0778e2ca-0fb1-4b5c-996c-6e327b5e1473/user-logon-credentials-for-ssrs-web-server-setup?forum=sqlreportingservices
    Please tried to provide us more details information, if the problem still exists:
    Did you login in the report manager locally or remotely via Browser and which URL you are using to login the Report manager?
    Did you modified some configuration file before and what did you modified?
    Did your windows account have the right permission to access the report manager?
    Any problem, please feel free to ask.
    Regards
    Vicky Liu

  • How to use sequence in MS sql server?

    In Oracle DB we use sequence like that:
    SequenceImpl s = new SequenceImpl("customer_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue()));
    But there is no sequence in sql server ,how can I do?
    Thank you~~

    MS SQLServer have a IDENTITY column property and UNIQUEIDENTIFIER data type that is somewhat similar to Oracle's sequence. I don't know whether your table contain either of these, or you just want to set sequential number to a column.
    Below is some info about IDENTITY and UNIQUEIDENTIFIER you may already know since they are in SQLServer Book.
    IDENTITY property: You can define IDENTITY property on a numeric column. You can set the seed and increment on this column property very much like Oracle's sequence. The only thing I think it does not have is the "nextval". You can use IDENT_CURRENT function or @@IDENTITY after an INSERT or SELECT INTO to get the last value generated. Of course you can use this value and add the increment to get the next
    value but it not the same as seqname.nextval which keep incrementing each time you call it. Getting the current identity value and adding the increment your self will not work for multiple sessions with pending
    insert. Another thing about column with IDENTITY property is that you cannot insert value into this column (i.e, omit it in your insert statement values) unless IDENTITY_INSERT is on, but only one table in a
    session can have IDENTITY_INSERT to be turned on.
    If you don't need to know the next seq value, then IDENTITY work similar to Oracle sequence. Execute select after postchanges or commit will have system generated values. If you need to get next value before insert, Sung suggest using SEQ_TABLE and managing the next value (write a database function to mimic Oracle'
    s nextval).
    UNIQUEIDENTIFIER datatype: UNIQUEIDENTIFIER is a 16-byte hexadecimal number indicating a globally unique identifier (GUID). The GUID is useful when a row must be unique among many other rows. You could use NEWID() to create a value of type uniqueidentifier or calling some API function that returns a GUID. The advantage of using uniqueidentifier is that the values generated by NEWID function or application GUID are guaranteed to be unique throughout the world. The disadvantage of using uniqueidetifier is that it is long and obscure, random, difficult for user to remember or type correctly. It is 16 byte, which is large compare to other datatype such as 4-byte integer.
    Thanks,
    Yvonne

  • How to use evaluate function for sql server function

    Hi Team,
    We have imported a column(date dtat type) from SQL server cube . By default it imported as varchar,. We have three option in physical layer for this column(Varchar,Intiger,unknown)
    So we want to convert this column into date.can we use evaluate or there is any option to do that.?

    Hi,
    I am not sure your requirement. But how pass evaluate function obiee?
    syntax:- EVAULATE('your db function(%1,%2)', parameter list)
    here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
    if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
    following exapmples are for ORACLE db,
    ex1: EVALUATE('upper(%1)', 'satya ranki reddy') gives the result as -> SATYA RANKI REDDY
    ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
    you also can call the user-defined functions through evaulate
    EVALUATE('functioname(%1,%2), column1, column2)
    the above function has 2 parameters to be inputted
    Hope this help's
    Thanks
    Satya

  • How to store/display images with SQL Server 2000

    Hi everybody, I'm totally new to ColdFusion, and creating a
    sample project, where a user would enter in a person's info and
    upload a picture of that person. I trying to get my app to save
    that image to SQL Server database and then to display that pic.
    Currently, it "seems" that I'm able to save to SQL server (my table
    saves user info but all values in my photo column says
    <binary>-I don't know if that is correct), but I can't seem
    to get image and display it on my cf page. I have pasted portions
    of my code below.
    I've been hammering away at this but no luck, so Any comments
    are very well appreciated, example code would be great!
    Thank you so much,
    noijet
    # 1.) I have a 'User Info Entry' page that submits to page
    #2:
    <cfform...>
    <input name="fileToUpload" id="fileToUpload" type="file"
    size="64"/>
    </cfform>
    # 2.) This page does the actual saving, this doesn't output
    any errors but am I saving the image to SQL server correctly? I
    have no idea really how to save images to database, so please
    advise or possibly provide example code. Afterwards, it goes to
    page #3 to display confirmation page that data has been saved.
    <cfif isDefined("Form.fileToUpload") and Form.fileToUpload
    neq "">
    <cfset uploadPath =
    GetDirectoryFromPath(GetBaseTemplatePath()) & "uploads\">
    <cfif not DirectoryExists(uploadPath)>
    <cfdirectory action="create" directory="#uploadPath#">
    </cfif>
    <cffile action="upload" fileField="fileToUpload"
    destination="#uploadPath#" nameConflict="overwrite">
    <cfset imagefile= "uploads\\" & cffile.serverFile
    & "'">
    </cfif>
    <cfquery name="qInsertPerson" dataSource="HRP">
    Execute insertPerson
    N'#Trim(FORM.sLastname)#',N'#Trim(FORM.sFirstname)#',N'#Trim(FORM.sMiddle)#',N'#Trim(FORM .sAlias)#',
    '#imagefile#'
    </cfquery>
    <cflocation url = "savePersonResult.cfm" addToken =
    "No">
    #3.) This confirmation page displays last user entered and a
    picture of the user. The user info retrieved from SQL server is
    displaying correctly but the picture is not displaying(just a small
    red 'x' box). The image calls another getPersonPhoto.cfm file to
    display image.
    <cfquery name="lastPerson" datasource="HRP">
    Exec getLastRow
    </cfquery>
    <cfoutput query="lastPerson">
    #firstName# #middle# #lastName# was added to our Persons
    list. That Person has been given id: #id# <br>
    Thank you for your assistance and cooperation.
    <img src="getPersonPhoto.cfm?id=71" border="0" width="128"
    height="180">
    </cfoutput>
    #4.) This is .cfm file that only displays image of person
    <cfsetting enablecfoutputonly="Yes">
    <cfsetting showdebugoutput="No">
    <cfquery name="getBlob" datasource="HRP">
    SELECT TOP 1 photo FROM Persons WHERE id = 71
    </cfquery>
    <cfheader name="content-disposition"
    value="Inline;filename=ExamplePerson.jpg">
    <cfcontent type="image/jpeg; charset=iso-8859-1">
    <cfoutput>#tostring(tobinary(getBlob.photo))#</cfoutput>
    Note: In my ColdFusion admin, I checked "Enable ... BLOB's"
    and set Blob Buffer to 20000

    Regarding doing the actual saving, here are some other things
    to consider:
    * a max on the image's file size
    * check if it really is an image
    * don't use nameconflict="overwrite". consider
    nameconflict="MAKEUNIQUE"
    * delete uploaded image on file system after insert into db
    Also, on the cfm page that returns an image, try putting the
    cfcontent tag and the cfoutput tag on one line.
    <cfheader name="Content-Type" value="image/jpeg">
    <cfcontent
    type="image/jpeg"><cfoutput>#getBlob.photo#</cfoutput>
    Good luck!

  • HowTo: Using special characters in SQL passthrough stored procedure parameters?

    Hi all,
    I am creating a Visual FoxPro 5.0a application, where I am trying to call a stored procedure in my Oracle database with the following SQLEXEC command (SQLEXEC is the Foxpro function to send sql statements to the ODBC driver):
    lcSQL = "{Call Insert_FRB.NewItemPage('KABO)n$i,30000000000', '184927', '184927', 'MAIR2001011216151314', 'MAIR')}"
    /* Sorry the above command should of course not break accross pages*/
    lnSuccess = sqlexec(1,lcSQL)
    With the parameters given, I get the ODBC error: "Connectivity error: [Oracle][ODBC Oracle Driver]Syntax Error."
    I get the same error, when using the Oracle ODBC 32bit Test utility.
    The call works just fine, if I replace the "$" in the first parameter 'KABO)n$i,30000000000' with a "normal" character, e.g. 'KABO)nAi,30000000000'. Oracle handles the $-character just fine, the stored procedure is working properly when called directly in SQLPLUS8.
    I am using the Oracle ODBC driver sqo32_73.dll Version2.00.03.01.
    Questions:
    How do I have to submit the "$" to the ODBC driver, in order to be passed through to Oracle unchallenged?
    Does anybody know of other special characters, which are not accepted by the ODBC-drivers for Oracle?
    Thanks to any hints,
    Peter

    You could try downloading the Oracle 8.1.7 client and the latest
    Oracle8 ODBC driver, install them on your machine, and verify
    that the failure goes away. That's obviously the acid test.
    I can tell you that when I worked in the ODBC driver group we
    did identify and fix some bugs where our parser wasn't skipping
    string literals. If this particular bug wasn't fixed earlier,
    it almost certainly was then (I'm guessing that work was done 12-
    18 months ago).
    Justin

Maybe you are looking for

  • How to read a DVD with a external drive, how to read a DVD with a external drive

    Hello I replaces my internal DVD drive with a SSD drive. When I start the dvd program player or a software like Toast, I get , of course, an error message. I saw on internet the way to edit (with HewFiend program) and change this /Système/Bibliothèqu

  • Facebook tab not showen in 24.0 version

    Hi we are creative agency and one of our tabs in the Facebook page is not shown on 24.0 Firefox. We try it from some computers and still don't work *work on chrome and explorer https://www.facebook.com/hutzpe/app_208195102528120 Thanks Ofer

  • AE CS5 Photoshop Import Madness

    Hello! I am a freelancer working at an animation studio in London. They are running CS5 on their Macs, the one I'm on now is OS X 10.6.7, 2x3 GHz Quad-Core Intel Xeon, 5 GB 667 MHz DDR2 Memory, with a fresh install of CS5. On launcing I receive this

  • Errir in creation of trade contract

    While was creatting trade contract iam getting errer Global trade  is not Activated plz give me the solution iwill give me the points any bilding blocks in OIL and Gas plz send me

  • SSD RAID0 as a boot drive on a Mac Pro

    I'm buying a Mac Pro early 2008 I'm using Final Cut Pro and After Effects. Option 1: (5) drives 1. OSX boot drive 80GB SSD (under the DVD drive) 2. 32GB SSD RAID0 (scratch/render drive) bay 1 3. 32GB SSD RAID0 (scratch/render drive) bay 2 4. 1TB RAID