Re: How to converting from PL/SQL query to T-SQL query

How to converting from PL/SQL query to T-SQL query... Its Urgent

Download the
SQL Server Migration Assistant for Oracle.  It will convert whole Oracle databases, or single queries or PL/SQL stored procedures.
With caution that If your database is using Collation which is case sensitive SSMA will not work.SSMA doesnt guarantees 100% for conversion of Queries/stored proc /database if it fails to do so for some queries you will have to do it manually.
But you can try
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Similar Messages

  • How to convert  from  varchar to blob ?

    How to convert from varchar to blob ?
    thanks

    Here is a small PL/SQL block that we have used to convert varchar2 to blob.
    declare
    cursor get_blob is
    select blob_statement
    from report
    where report_id = 205
    FOR UPDATE OF blob_statement;
    v_loc blob;
    v_raw_buffer raw(32767);
    v_amount binary_integer := 32767;
    v_offset binary_integer := 1;
    v_buffer VARCHAR2(32767);
    begin
    open get_blob;
    fetch get_blob into v_loc;
    close get_blob;
    v_buffer := 'Sample text';
    v_raw_buffer := utl_raw.cast_to_raw(v_buffer);
    v_amount := utl_raw.length(v_raw_buffer);
    dbms_lob.write(v_loc, v_amount, v_offset, v_raw_buffer);
    commit;
    end;

  • Cannot convert from java.util.Date to java.sql.Date

    In the below code am trying to get the current date and 60 days prior date:
    Date  todayDate;
              Date  Sixtydaysprior;
              String DATE_FORMAT = "MM/dd/yy";
              DateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
             Calendar cal = Calendar.getInstance();
              todayDate = sdf.parse(sdf.format(cal.getTime()));
              cal.add(Calendar.DATE, -60);
             Sixtydaysprior = sdf.parse(sdf.format(cal.getTime()));I have imported following files:
    <%@page
         import="java.util.Calendar,
                   java.text.SimpleDateFormat,
                   java.text.ParseException,
                            java.util.*"
    %>Shows up following error msg:
    Type mismatch: cannot convert from java.util.Date to java.sql.Date
    Thanks.
    Edited by: MiltonDetroja on May 22, 2009 11:03 AM

    Shows up following error msg:
    Type mismatch: cannot convert from java.util.Date to java.sql.Date
    I don't think this exception is thrown from the portion of code you have shown. As clearly specified in exception message, you cannot cast an instance of java.util.Date to java.sql.Date. you will need to do something like this
    java.util.Date today = new java.util.Date();
    long t = today.getTime();
    java.sql.Date dt = new java.sql.Date(t);

  • Hi iam new to java can u tell me  how to convert from hashmap to string

    how to convert from hashmap to string

    Hi,
    This is not pure Java forum. Its more on JDBC and data connectivity to Orcle db from Java API.
    This link may answer your question:
    http://stackoverflow.com/questions/960807/hashmapkey-string-value-arraylist-returns-an-object-instead-of-arraylist
    Twinkle

  • How to convert from Restricted material to Unrested Material

    Hi Every Body,
         I have Posted the Batch Material in MB1C . But it was posted in RESTRICTED IN USE. How to convert from Restrict To UNRESTRICTED IN USE. Can Anybody Help me.

    Thank you for solving the problem both SAP Community Network and Mr Jurgen .
    suribabu

  • How to convert from image based pdf to text based pdf

    I have Adobe 9 Pro. How to convert from image based pdf to text based pdf? For example, if someone emails a scanned pdf to me, how do I convert that document into a text based pdf?

    To perform OCR, open the document and select: Document > OCR Text Recognition > Recognize Text Using OCR
    More information on the various options is in the Acrobat help doc.

  • How to convert from java.lang.Integer to int

    Could you please show me
    how to convert from java.lang.Integer to int?
    and how to convert from java.lang.Integer to String?
    Thanks,
    Minh

    Could you please show me
    how to convert from java.lang.Integer to int?
    and how to convert from java.lang.Integer to String?Tip: always keep a browser open on the API docs; if you've got a
    couple of MBs to spare, download the docs; it's very convenient.
    kind regards,
    Jos

  • How to convert from array to graph ?

    how to convert from array to graph ?

    A graph will accept an array of numbers.  Do you have an example of what you are looking for?
    And since somebody mentioned tutorials...
    3 Hour Introduction
    6 Hour Introduction
    LabVEW Basics
    Self Paced training for students
    Self Paced training beginner to advanced, SSP Required
    LabVIEW Wiki on Training
    Learning NI
    Getting Started with NI Products
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to convert from pdf to word

    how to convert from pdf to word

    If you are using Adobe Acrobat please post here: http://forums.adobe.com/community/acrobat/creating__editing_%26_exporting_pdfs
    If you are using Adobe Reader and ExportPDF, please read this: http://forums.adobe.com/docs/DOC-1812

  • How to convert from XML to Array ?

    how to convert from XML to Array ?
    thanks in advance

    this is a segment of the xml object:
    var myXML:XML =
    <data>
    <task>
    <taskID>2</taskID>
    <startDate>2/15/2007</startDate>
    </task>
    </data>
    i want to conver myXML into ArrayCollection: like this:
    private var expenses:Array = [
    {taskID:"1", startDate:"2/15/2007"},
    {taskID:"2", startDate:"4/15/2007"}
    how i can do it ? and tell me how to retrieve the data from
    the collection
    thanks

  • How to convert from military time (string) to regular time?

    How to convert from military time (string) to regular time?
    First of all I need to let you know I'm very new to Crystal Reports, so I apologize and will need detailed instructions if possible.
    I have created a Crystal Report pulling information from the received time field.  On the report, the time is showing in military time (ex. 16:00:00).
    How can I convert this time to normal time (ex. 4:00:00)
    Since the field is a 'String' field and not a 'Time' field, I do not have the option of changing it under the field properties.
    I hope someone can help with this.
    Thank you in advance.

    As my fields were date only and not datetime, I ended up using the following,
    If IsDate({CallLog.EmailRecdDate}) Then
         CDate({CallLog.EmailRecdDate})
    Else
         CDate(0,0,0)
    You answer lead me in the right direction.
    I'm still having an issue with the 'Else' statment returning 12:00:00 because of the CDate(0,0,0), but I'm not sure what else I can use to return a blank space on the report.  Any ideas?
    Thanks again!

  • How to convert from lowercase letters to uppercase letters?

    how to convert from lowercase letters to uppercase letters?

    Hi KS,
    In the transfer / update rules you can use a formula to convert lowercase to upper case letters.
    Functions for Character string>>TOUPPER(CHAR)
    Hope this helps.
    Bhargava
    Message was edited by:
            Sista Bhargava Kumar

  • How to convert from xml file to html using java code

    How to convert from xml file to html file using java code

    Get yourself Apache Xalan or Saxon or some XSLT processor
    String styleSheet = "/YourXSLTStylesheet.xsl";
    String dataSource = "/YourXMLDocument.xml";
    InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
    InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
    OutputStream transformedOut = new FileOutputStream("filename.html");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
    transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
    http://www.w3schools.com/xsl/

  • How to convert from SQL Server table to Flat file (txt file)

    I need To ask question how convert from SQL Server table to Flat file txt file

    Hi
    1. Import/Export wizened
    2. Bcp utility
    3. SSIS 
    1.Import/Export Wizard
    First and very manual technique is the import wizard.  This is great for ad-hoc and just to slam it in tasks.
    In SSMS right click the database you want to import into.  Scroll to Tasks and select Import Data…
    For the data source we want out zips.txt file.  Browse for it and select it.  You should notice the wizard tries to fill in the blanks for you.  One key thing here with this file I picked is there are “ “ qualifiers.  So we need to make
    sure we add “ into the text qualifier field.   The wizard will not do this for you.
    Go through the remaining pages to view everything.  No further changes should be needed though
    Hit next after checking the pages out and select your destination.  This in our case will be DBA.dbo.zips.
    Following the destination step, go into the edit mappings section to ensure we look good on the types and counts.
    Hit next and then finish.  Once completed you will see the count of rows transferred and the success or failure rate
    Import wizard completed and you have the data!
    bcp utility
    Method two is bcp with a format file http://msdn.microsoft.com/en-us/library/ms162802.aspx
    This is probably going to win for speed on most occasions but is limited to the formatting of the file being imported.  For this file it actually works well with a small format file to show the contents and mappings to SQL Server.
    To create a format file all we really need is the type and the count of columns for the most basic files.  In our case the qualifier makes it a bit difficult but there is a trick to ignoring them.  The trick is to basically throw a field into the
    format file that will reference it but basically ignore it in the import process.
    Given that our format file in this case would appear like this
    9.0
    9
    1 SQLCHAR 0 0 """ 0 dummy1 ""
    2 SQLCHAR 0 50 "","" 1 Field1 ""
    3 SQLCHAR 0 50 "","" 2 Field2 ""
    4 SQLCHAR 0 50 "","" 3 Field3 ""
    5 SQLCHAR 0 50 ""," 4 Field4 ""
    6 SQLCHAR 0 50 "," 5 Field5 ""
    7 SQLCHAR 0 50 "," 6 Field6 ""
    8 SQLCHAR 0 50 "," 7 Field7 ""
    9 SQLCHAR 0 50 "n" 8 Field8 ""
    The bcp call would be as follows
    C:Program FilesMicrosoft SQL Server90ToolsBinn>bcp DBA..zips in “C:zips.txt” -f “c:zip_format_file.txt” -S LKFW0133 -T
    Given a successful run you should see this in command prompt after executing the statement
    Starting copy...
    1000 rows sent to SQL Server. Total sent: 1000
    1000 rows sent to SQL Server. Total sent: 2000
    1000 rows sent to SQL Server. Total sent: 3000
    1000 rows sent to SQL Server. Total sent: 4000
    1000 rows sent to SQL Server. Total sent: 5000
    1000 rows sent to SQL Server. Total sent: 6000
    1000 rows sent to SQL Server. Total sent: 7000
    1000 rows sent to SQL Server. Total sent: 8000
    1000 rows sent to SQL Server. Total sent: 9000
    1000 rows sent to SQL Server. Total sent: 10000
    1000 rows sent to SQL Server. Total sent: 11000
    1000 rows sent to SQL Server. Total sent: 12000
    1000 rows sent to SQL Server. Total sent: 13000
    1000 rows sent to SQL Server. Total sent: 14000
    1000 rows sent to SQL Server. Total sent: 15000
    1000 rows sent to SQL Server. Total sent: 16000
    1000 rows sent to SQL Server. Total sent: 17000
    1000 rows sent to SQL Server. Total sent: 18000
    1000 rows sent to SQL Server. Total sent: 19000
    1000 rows sent to SQL Server. Total sent: 20000
    1000 rows sent to SQL Server. Total sent: 21000
    1000 rows sent to SQL Server. Total sent: 22000
    1000 rows sent to SQL Server. Total sent: 23000
    1000 rows sent to SQL Server. Total sent: 24000
    1000 rows sent to SQL Server. Total sent: 25000
    1000 rows sent to SQL Server. Total sent: 26000
    1000 rows sent to SQL Server. Total sent: 27000
    1000 rows sent to SQL Server. Total sent: 28000
    1000 rows sent to SQL Server. Total sent: 29000
    bcp import completed!
    BULK INSERT
    Next, we have BULK INSERT given the same format file from bcp
    CREATE TABLE zips (
    Col1 nvarchar(50),
    Col2 nvarchar(50),
    Col3 nvarchar(50),
    Col4 nvarchar(50),
    Col5 nvarchar(50),
    Col6 nvarchar(50),
    Col7 nvarchar(50),
    Col8 nvarchar(50)
    GO
    INSERT INTO zips
    SELECT *
    FROM OPENROWSET(BULK 'C:Documents and SettingstkruegerMy Documentsblogcenzuszipcodeszips.txt',
    FORMATFILE='C:Documents and SettingstkruegerMy Documentsblogzip_format_file.txt'
    ) as t1 ;
    GO
    That was simple enough given the work on the format file that we already did.  Bulk insert isn’t as fast as bcp but gives you some freedom from within TSQL and SSMS to add functionality to the import.
    SSIS
    Next is my favorite playground in SSIS
    We can do many methods in SSIS to get data from point A, to point B.  I’ll show you data flow task and the SSIS version of BULK INSERT
    First create a new integrated services project.
    Create a new flat file connection by right clicking the connection managers area.  This will be used in both methods
    Bulk insert
    You can use format file here as well which is beneficial to moving methods around.  This essentially is calling the same processes with format file usage.  Drag over a bulk insert task and double click it to go into the editor.
    Fill in the information starting with connection.  This will populate much as the wizard did.
    Example of format file usage
    Or specify your own details
    Execute this and again, we have some data
    Data Flow method
    Bring over a data flow task and double click it to go into the data flow tab.
    Bring over a flat file source and SQL Server destination.  Edit the flat file source to use the connection manager “The file” we already created.  Connect the two once they are there
    Double click the SQL Server Destination task to open the editor.  Enter in the connection manager information and select the table to import into.
    Go into the mappings and connect the dots per say
    Typical issue of type conversions is Unicode to non-unicode.
    We fix this with a Data conversion or explicit conversion in the editor.  Data conversion tasks are usually the route I take.  Drag over a data conversation task and place it between the connection from the flat file source to the SQL Server destination.
    New look in the mappings
    And after execution…
    SqlBulkCopy Method
    Sense we’re in the SSIS package we can use that awesome “script task” to show SlqBulkCopy.  Not only fast but also handy for those really “unique” file formats we receive so often
    Bring over a script task into the control flow
    Double click the task and go to the script page.  Click the Design script to open up the code behind
    Ref.
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • How to Export from table view to Excel (not BI query)?

    There is a 'How to' document explaining how to export from an iView using a BI query:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/47fe4fef-0d01-0010-6f87-ed8ecb479123
    However:
    This 'How-To' document is using an example of a BEx query. I am not using a BEx query, therefore I do not have an "Info port". How can I download to Excel from a table view that is not an iView of a BI query? (It is just a internal table coming from a BAPI).

    keenneth,
    i am using the query from SQL server, i am having the same problem of not having info port. so did you find a work around for exporting to excel with filters for non sap queries ?
    any body who had come across this situation , plz guide me.
    thanks in advance
    ravi

Maybe you are looking for

  • Why prefix variables names with a colon?

    PROCEDURE calc_avg_sales BEGIN :sales.avg := :sales.month1 / :sales.total; EXCEPTION WHEN ZERO_DIVIDE THEN :sales_avg := 0; RAISE FORM_TRIGGER_FAILURE; WHEN OTHERS THEN NULL; END; Excerpt from Oracle PL/SQL Programming ISBN 0-596-00381-1 Pg. 106 Why

  • Help! Whole Iphoto library is gone.

    So I have been having a few problems with the computer shutting down lately but I haven't noticed any major problems when rebooting. But then I went to open iPhoto and my entire library is gone. When I go into finder they are all still in folders und

  • Cannot scroll in Mail

    When working in Mail this morning, the scroll bars in both my inbox and the message itself disappeared, and I lost the ability to scroll up and down by swiping with two fingers.  I was able to get the scroll bars back but still can't scroll with a fi

  • PR05 report through corporate portal

    We have a requirement that the employees should be able to view their expense report through corporate portal.   We have ECC 6.0 and we activated the enhancement packages but still we could not seen the expense report activation for the WebDynpro.  I

  • Loosing bind params

    Hi, We are having a problem with our application that we loose our bind parameters after a while. There is a view object that has a bind param called p_id. Which we set by using setp_id and perform executyQuery inside coding. If we leave the page alo