SQL Server Procedures Questions

Hello,
I needed some simple help in SQL Server, given below are my two questions.
I am looking at making a SQL Server Procedure which uses cursors to detect some data entry 
mistakes. 
1) I have a query joining two or three tables and returning me a list of rows. I would like to compare the Name column in this list using a like operator and report back any names which are similar. How can this be done ? If possible please send me a brief
skeletal code to do the same.
2) I am using a query to join names of employees with languages they speak. The query works fine but for employees who speak more than 1 language, the record gets repeated with a new line for every new language they speak, instead of doing this, I would
like to concatenate their languages in 1 column and report back 1 row per employee. Is this possible ?
If yes please send me the brief skeletal code to do this on [email protected]
Thanks
Irfan

>> If yes please send me the brief skeletal code to do this on [email protected]
Good day Irfan
This is not a paid supporting center, where you get private support, by commercial company, but a public forum where communities members helps each other. Public posts, answers, and discussions have a huge advantage! Other people might learn from the thread
as well.
>> I have a query joining two or three...
Please check Tom
Cooper's answer, and if this is not what you are looking for, then please post more information and less stories (I mean codes). Please show us the query instead of describe it. the code describe it better :-) Moreover, pls post DDL+DML
  Ronen Ariely
 [Personal Site]    [Blog]    [Facebook]

