Pagination and pl/sql

Greetings,
I have the following piece of code that I'm using to display images uploaded through HTMLDB into Intermedia. My question is how to create pagination in the following sql statement:
select s.id,s.thumb,s.thumbname,s.image.getWidth()as width,s.image.getHeight() as height from islidetable s order by id
so that I can have it display x-y of z records. Is there a way in sql to select a group of records say 10-15 of 30 records?
Thanks in Advance,
Cliff
declare
obj ORDSYS.ORDImage;
ctx raw(4000):=null;
nxtseq number;
thisrowid urowid;
i_index number := 0;
i_rows number := 4;
inum number;
BEGIN
htp.tableOpen(cattributes=>'border=0 align=center bgcolor=black cellspacing=1 cellpadding=25');
select count(*) into inum from islidetable;
for b_rec in (select s.id,s.thumb,s.thumbname,s.image.getWidth()as width,s.image.getHeight() as height from islidetable s order by id) loop
if (i_index mod i_rows) = 0 then
if (i_index = 0) then
htp.tableRowOpen(cattributes=>'bgcolor=white');
htp.p('<td align=center><img src=xxutpa_mig.extract_thumb?p_file='||b_rec.id||'><br>'||b_rec.thumbname);
htp.p('<br>W:'||b_rec.width||' H:'||b_rec.height||'</td>');
i_index := i_index + 1;
else
htp.tableRowClose;
htp.tableRowOpen(cattributes=>'bgcolor=white');
htp.p('<td align=center><img src=xxutpa_mig.extract_thumb?p_file='||b_rec.id||'><br>'||b_rec.thumbname);
htp.p('<br>Width:'||b_rec.width||' Height:'||b_rec.height||'</td>');
i_index := i_index + 1;
end if;
else
htp.p('<td align=center><img src=xxutpa_mig.extract_thumb?p_file='||b_rec.id||'><br>'||b_rec.thumbname);
htp.p('<br>Width:'||b_rec.width||' Height:'||b_rec.height||'</td>');
i_index := i_index + 1;
end if;
end loop;
htp.tableRowClose;
htp.tableClose;
END;

Hey Vikas,
Yeah, these semantics have bitten me before. I'm doing a query and returning 14 records. Rather than display them in a 1x14 table, I want to split them up into a 3x5 table, displaying the first 3 records returned from the query in the first row, next 3 in the next row, and so on and so forth. Being verbose, if the query returned
Jane Doe1   131 W. University   Anywhere, USA
Jane Doe2   132 W. University   Someplace, USA
Jane Doe3   133 W. University   Elsewhere, USA
Jane Doe4   134 W. University   Nowhere, USA
Jane Doe5   135 W. University   Here, USA
Jane Doe6   136 W. University   There, USA
I'd like to be able to display it as such:
Jane Doe1                Jane Doe2               Jane Doe3
131 Univ                 132 Univ                133 Univ
Anywhere                 Someplace               Elsewhere
Jane Doe4                Jane Doe5               Jane Doe6
131 Univ                 132 Univ                133 Univ
Nowhere                  Here                    There
..and so on and so forth through the next 9 records. Given that my query could return hundreds or thousands, I want to be able to paginate every 15 (or however many I deem sufficient) records.
I hope this made more sense, and thanks for responding.
TIA,
cliff

Similar Messages

  • Pagination and first_rows hint

    For a report region, how does HTML DB pagination work if the query has a first_rows hint in it?
    The pagination scheme I am talking about is the "simplest" one, Rows X to Y with next/previous links.
    Suppose I have a large resultset (in the thousands). first_rows is designed to optimize the execution plan for fast response time. So I get my first few pages fast. As successive pages are fetched, it would start to get slower and slower, right? Especially because the HTML DB engine fetches all the rows for every page over and over again and discards all the rows before the currently displayed window.
    So, given a large resultset, is it advisable to first_rows hint the query?
    Heck forget the size of the resultset, wouldnt it make sense to first_rows hint all queries since interactive web apps always fast response to queries?
    Can someone please explain how all this works?
    Thanks

    I would expect most of the time a user would only
    page through the first few pages - if they need toAbsent the first_rows hint, the CBO behaviour is to optimize for best overall performance (corresponding to the the all_rows hint)
    Steve, I agree with you completely. So, since the user is going to page thru the first handful of pages anyway, why would I want to expend database resources to optimize for all_rows?
    I think my concern about getting slower and slower is very much justified. If I have a query region using htmldb_item calls to create a manual tabular form, each next/previous link fetches all the records from 1 all over again and discards rows that fall before the requested rows. There would be tons of wasted calls to htmldb_item and the associated context switching between SQL and PL/SQL.
    [When the pagination scheme is Rows X to Y, I fail to understand why HTML DB doesnt use the clever pagination technique Tom suggests at
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064
    This would get just the rows needed and avoid unnecessary calls to htmldb_item. But I digress from the question I raised on this thread...]
    Tyler, Tom is not a big fan of hints, but he does recommend 2 hints that "give information" to the CBO that it wouldnt otherwise have. Those 2 hints are first_rows and cardinality!
    Thanks

  • A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (p

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that
    the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 2)
    The system cannot find the file specified
    Cannot connect to COWBOYS.
    Here are the technical details===================================
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider:
    Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476
    Error Number: 2
    Severity: 20
    State: 0
    Program Location:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer
    timeout)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance,
    SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
       at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
       at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
    ===================================
    The system cannot find the file specified
    I have tried from so many forms. This is so frustrating. Thank for everyone/anyone who wants to help. So this is what happened: I had to uninstall my previous sqlserver 2012(which worked great) for some reason, and I uninstalled everything from that download.
    Then I installed the trial edition of sql server 2012 (64 Bit) and It wouldn't connect to the database. (Error mentioned above.) My local DB is COWBOYS. (COWBOYS is also my computer name.) After this, I have tried downloading sqlexpress and sqlserver 64bit
    many times and cannot connect to my local DB. 
    How do I connect to my Local DB? 
    Also, I think this might help: (When I run sqlserve.exe, which I was able to find in C:\Program Files\Microsoft SQL Server\110\LocalDB\Binn, I get an error: Your SQL server installation is either corrupt or has been tampered with(Error getting
    instance ID from name). Please uninstall then re-run setup to correct this problem.
    I would happily re install it, if it wasn't my 20th time.
    I don't have any remote connections, I don't use username/password, only window authentication. I work mostly on visual studio, but without able to store /retrieve data, I don't know how to survive.
    May be the solution is very simple, but I am too frustrated. 
    Some of the things I have tried:
    From a command prompt, enter one of the following commands:
    net start "SQL Server Agent (MSSQLSERVER)" OR 
    net start "SQL Server Agent(instancename)"(for instance)
    on my sql configuration, I cannot start anything because there is nothing there to start. I can post more details, if that would help. Also, some more details about the error:
    Details
    Product:
    SQL Server
    ID:
    2
    Source:
    MSSQLServer
    Version:
    10.0
    Component:
    SQLEngine
    Message:
    An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error:
    40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
    Explanation
    SQL Server did not respond to the client request because the server is probably not started.
    User Action
    Make sure that the server is started.
    Version:
    9.0
    Component:
    SQLEngine
    Message:
    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error:
    40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
    Explanation
    SQL Server did not respond to the client request because the server is probably not started.
    User Action
    Make sure that the server is started.
    Any one that can help me, I will be greatful. Thank you so much. p.s. please ask me anything if you have any questions.

    It sounds like there are a couple things going on here.  First check if you have a successful install of SQL Server, then we'll figure out the connection issues.
    Can you launch SQL Server Configuration Manager and check for SQL Server (MSSQLSERVER) if default instance or SQL Server (other name) if you've configured your instance as a named instance.  Once you find this, make sure the service is started. 
    If not started, try to start it and see if it throws an error.  If you get an error, post the error message your hitting.  If the service starts, you can then launch SSMS and try to connect.  If you have a default instance, you can use the machine
    name in the connection dialog.  Ex:  "COWBOYS" where Cowboys is the machine name.  However, if you named the SQL Server instance during install, you'll need to connect using the machine\instance format.  Ex:  COWBOYS\Romo (where Romo
    is the instance name you set during install).
    You can also look at the summary.txt file in the SQL Server setup error logs to see what happened on the most recent install.  Past install history is archived in the log folder if you need to dig those up to help troubleshoot, but the most
    recent one may help get to the bottom of it if there is an issue with setup detecting a prior instance that needs to be repaired.
    Thanks,
    Sam Lester (MSFT)
    http://blogs.msdn.com/b/samlester
    This posting is provided "AS IS" with no warranties, and confers no rights. 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.

  • What is the diffrence between package javax.sql and java.sql

    Is javax designed for J2EE?
    And when to use package javax?

    Hi,
    What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
    1.The java.sql package and
    2.The javax.sql package.
    java.sql provides features mostly related to client
    side database functionalities where as the javax.sql
    package, which adds server-side capabilities.
    You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
    For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • Difference between Static SQL Query and Dynamic SQL Query.

    Hi,
    Please explain the basic difference between static and dynamic sql queries. Please explain with example.

    Static: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/static.htm
    Dynamic: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/dynamic.htm

  • Pivot and dynamic SQL

    Hi Team,
    I need to write a SQL to cater the requirements. Below is my requirements:
    pagename fieldname fieldvalue account_number consumerID
    AFAccountUpdate ArrangementsBroken dfsdff 1234 1234
    AFAccountUpdate ArrangementsBroken1 dfsdff 1234 1234
    AFAccountUpdate ArrangementsBroken2 dfsdff 1234 1234
    AFAccountUpdate ArrangementsBroken2 dfsdff 12345 12345
    AFAccountUpdate ArrangementsBroken1 addf 12345 12345
    Create table test_pivot_dynamic
    pagename varchar(200),
    fieldname Varchar(200),
    fieldvalue varchar(500),
    N9_Router_Account_Number bigint,
    TC_Debt_Item_Reference bigint
    --Input
    insert into test_pivot_dynamic Values('AFAccountUpdate','ArrangementsBroken','addf',1234,1234)
    insert into test_pivot_dynamic Values('AFAccountUpdate','ArrangementsBroken1','dfsdff',1234,1234)
    insert into test_pivot_dynamic Values('AFAccountUpdate','ArrangementsBroken2','fder',1234,1234)
    insert into test_pivot_dynamic Values('AFAccountUpdate','ArrangementsBroken2','dfdfs',12345,12345)
    insert into test_pivot_dynamic Values('AFAccountUpdate','ArrangementsBroken1','dfdwe',12345,12345)
    insert into test_pivot_dynamic Values('AFAccountUpdate1','Arrangements','addf',1234,1234)
    insert into test_pivot_dynamic Values('AFAccountUpdate1','Test1','dfsdff',1234,1234)
    --Expected output:
    Select 1234,1234,'AFAccountUpdate','ArrangementsBroken','addf','ArrangementsBroken1','dfsdff','ArrangementsBroken2','fder','ArrangementsBroken2','fder'
    Select 12345,12345,'AFAccountUpdate','ArrangementsBroken','addf','ArrangementsBroken1','dfdwe','ArrangementsBroken2','dfdfs'
    Select 1234,1234,'AFAccountUpdate1','Arrangements','addf','Test1','dfsdff'
    so basically we have to pivot and dynamic sql and insert the expected output to a common table which will have all the required fields
    Thanks,Ram.
    Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

    This should give you what you're looking for
    SELECT N9_Router_Account_Number,TC_Debt_Item_Reference,PageName,
    MAX(CASE WHEN SEQ = 1 THEN fieldname END) AS fieldname1,
    MAX(CASE WHEN SEQ = 1 THEN fieldvalue END) AS fieldvalue1,
    MAX(CASE WHEN SEQ = 2 THEN fieldname END) AS fieldname2,
    MAX(CASE WHEN SEQ = 2 THEN fieldvalue END) AS fieldvalue2,
    MAX(CASE WHEN SEQ = 3 THEN fieldname END) AS fieldname3,
    MAX(CASE WHEN SEQ = 3 THEN fieldvalue END) AS fieldvalue3,
    MAX(CASE WHEN SEQ = 4 THEN fieldname END) AS fieldname4,
    MAX(CASE WHEN SEQ = 4 THEN fieldvalue END) AS fieldvalue4
    FROM
    SELECT *,ROW_NUMBER() OVER (PARTITION BY N9_Router_Account_Number,TC_Debt_Item_Reference,PageName ORDER BY PageName) AS SEQ,*
    FROM test_pivot_dynamic
    )t
    GROUP BY N9_Router_Account_Number,TC_Debt_Item_Reference,PageName
    To make it dynamic see
     http://www.beyondrelational.com/modules/2/blogs/70/posts/10791/dynamic-crosstab-with-multiple-pivot-columns.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Problem with provisioning and external SQL server connection

    I am configuring IPAM 2012 R2 on a our management server.  Completed the first step by enabling the feature.  No issues.
    Now I am on the Provisioning IPAM step.  I get to the Configure Database step...
    I choose Microsoft SQL server,
    What should those values be in the Server name and Database name fields.  Instructions show fqdn or ip address but that doesnt seem to be working for me.
    I get the following error at the end of the Provisioning IPAM wizard,
    IPAM Deployment failed with the following error.
    Failed to connect to database server. Check the database name, connectivity and remote access.
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
    (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
    You can restart this provisioning wizard from the IPAM overview page.
    From the management server I have tested the SQL Connection with a udl file.  I used myServer\myInstance and it works.  It reports that I have made the Connection to the server and database with the sql credentials i have provided.
    Thanks

    Ran
    into a problem with connecting to the DB on the SQL server from the IPAM server.  The Dba and I checked the target SQL instance was enabled TCP and listening on a valid TCP port.  SQL server was set to use port 1443 for incoming connections. 
    IPAM was set by default to use 1433. 
    Also used
    netstat-n to identify issue and verified 1443 on SQL server was
    being used.  Made the correction under the IPAM provisioning wizard and connected to the database.  Fixed. 
    Important note I was able to connect to the database with a .udlfile
    without any issues
    Also note that 2012 R2 IPAM only supports 2012 SQL Enterprise.  Why?

  • Difference in behavior of sql and pl/sql after migrating from 9i to 11g

    after migrating our database from oracle 9i to oracle11g, the developpers are worry that the behavior of the queries and pl/sql procedures/functions will change
    example :
    in 9i, select salary,count(*) from emp group by salary, it will display the rows sorted by salary
    in 11gi, select salary,count(*) from emp group by salary, it will display the rows not sorted by default, we have to add the clause order by salary.
    somebody could give the list of other difference in behavior (SQL and PL/SQL) agter migrating from 9i to 11g
    Thanks a lot.

    Tell your developers: garbage in - garbage out. In relational databases only ORDER BY ensures row order. If your developers relied on GROUP BY implemented by SORT and therefore returning ordered rows they had to realize code they wrote is Oracle release dependent and sooner or later code would require changes. And that "sooner or later" is now reality. In newer versions ORACLE can do GROUP BY via SORT or via HASH. And if it is done via HASH - don't expect ordered results. So tell your developers "payback time".
    SY.

  • Query Engine report error with Crystal Report 9 And MS SQL SErver 2000

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...
    Refer the above statement highlighted in BOLD. That statement is WRONG. Select what ???? Try any one of the below statement,
    select ''
    --or
    select 0
    --or
    select null
    Regards, RSingh

  • How to acheive Pagination and Dynamic sorting in Web layout.

    Hi All,
    I'm new to Oracle Reports. I use Report Builder 10.1.2.0.2.
    I tried creating a template for simple tabular report. I modified the tempalte for Paper layout, Web layout ie modified .tdf, html, css files.
    When the data is dispalyed in the web browser, i need to do Pagination and dynamic sorting (ie when the column heading is clicked, it needs to do sorting by that column).
    In the jsp page of the report, it is possible but i want to incorporate this functionality in the Template. So that a single template can be used across multiple reprots with out any modification.
    Can any one please tell me how to do this.
    Please reply me at the earliest. Its very urgent.
    Thanks & Regards,
    P. Gayathri Devi

    Igor,
    You'll need to switch from using Partial Page Rendering to full page submits on that report. In version 4.0 we should be getting more control over event handling in PPRs but to what extent is still unknown.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    http://sourceforge.net/projects/plrecur

  • After restoring SharePoint farm backup ( The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connection)

    Hi,
    I have taken farm back and restore it in new UAT environment, while access to the main site getting the below error: 
    Error  
    An unexpected error has occurred. 
    Troubleshoot issues with Microsoft SharePoint Foundation. 
    Correlation ID: 866476f3-23dd-4e1e-97af-bffc62cc2d57 
    Date and Time: 7/15/2014 11:26:35 AM 
    When i checked in log i got below error
    System.Data.SqlClient.SqlException: A network-related or instance-specific
    error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40
    - Could not open a connection to SQL Server)    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj)     at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecu... 
    Thanks in advance
    Said Al Balushi

    Hi Wendy,
    i have checked all below points, every thing is fine but still i am getting the same error.
    Check SQL services are runing
    Check remote conenctions are enabled
    Check SQL Browser service is runing
    Check TCP/IP protocal enabled at SQL server
    Check out windows firewall setting
    Thanks,
    Said
     

  • SQL Server Agent Log showing errors [298] SQLServer Error: 10061, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL

    Hi All,
    I have started receiving this error in the logs for the last 10 days and the Schedules Jobs for the database have stopped running. My MS CRM application is working fine.
    Can anyone guide me what could be the problem.
    Date                      17/4/2014 2:04:20 PM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct
    and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001]
    Date                      17/4/2014 2:11:55 PM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error
    has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information
    see SQL Server Books Online. [SQLSTATE 08001]
    Date                      7/4/2014 11:00:31 AM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error
    has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information
    see SQL Server Books Online. [SQLSTATE 08001]

    Check this link
    http://social.msdn.microsoft.com/Forums/en-US/906da9b5-2482-468c-a424-ae099da2d96b/sql-server-agent-service-account-error?forum=sqlsetupandupgrade
    Regards, RSingh

  • Connecting to the LOB system has failed. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is

    hi ,
    when generate the schema , i  got the below error, please any one put your inputs:
    Connecting to the LOB system has failed.  A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server
    is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).

    thaks shanky,
    but facing another , after generate schema from  WCF_SQL, im unable get elements in my schema.
    this is schema generate from storeprocduer , but thru WCF-sql im unable get the elements like
    id, name
    <xsd:schema targetNamespace="urn:schemas-microsoft-com:sql:SqlRowSet2" xmlns:schema="urn:schemas-microsoft-com:sql:SqlRowSet2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified">
      <xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" />
      <xsd:element name="Test.dbo.sample">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="id" type="sqltypes:int" minOccurs="0" />
            <xsd:element name="name" minOccurs="0">
              <xsd:simpleType>
                <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
                  <xsd:maxLength value="1000" />
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
    <Test.dbo.sample xmlns="urn:schemas-microsoft-com:sql:SqlRowSet2">
      <id>18</id>
      <name>BIRADAR</name>
    </Test.dbo.sample>
    <Test.dbo.sample xmlns="urn:schemas-microsoft-com:sql:SqlRowSet2">
      <id>18</id>
      <name>BIRADAR</name>
    </Test.dbo.sample>
    <Test.dbo.sample xmlns="urn:schemas-microsoft-com:sql:SqlRowSet2">
      <id>19</id>
      <name>sw</name>
    </Test.dbo.sample>
    <Test.dbo.sample xmlns="urn:schemas-microsoft-com:sql:SqlRowSet2">
      <id>18</id>
      <name>BIRADAR</name>
    </Test.dbo.sample>
    <Test.dbo.sample xmlns="urn:schemas-microsoft-com:sql:SqlRowSet2">
      <id>14</id>
      <name>swe</name>
    </Test.dbo.sample>
    <Test.dbo.sample xmlns="urn:schemas-microsoft-com:sql:SqlRowSet2">
      <id>13</id>
      <name>se</name>
    </Test.dbo.sample>

  • A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The
    server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26- Error:Locating Server\instance Specified)
    How Can i solve this?

    1. Make sure SQL Server Service is running
    2. If a named instance, make sure SQL Server browser service is running
    3. Make sure SQL Server is configured to allow remote connections
    4. Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports
    5. Test server connectivity with PING from the client machine
    6. Test port connectivity using TELNET or PowerShell to the server and port (from step 4) from the client machine.  For example
    a. TELNET <server-name> 1433
    b. PowerShell: 1433 | % { echo ((new-object Net.Sockets.TcpClient).Connect("YourServerName",$_)) "server listening on TCP port $_" }
    7. Check firewall settings if step 5 or 6 connectivity test fails
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Java and MS SQL Server 2000 problem, please help

    please help me. I am using java and MS SQL Server 2000, and I'm trying to access and verify the login. I'm getting the following error message: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
    Can any please help in this regard.
    String userNumber = (String)userNumField.getValue();
    char[] userPasswordArray = userPasswordField.getPassword();
    String userPassword = new String(userPasswordArray);
         try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:Dikolobe_Data");
                java.sql.PreparedStatement statement = connection.prepareStatement(
                        "SELECT USER_NUMBER, USER_PASSWORD, USER_CLASS, USER_STATUS " +
                        "FROM SYS_USER " +
                        "WHERE (USER_NUMBER = ? AND USER_PASSWORD = ?);");
                statement.setString(1, userNumber);
                statement.setString(2, userPassword);
                java.sql.ResultSet result = statement.executeQuery();
                if(result.next()) {
                    String userStatus = result.getString(4);
                    if(userStatus.equals("logged on")) {
                        String loginErrorMessage = "User with number: " + userNumber + " is already logged on.";
                        javax.swing.JOptionPane loginErrorPane = getNarrowOptionPane(72);
                        loginErrorPane.setMessage(loginErrorMessage);
                        loginErrorPane.setMessageType(javax.swing.JOptionPane.ERROR_MESSAGE);
                        javax.swing.JDialog loginErrorDialog = loginErrorPane.createDialog(null, "Login Error");
                        loginErrorDialog.setVisible(true);
                    else {
                        String userClassification = result.getString(3);
                        if(userClassification.equals("Administrator")) {
                            AdminHomePage newAdminHomePage = new AdminHomePage();
                            newAdminHomePage.setVisible(true);
                        else if(userClassification.equals("Educator")) {
                            EduHomePage newEduHomePage = new EduHomePage();
                            newEduHomePage.setVisible(true);
                        statement = connection.prepareStatement(
                                "UPDATE SYS_USER SET USER_STATUS = ? " +
                                "WHERE USER_NUMBER = ?");
                        statement.setString(1, "logged on");
                        statement.setString(2, userNumber);
                        statement.executeUpdate();
                        dispose();
                }

    Doesn't the following link give you enough information?
    http://www.google.com/search?q=invalid+descriptor+index
    Anyway .. This error means that the given ResultSet column index which you're trying to retrieve the value from is out of the range.

Maybe you are looking for

  • FBL5N times out

    Hi Sappers!! When the user tries to run FBL5N with one company code and one business area, the transaction gets a short dump. Basically way too much data. The report is very important. I thought of splitting the report based on account groups but tha

  • Synchronous and Asynchronous BAPI

    Hi All, Like BDC do we have any options to update the database using BAPI synchronously or asynchronously? In BAPI which approach do we go for and is there a way that we can specify these update modes in BAPI like call transaction. Please help. Regar

  • Why can't I get my ipod shuffle to do anything when I know the battery is full

    Why can't I get my Ipod shuffle to do anything? Before it stopped playing, saying or doing any thing I checked battery and it was full! This has happened before with another Ipod shuffle and I took it back. well, my new one is doing it. It plays for

  • CS5.5 relink options, a problem with relinking pdf

    When I use relink command on my Applescript I have a problem with .pdf; infact by default relink only the graphics items inside of relinked pdf, but I prefer to relink the whole page. By hand I can specify that using "show import options" and select

  • Merging two backups

    Hi! I've managed to make two different backups and noen of them have got all of my photos, are there any ways two merge them? I'm considering writing one of them over the other, but I'm not sure what happens. One of the other solutions I can come up