Similar Messages

  • Error executing MS sql server procedure

    I am getting an error below while executing a SQL server procedure from SOA composite. My jdeveloper and Soa Suite version is 11.1.1.4.
    I am using “Oracle’s MS SQL Server Driver (Type 4) Version: 7.0 and later” driver. The SQL Server version is 2005.
    To configure the connection I used the steps mentioned in URL below.
    http://beatechnologies.wordpress.com/2011/01/31/creating-a-dbadapter-for-mssql-server-in-osb-11g/
    The MS SQL procedure signature is as below.
    @p_EventId               nvarchar     IN
    @p_EventName_IN               nvarchar     IN
    @p_Agreement_No_IN          decimal          IN
    @p_Acc_Base_Number_IN          decimal          IN
    @p_Acc_Comp_No_IN          decimal          IN
    @p_Account_Company_Name_IN     nvarchar     IN
    @p_Agree_Stat_Code_IN          nvarchar     IN
    @p_Agree_Type_Code_IN          nvarchar     IN
    @p_HeadQtr_Code_IN          nvarchar     IN
    @p_Sales_Off_Name_IN          nvarchar     IN
    @p_Reseller_Name_IN          nvarchar     IN
    @p_Oracle_Order_number_IN     decimal          IN
    @p_License_Effective_Date_IN     datetime     IN
    @p_PO_Number_IN               decimal          IN
    @p_Invoice_Number_IN          decimal          IN
    @p_Invoice_Date_IN          datetime     IN
    @p_Support_Contract_ID_IN     decimal          IN
    @p_Stmt_Of_Capacity_Due_Date_IN     datetime     IN
    @p_Contract_Start_Date_IN     datetime     IN
    @p_Contract_End_Date_IN          datetime     IN
    @p_Contract_Type_IN          nvarchar     IN
    Error message .
    <fault>
    <bpelFault>
    <faultType>0</faultType>
    <bindingFault>
    <part name="summary">
    <summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'CompanySPProdcall' failed due to: Unimplemented object conversion. Conversion of type 1 whose JDBC type is OTHER to a Java object is not supported. An attempt was made to convert type 1 to a Java object using an unsupported JDBC type: OTHER. Use a data type with a supported JDBC type. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary>
    </part>
    <part name="detail">
    <detail>Unimplemented object conversion. Conversion of type 1 whose JDBC type is OTHER to a Java object is not supported. An attempt was made to convert type 1 to a Java object using an unsupported JDBC type: OTHER. Use a data type with a supported JDBC type. </detail>
    </part>
    <part name="code">
    <code>null</code>
    </part>
    </bindingFault>
    </bpelFault>
    </fault>
    Please let me know the solution for this issue?
    Thanks...

    I had the similar problem and I am using 11.1.1.5.
    When I changed the platformClassName to org.eclipse.persistence.platform.database.SQLServerPlatform it worked.
    You can find platformClassName in Outbound Connection Properties
    Hope this might work :)

  • Problem accessing Sql server Procedure from Crystal with JDBC driver

    I have some Crystal reports using SQL Server procedures, most of them are working very well; however, I have 2 that have problems accessing sql server procedures. These reports are working using OLE DB connection without problem, but when I try to relocate the connection to JDBC Crystal generates an error like that the procedure not return records.
    The procedure is working with other products including OLE DB connections from crystal.
    What can I do?
    Thanks in Advance,
    JaimeC

    I am using:
    Crystal report 11 - 11.0.0.1282 and Crystal 2008 = 12.0.0.683
    SQL Server 2005 -  Microsoft SQL Server Management Studio Express     9.00.4035.00
    Windows XP
    I have discovered that the procedures create and work  temporary tables. In other cases when is working ok, the procedures have not working temporary tables.
    Thanks,
    Jaime Carrillo

  • Migrate MS SQL Server procedure to Oracle

    Can any one suggest me any user friendly tool to Migrate MS SQL Server procedure to Oracle. I think using OMWB we can migrate schemas, as i could not find any interface to migrate a single procedure

    I tried using swisssql, but the trial version only migrates 10 tables and 10 indexes and no other objects. Is there any other tool which shall migrate only procedures? If so plz suggest me.....

  • SQL Server procedure migration

    I have a few SQL Server procedures that return multiple rows. How can I change them to be handled correctly by Oracle?

    Oracle8i JDBC Developer's Guide and Reference
    Release 2 (8.1.6) A81354-01 http://technet.oracle.com/doc/oracle8i_816/java.816/a81354/samapp5.htm#1016413 contains a jdbc example program shows Oracle JDBC REF CURSOR functionality
    Turloch
    Oracle Migration Workbench Team

  • Execute Sql Server Procedure from Oracle Forms

    Hi,
    I have Forms6i and need to create a form that execute a procedure in a SQL Server Database. This procedure inserts records retrieves from our Oracle Database (i passed the fields as parameters of the SQL Server procedure).
    What did i need to do to achieve this task.-
    Thanks in advance.-

    See
    http://www.oracle.com/technology/products/forms/pdf/275201.pdf
    Also search the forum and you will find discussions on this topic.
    Message was edited by:
    Mark Roberts

  • How to convert sql server procedure in to plsql procedure

    hi guys
    i have requirement where in i have to convert sql server procedure into plsql procedure.
    can some one help me out .
    thanks,
    Vamshi.D

    Hi Vamshi,
    As you want to convert sql server procedure in to plsql procedure
    i.e SQL SERVER ->ORACLE Right
    FYI
    SQL SERVER Proc. Syntax are totally different as compared to ORACLE Proc.
    So, better you study Logic of SQL-SERVER Proc and convert into
    Oracle Procedure.
    Thanks,
    Samadhan

  • SQL Server Procedures to Oracle Functions

    Is there an option in the Migration Assistant 1.2.0 that will convert the SQL Server procedures into Oracle Functions (rather than procedures)?
    By default the T/SQL procedures return a integer status code. Our middle-tier requires calls to procedures to return a status code (integer), and I'd like the migration to modify the "procedure" to a "Function returning Integer" rather than Procedure.

    Thomas,
    This is not an option currently. We will look into this for a future release. You could manually make the changes post conversion, prior to generation. As well as adding appropriate RETURN statements, you may want to add additional exception handling so the appropriate error is passed back.
    Donal

  • Database Adapter and SQL Server procedure issue

    Hello,
    I am using Jdev 11.1.1.7.0 and SQL Server 2005.
    In the Database Adapter configuration wizard, Specify Stored Procedure step, I choose the “GEACupax” schema and got the following error after a click on “Procedure Browse” button:
    com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'GEACUPAX.INFORMATION_SCHEMA.SCHEMATA'.
    The command Database Adapter tried to execute was:
    (from jdev log:) select schema_name from GEACUPAX.INFORMATION_SCHEMA.SCHEMATA order by schema_name;
    Note, the schema name has changed to uppercase. I think that is the problem. If I try this query in SQLDeveloper, it returns the same error. I can fix it changing the schema name to “GEACupax”. The case matters.
    Any ideas?
    Leandro.

    Vijay,
    Thanks for you reply.
    I figure out a related bug:
    Bug 12859472: Cannot browse store procedure in case-sensitive MS SQL Database
    There are two possible workarounds:
    1. Use a database name with capital letters
    2. Do not use stored procedures, but access the tables directly.
    The notes on the Bug ticket describes that the issue would be scheduled to be fixed in PS7 which is 11.1.1.8.
    Cheers!
    Leandro.

  • Can't use bcp in SQL Server procedure

    I need to export data of sales between the last 4 years to a csv using a stored procedure, however the output of that just gives User
    name not provided, either use -U to provide the username or use -T for Trusted Connection, then it gives the possible parameters to
    give to the command. What am I typing wrong? I've double checked the servername and i'm using -T.
    select
    dateSales, Sales
    into ##temp
    from
    dbo.Sales
    where
    dateSales between convert(varchar(20), year(DATEADD(YEAR, -4, getdate())))+'-01-01' AND getdate();
    select * from ##temp;
    EXEC xp_cmdshell 'bcp "select * from ##temp" queryout "C:\Users\PatriceW\Documents\sales.csv" -c -T -SSQLserver -t, -r\r\n'
    Thank you in advance.

    Unfortunately I can't reproduce it in my local.
    I tried belwo 2 in SSMS and also in Command prompt and both worked -
    EXEC xp_cmdshell 'bcp "select * from ##temp" queryout "C:\temp\sales.csv" -c -T'
    EXEC xp_cmdshell 'bcp "select * from ##temp" queryout "C:\temp\sales.csv" -c -T -S localhost'
    My BCP is inside C:\Program Files\Microsoft SQL Server\100\Tools\Binn.
    Few things to check:
    Ensure if the folder exists and you have permission to write to it. Try giving some local path.
    Try running the bcp from SSMS and CMD both. If it runs from CMD then SQL Server account has no permissions
    Do consider reading Permissions, Remarks section given in below:
     https://msdn.microsoft.com/en-us/library/ms162802.aspx
    -Vaibhav Chaudhari

  • Executing sql server procedure  from oracle via db link with out parameters

    HI
    we have successfully created the link between oracle and sql server via DB LINK also able to access table from the
    sqlserver via dblink
    Can any one tell me how to execute procedure with 1 input and 4 out parameters from pl\sql
    is it possible using
    dbms_hs_passthrough

    You should be able to call it like you would any other procedure:
    dbo.procedure_name@dblink(parameter_list);

  • Running multiple SSIS packages using SQL Server Agent question.

    I have a multitude of SSIS packages I want to run using SQL Server Agent.  What would the best practice be for running these jobs using SQL Server Agent?  One job per package or running all pakages from one job?  If you have an answer can
    you explain the technical reasoning behind your answer?  Thanks in advance.
    Stan Benner

    Hi, maybe a bit more analysis will give a better answer
    Do all the packages have to run in sequence? (if yes, single job better)
    Can the list of packages to be executed be grouped by dependency (ex package 1,2 and 5 must run in sequence and can be executed by one job, while package 3,4 are not dependent on package 1,2 and 5 can be run by a separate job).
    Can any jobs be run in parallel?
    How often will the package execution sequence change?
    How will you deploy your packages and job? (the more jobs to create the more install script needed and upgrade scenarios become messy).
    My personal preference:
    I create ONE ssis package which is executed by ONE sql agent job. lets call this 'PackageExecutionWrapper.dtsx'
    PackageExectionWrapper then contains multiple 'Execute Package' tasks for the packages you want to execute.
    In the package you can apply any package execution rules - which packages have to run after the other, which packages can run concurrently, which packages should only run if previous succeeded.
    If you need to change the sequence, simple, just update the PackageExecutionWrapper package.

  • Conc. prog as pl/sql stored procedure question

    When I registered a conc. program as pl/sql stored procedure, and, with in procedure I am using as following:
    exception
    when others
    retcode := 2;
    Where I am expecting the conc. request screen should show me as red one, that is completed with error. But, even though my program aborted for unknown reason, the conc. request screen for this conc. request-id shows as "completed-normal" insted of "completed_error".
    Any idea? what are the exact retcode should be used? please explain.
    Thanks
    R2b.
    null

    What about
    exception
    when others
    THEN
    retcode:=2;
    Jack

  • SQL Server - Feq Questions to clarify

    Hello All,
    1. If i have my Latest full backup on Sunday , and there by i have my differntial Backups daily ( mon, tue till sat) , and if i want to restore on friday, Tell me the procedure
    Ans : I am not sure i am right - but sharing my view and correct me if i am wrong - I will take the latest full backup on sunday , and there by i will pick all the Differntial Backups ( Mon, TUe, Wed, thur) & Start restoring all one by one
    i.e  - sunday Fullbackup + Monday Diff Backup + Tuesday Diff Backup + Wednesday Diff Backup + thurs Diff Backup .
    If i am wrong, please guide me the right formate of restoring
    Q2 : If my DB is configured to Replication And my secondary Server DB 's Ldf file has grown and i have to shrink , Whats the method i should adopt, Is it normal shrinking process which we adopt for stand alone DB or is there different process to shrink if
    the DB if its configured for replication.
    Q3 : What is the best way to identify the if the sql instance is  suffering from Memory issue or an CPU ? please suggest me the best way , apart from using tools like solar winds etc.
    hemadri

    1. nope
    Differential means it will contain all changes from last full backup
    so all that you would require to apply would be the last full backup on Sunday + latest differential backup on Thur
    2. see if this helps
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dae1484d-1a7e-4008-b55a-1e9f41de3c2b/shrink-database-for-replicated-db?forum=sqlreplication
    You cant shrink T- Log directly though if its a replicated db
    3. One method is to use query involving DMVs
    Another way is using performance counters
    http://www.grumpyolddba.co.uk/monitoring/Performance%20Counter%20Guidance%20-%20SQL%20Server.htm
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • SQL Server Scheduler Question

    I've got a simple package that I want to build. It appears that I will not be able to meet the scheduling requirements on it though. 
    It needs to run on the 16th of every month - UNLESS the 16th is a weekend day, in which case it needs to run on the following Monday.
    I can run it on the 1st, 2nd, (etc) Monday ... or the 1st, 2nd, (etc) weekday ... of the month.
    It seems like I need some combination of available options - and I don't see them.
    I believe I'd define my requirement as "First Weekday after the 15th day of the Month".
    I doubt this is available - but if anyone has any ideas, I would love to hear them.
    Thank you.
    Scott MacDonald
    Tucson, AZ

    Hello,
    Could you please take a look at the comment posted by THaouet on the following post?
    http://blogs.msdn.com/b/mwories/archive/2005/10/24/smosample-createjob.aspx
    Using programming he assigns a date for the job to start, the frequency, end date, etc.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

Maybe you are looking for

  • Applying a class to an HR tag

    Is it possible to apply a class to an HR tag within Contribute CS3? The class just contains basic height/colour attributes - but there seems to be no way to actually apply this to any horizontal rules within Contribute. Any help would be much appreci

  • Create procedure with IN and  OUT, what is IN+OUT?

    Hi. from docs: IN Specify IN to indicate that you must supply a value for the argument when calling the procedure. OUT Specify OUT to indicate that the procedure passes a value for this argument back to its calling environment after execution. IN OUT

  • What is the best NLS config to be near the ACCESS or SQL Server characters set

    Hi all, I am working with an Oracle for Windows. I have serious problems with my actual characters set. What is the best NLS config to be near the ms-Access or SQL Server characters set behavior ? For exemple : I have a table with city names I want t

  • Problem with HP1210 - Will not grab paper

    We've had this printer for a while now, and for some reason it has stopped "grabbing" the paper. The printer thinks there's no paper when there is. No paper jam, just can't grab the paper. Cleaned the rollers by opening the back, tried everything sug

  • I need to display more than 5000 rows by JClient JUtableBinding

    I need to display more than 5000 rows by JClient JUtableBinding. is it possible not to get PassivationError and display it?