Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all 1350 articles
Browse latest View live

Connection Pool issue

$
0
0

Hi All,

How can i write a code in VB.net to connect the oracle database , where the connection.open() method is written inside the contructor of DataAccessLayer class?

I tried something like this

Public Class DataAccessLayer

Public Sub New()


Dim connectionString As String = ConfigurationSettings.AppSettings("connectionString").ToString()
Me.oracleConnectionString = connectionString
Try
oracleConnection = New OracleConnection(Me.oracleConnectionString)
If oracleConnection.State = ConnectionState.Closed Then
oracleConnection.Open()
End If

oracleCommand = oracleConnection.CreateCommand()
Catch ex As Exception
Throw New CustomException(ex.Message) ', ex.InnerException)
End Try
End Sub

End Class

And i m instantiating the class by following method,

Public Class Business Implements System.IDisposable

Private objDL As DataAccessLayer

Public Sub New()
objDL = New DataAccess
End Sub

Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If disposing Then
objDL.Dispose()

End If
End Sub

Public Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub

End Class

Now the issue is though i m disposing the objects , Many Oracle connections are still showing in open state exceeding connection pool.

Can anyone help me in understanding what i m doing wrong here?

Regards


how to udate updatexml

$
0
0

i am using oracle.

Before update
------------------------
<row id="1">
  <a1>name</a1>
  <a2>address1</a2>
  <a3>tel1</a3>
  <a3 m="2">20181231</a3>
  <a3 m="3">date3</a3>
</row>



After Update
------------------------
<row id="1">
  <a1>name</a1>
  <a2>address1</a2>
  <a3>tel1</a3>
  <a3 m="2">20181230</a3>
  <a3 m="3">date3</a3>
</row>
*/

oracle xml to column

$
0
0

i am using oracle 12g. and my table structure has two column, 1st is ID of the record, 2nd column is defined as XMLTYPE.

now the data stored in XMLTYPE is like a xml format. but i don't know how can i write a sql to retrieve the tag to column.

below is my example.

<row id='1'><c1>Name</c1><c4>Gender</c4><c4 m='2'>F</c4><c4 m='3'>M</c4><c6>Address</c6><c8>Nationality</c8></row>

every data stored in XMLTYPE is not fixed lenght. how can i write a sql to convert above xml format to column as below expected result.

 

Name   Gender        M   Address    Nationality

how to retrieve data from sql into the excel

$
0
0

i want to retrieve data from sql into the excel how can i do it?

Can I use MySQL views as source for Entity Framework DB first approach?

$
0
0

hi,

Can I use MySQL views as source for Entity Framework DB first approach?

ORA-12504: TNS: listener was not given the Service_name in connect_data

$
0
0

Hi.

I am trying to connect to Oracle Exadata 12 c database from a C# Web application ( VS2010).

I have used the below code

//web.config<add name="con" connectionString="DataSource=servername;userId=uid;password=pwd" providerName="Oracle.DataAccess.Client" />

// c# cs code
string oradb = System.Configuration.ConfigurationManager.ConnectionStrings["con"].ConnectionString;

OracleConnection conn = new OracleConnection(oradb);
conn.Open()

I am getting the error: ORA-12504: TNS: listener was not given the Service_name in connect_data , when the Open connection is called.

The tns entry has the below:

t1_exa_abc=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL = TCP)
(HOST=SERVERNAME)
(PORT=port number)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=t1_exa_abc.domain.com)
)
)

How to fix this?

Error: The provider is not compatible with the version of Oracle client

$
0
0

Hi,

I am trying to access Oracle 12.2 version and a custom database  and read the data. I am using Visual studio 2010 version.

I am getting warning as 'There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference Oracle.DataAcess, Version 4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86,"x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architecture between your project and the references, or take a dependency on reference with a processor architecture that matches the targeted processor architecture of your project'

I am able to build and run the application, but trying to access the database, the connection fails with the below error: The provider is not compatible with the version of Oracle client.

Below is the code used:

string oradb = System.Configuration.ConfigurationManager.ConnectionStrings["OraConn"].ConnectionString;
OracleConnection conn = new OracleConnection(oradb);
 conn.Open();

How to fix this?

sap.middleware.connector connection issue

$
0
0

Hello, 

Recently i'm always facing connection issue. The error message as below. Any idea how to solve it? 

Description: An unhandled exception occurred during execution of the currenct web request. Please review the stack trace for more information 

Exception Details: sap.middleware.connector.rfcinvalidparameterexception : Destination xxx does not exits (anymore)

Thanks.


Unable to Add Parameters to an Oracle Query in a Typed-Dataset Class

$
0
0

I am using ODP.Net to connect to an Oracle database.  I am using a dataset class to generate a typed-dataset.  I am able to create a tableAdapter and add a query that will return data.  However, I cannot figure out how to add a parameter to the query. 

Sample query:

SELECT PERSON_CODE, LAST_NAME
FROM PERSONTABLE

The same query with a parameter:

SELECT PERSON_CODE, LAST_NAME
FROM PERSONTABLE
WHERE PERSON_CODE = :Parameter1

Whenever the parameter is added, the TableAdapter Configuration Wizard gives the error "Specified argument was out of the range of valid values."

I have tried substituting ? for the parameter name, but that gives the same error.  @Parameter1 is not recognized, an Oracle syntax error.

I would greatly appreciate your help.

Oracle Query to SQL query conversion issues

$
0
0

Dear All, 

can someone please help to convert the following oracle query to sql specific please.. as i am really struggling with that ..

SELECT "SAMPLE"."ID_NUMERIC","SAMPLE"."BATCH_NO","SAMPLE"."STATUS","SAMPLE"."RECD_DATE","SAMPLE"."DATE_AUTHORISED","SAMPLE"."TEMPLATE_ID","SAMPLE"."RELEASE_DATE","SAMPLE"."LOGIN_DATE","SAMPLE"."DATE_COMPLETED",

         TRUNC((((86400*(DATE_COMPLETED-RECD_DATE))/60)/60)/24) AS VC_Days,
	 		TRUNC(((86400*(DATE_COMPLETED-RECD_DATE))/60)/60)-(24*(TRUNC((((86400*(DATE_COMPLETED-RECD_DATE))/60)/60)/24))) AS VC_Hrs,
	 		TRUNC((86400*(DATE_COMPLETED-RECD_DATE))/60)-(60*(TRUNC(((86400*(DATE_COMPLETED-RECD_DATE))/60)/60))) AS VC_Min,
	 		TRUNC(86400*(DATE_COMPLETED-RECD_DATE))-(60*(TRUNC((86400*(DATE_COMPLETED-RECD_DATE))/60))) AS VC_Sec,
         TRUNC((((86400*(RELEASE_DATE-RECD_DATE))/60)/60)/24) AS VR_Days,
	 		TRUNC(((86400*(RELEASE_DATE-RECD_DATE))/60)/60)-(24*(TRUNC((((86400*(RELEASE_DATE-RECD_DATE))/60)/60)/24))) AS VR_Hrs,
	 		TRUNC((86400*(RELEASE_DATE-RECD_DATE))/60)-(60*(TRUNC(((86400*(RELEASE_DATE-RECD_DATE))/60)/60))) AS VR_Min,
	 		TRUNC(86400*(RELEASE_DATE-RECD_DATE))-(60*(TRUNC((86400*(RELEASE_DATE-RECD_DATE))/60))) AS VR_Sec,

	 		TRUNC((((86400*(DATE_AUTHORISED-DATE_COMPLETED))/60)/60)/24) AS CA_Days,
	 		TRUNC(((86400*(DATE_AUTHORISED-DATE_COMPLETED))/60)/60)-(24*(TRUNC((((86400*(DATE_AUTHORISED-DATE_COMPLETED))/60)/60)/24))) AS CA_Hrs,
	 		TRUNC((86400*(DATE_AUTHORISED-DATE_COMPLETED))/60)-(60*(TRUNC(((86400*(DATE_AUTHORISED-DATE_COMPLETED))/60)/60))) AS CA_Min,
	 		TRUNC(86400*(DATE_AUTHORISED-DATE_COMPLETED))-(60*(TRUNC((86400*(DATE_AUTHORISED-DATE_COMPLETED))/60))) AS CA_Sec,

	 		TRUNC((((86400*(DATE_AUTHORISED-RECD_DATE))/60)/60)/24) AS VA_Days,
	 		TRUNC(((86400*(DATE_AUTHORISED-RECD_DATE))/60)/60)-(24*(TRUNC((((86400*(DATE_AUTHORISED-RECD_DATE))/60)/60)/24))) AS VA_Hrs,
	 		TRUNC((86400*(DATE_AUTHORISED-RECD_DATE))/60)-(60*(TRUNC(((86400*(DATE_AUTHORISED-RECD_DATE))/60)/60))) AS VA_Min,
	 		TRUNC(86400*(DATE_AUTHORISED-RECD_DATE))-(60*(TRUNC((86400*(DATE_AUTHORISED-RECD_DATE))/60))) AS VA_Sec

    FROM "SAMPLE"

Export Database Data In Excel File

$
0
0

hi 

i was building web application that connect to Database and this is my code 

[HttpPost]
        public IActionResult Index(int AccountID,DateTime StartDate, DateTime EndDate,string ReportNO)
        {
            var UserName = User.Identity.Name;
            SqlConnection connection = new SqlConnection(my connection string );
            connection.Open();
            SqlCommand command = new SqlCommand("SELECT * FROM [dbo].[tblReports]", connection);
            SqlDataReader reader = command.ExecuteReader();
            if (reader.HasRows)
            {
reader.read();

}
return view();
}
              

how i can export SqlDataReader in excel sheet file?

Insert text in a given Column using Open XML

$
0
0

How do we insert a string value in a given cell with specific Address in OpenXML? For Eg: I want to insert "Hello World" in column "AC" of my Excel Spread Sheet. I have a list of dictionary with the excel row data and I am doing as below.

SheetData sheetData = worksheetPart.Worksheet.GetFirstChild<SheetData>();
        int rowindex = 2;
        foreach (Dictionary<string,string> _row in _ExcelRows)
        {
            Row row = new Row();
            row.RowIndex = (uint)rowindex;
            sheetData.Append(row);
            foreach (KeyValuePair<string,string> pair in _row)
            {
                string CellAddressForCurrentAttribute = string.Empty;
                if (_ExcelToCoeusMap.ContainsValue(pair.Key))
                {
                    KeyValuePair<string, string> kvp = _ExcelToCoeusMap.Where(x => x.Value == pair.Key).FirstOrDefault();
                    if (_ExcelColumnsAddressMap.ContainsValue(kvp.Key))
                        CellAddressForCurrentAttribute = _ExcelColumnsAddressMap.Where(y => y.Value == kvp.Key).FirstOrDefault().Key;

                    Cell cell = row.Elements<Cell>().Where(c => c.CellReference.Value.Equals(CellAddressForCurrentAttribute,StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
                    cell.CellValue = new CellValue(pair.Value);
                }
            }
            rowindex++;

My Rows 1 and 2 will have some header information and data rows start from 3(index 2) I am correctly populating the Cell address in CellAddressForCurrentAttribute but when I hit the row.Elements<Cell>().Where(c => c.CellReference.Value.Equals(CellAddressForCurrentAttribute,StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); its returning null . Not sure what am I missing here

Return only those numbers which are searching for not the one which has value in between

$
0
0

Hi,

Using below query i am getting below output. but i am not getting expected result, you could see in the grid view, unexpected result also coming like "300116". i just want only return those project numbers which start with 0011. i know its returning matching numbers as i have used like operator. Could anyone help me,  what i need to change from the below query to return only 0011 related project numbers?

Thanks in advanced!

 query = " select rownum num, project_num, proj_name, pidate,units,Borough_name,engineer1, rpt_status, overall_phy_cond,maint_pol_practices " & _" from (select distinct sch.project_num, mbs.proj_name, to_char(sch.physical_inspect_date,'yyyy-mm-dd') pidate,sch.units,mbs.Borough_name,sch.engineer1, smy.rpt_status, con.overall_phy_cond, con.maint_pol_practices " & _" from AM_OI_PHY_INSP_SCHEDULE sch, ben_proj_masters_v mbs, am_oi_phy_insp_proj smy, am_oi_phy_insp_maint_constr con " & _" where sch.project_num = mbs.project_num " & _" and sch.project_num = smy.project_num(+) " & _" and sch.project_num = con.project_num(+) " & _" and sch.physical_inspect_date = smy.physical_inspect_date(+) " & _" and sch.physical_inspect_date = con.physical_inspect_date(+) " & _" and smy.rpt_status = '" & ddl_Status.SelectedValue & "'" & _" and to_char(sch.physical_inspect_date,'YYYY') = '" & DdL_year.SelectedValue & "'" & _" and (sch.project_num  = '" & txt_otherSrch.Text & "' or " & "sch.project_num Like '%" & txt_otherSrch.Text & "' or sch.project_num Like '" & txt_otherSrch.Text & "%' or sch.project_num like '%" + txt_otherSrch.Text + "%'" & _" or mbs.proj_name  = '" & txt_otherSrch.Text & "' or " & "mbs.proj_name Like '%" & txt_otherSrch.Text & "' or mbs.proj_name Like '" & txt_otherSrch.Text & "%' or mbs.proj_name like '%" + txt_otherSrch.Text + "%'))" & _" order by pidate desc "

.NET Core 2.2 Razor Pages Project Can't See Table in SQLite (VS 2017)

$
0
0

My project builds with no errors. The home page loads when I click on the Run arrow.
But when I click the link to display the Courses View I get this error below "SQLite Error 1: 'no such table: Courses'."

Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: Courses'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
   at System.Linq.AsyncEnumerable.Aggregate_[TSource,TAccumulate,TResult](IAsyncEnumerable`1 source, TAccumulate seed, Func`3 accumulator, Func`2 resultSelector, CancellationToken cancellationToken) in D:\a\1\s\Ix.NET\Source\System.Interactive.Async\Aggregate.cs:line 120
   at OESAC.Pages.Courses.IndexModel.OnGetAsync() in J:\OESAC\Pages\Courses\Index.cshtml.cs:line 30

Here is my code iin the .cs file. It runs right up to the OnGetAsyc


namespace OESAC.Pages.Courses
{
public class IndexModel : PageModel
{
public readonly OESAC.Data.MyDbContext _context;

public IndexModel(OESAC.Data.MyDbContext context)
{
_context = context;
}

public IList<CoursesViewModel> CoursesVM { get;set; }

public async Task OnGetAsync()
{
//CoursesVM = await _context.Courses.ToListAsync();
CoursesVM = await _context.Courses
.Select(p => new CoursesViewModel
{
OESACID = p.OESACID,
CourseTitle = p.CourseTitle,
Instructor = p.Instructor,
Locations = p.Locations,
Dates = p.Dates,
CEUDWP = p.CEUDWP,
CEUDEQ = p.CEUDEQ,
CEUonsiteInstall = p.CEUonsiteInstall,
CEUonsiteOandM = p.CEUonsiteOandM,
MaxCEU = p.MaxCEU,
SponsorID = p.SponsorID,
MrMs = p.MrMs,
CurrentContactName = p.CurrentContactName,
ContactBizName = p.ContactBizName,
ContactAddress = p.ContactAddress,
ContactCity = p.ContactCity,
ContactState = p.ContactState,
ContactZip = p.ContactZip,
CurrentContactPhone = p.CurrentContactPhone,
CurrentContactFax = p.CurrentContactFax,
CurrentContactEmail = p.CurrentContactEmail,
DateRec = p.DateRec,
FeeRec = p.FeeRec,
CheckNumber = p.CheckNumber,
PrelimAprvDate = p.PrelimAprvDate,
MailedReceipt = p.MailedReceipt,
FinalAprvDate = p.FinalAprvDate,
MailedFinal = p.MailedFinal,
HomeStudy = p.HomeStudy,
Recurring = p.Recurring,
PutOnCommitteeList = p.PutOnCommitteeList,
FinalLetterSent = p.FinalLetterSent,
URL = p.URL,
ThreeYearLetterSent = p.ThreeYearLetterSent,
TakeOffWeb = p.TakeOffWeb,
Inactive = p.Inactive
}).ToListAsync();

}
}
}

Here is my Startup.cs file

public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});

//services.AddDbContext<MyDbContext>(options => options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));

services.AddEntityFrameworkSqlite()
.AddDbContext<MyDbContext>(
options => { options.UseSqlite($"Data Source=./Data/sqlite/oesac_new.db"); });

Here is my appsettings.json file

{
"ConnectionStrings": {

"DefaultConnection": "Dsn=SQLite3 Datasource"

},

I have tried all sorts of connection strings from absolute path to database, relative path, etc.
I can see the Sqlite database in my Server Explorer where I "made new connection".
I can see the tables and their data.
it gives me the connectionString besides the datasource name in  the properties.
Either one is successful if I click "Test Connection" button.
Dsn=SQLite3 Datasource;database=J:\OESAC\Data\sqlite\oesac_new.db;stepapi=0;syncpragma=NORMAL;notxn=0;timeout=100000;shortnames=0;longnames=0;nocreat=0;nowchar=0;fksupport=0;oemcp=0;bigint=0;jdconv=0

My assumptions are that the connectionString is correct, but it says no table named "Courses" exists!

I am pulling my hair out here.

Retrieving BLOB datatype from a table without any Index?

$
0
0

Hi,

 

i have a situation where i have to retrieve the fingerprint scan from the database table when the user scans his finger.

  when user scans his finger  m_Vrfmin is generated by a function and i need to check if that image exists in the database table.

how to write the query string for that?? to retrive the Blob from the database just by comparing the blobs. 

         try

         DB2Connection conn1 = new DB2Connection(System.Configuration.ConfigurationSettings.AppSettings["DB2ConnectionString"].ToString());
          conn1.Open();
          DB2Command cmd1 = conn1.CreateCommand();
          cmd1.CommandText = "SELECT picture FROM SYSTEM.INMATE Where picture = " + m_VrfMin;
          //cmd1.CommandText ="SELECT  bookingid FROM SYSTEM.INMATE WHERE BookingID= 'userid' AND Password = 'pass'"; ---this works fine if i use id and pwd to retriev.
          DB2DataReader reader= cmd1.ExecuteReader(CommandBehavior.SequentialAccess);
          bool bfound =reader.Read();
              if (bfound)
          {
              // Obtain the BLOB object
                    //StatusBar.Text = "No data to verify";         
              reader.GetBytes(0,0,out_picture,0,maxSize);
                           
                              
          }
                           
          reader.Close();
              conn1.Close();
          }

 

somebody plz help me if you have any idea ??

Thanks,

Chakawa 


Convert firestore data to datatable

$
0
0

I have an Android app connected to firestore and an asp.net app connected to the same firestore repo, for adminstrative tasks, using the Google.Cloud.Firestore library.

Getting back a QuerySnapshot I can loop it and construct a datatable column by column, row by row, but I was wondering if there was a faster way to do this (tried qsnapshot.Cast<DataTable> but it didn't work).

Anyone here done this before?

Convert Excel to CSV and Ignore Empty Cells and DropDownList in C#

$
0
0

Hello there,

I have the following method which loops over my Excel workbook sheet as a data table converting it to CSV via the string builder output.

On my Excel workbook I have the dropdownlist and on the output CSV these dropdownlist also are converted from XLS to CSV also when the row Excel is empty.

I have tried to check string is null or not empty but the output of CVS is empty file.

while (row_no < result.Tables[ind].Rows.Count)
{
    for (int i = 0; i < result.Tables[ind].Columns.Count; i++)
    {
        if (!String.IsNullOrWhiteSpace(csvData))
        {
            csvData += result.Tables[ind].Rows[row_no][i].ToString() + "|";
        }
    }

    row_no++;
    csvData += "\n";
}

Question; what am I doing wrong?!

I feel like I'm so close, but its just not behaving.

Thank you in advance for your assistance.

My complete code below :

 FileUpload1.PostedFile.SaveAs(Server.MapPath("...");
 string filePath = HttpContext.Current.Server.MapPath("...");
 FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read);
 IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
 DataSet result = excelReader.AsDataSet();
 excelReader.Close();

 result.Tables[0].TableName.ToString();
 string csvData = "";
 int row_no = 0;
 int ind = 0;

 while (row_no < result.Tables[ind].Rows.Count)
 {
     for (int i = 0; i < result.Tables[ind].Columns.Count; i++)
     {
        csvData += result.Tables[ind].Rows[row_no][i].ToString() + "|";    
     }

     row_no++;
     csvData += "\n";
 }

 output = HttpContext.Current.Server.MapPath("...csv");
 newOutput = Path.GetFileName(output);
 StreamWriter csv = new StreamWriter(@output, false);
 csv.Write(csvData);
 csv.Close();
 csv.Dispose();

SQL Server 2005 - Need to mask an existing table column

$
0
0

Hi All,

I have a column in the SQL Server 2005 DB which needs to be masked to ****. I tried masking it using mask function, however I found out that masking function works only in SQL Server 2016 + and above.

Is there any easiest way to alter an existing column in SQL Server 2005 DB to ***** ??

Looking forward to hear from you. Thanks.

Selected rows on MySQL table on time slot

$
0
0

Hello there.

This is my dotable on MySQL database :

+--------------+------------+----------+
    | sID          | sDate      | sHour    |+--------------+------------+----------+
    | 1440190025   | 2019-05-08 | 02:46:01 |
    | 1440190019   | 2019-05-07 | 16:06:01 |
    | 1440190017   | 2019-05-07 | 12:59:02 |
    | 1440190013   | 2019-05-07 | 10:56:14 |+--------------+------------+----------+

I need select on this dotable all rows included on this time slot :

18:00:00-00:00:00

with decreasing three hours to the start time ( -3 hours on 18:00:00 ) and adding three hours to the final hour (+3 hours on 00:00:00 ) :

    -3 18:00:00 >>> 15:00:00 +3 00:00:00 >>> 03:00:00 

I have tried this SQL query :

    mysql> SELECT
    	sID,
    	sDate,
    	sHour
    FROM
    	dotable
    WHERE
    	sHour BETWEEN ADDTIME(
    		SUBSTRING_INDEX('18:00:00-00:00:00', '-', 1) ,- 30000
    	)
    AND ADDTIME(
    	SUBSTRING_INDEX('18:00:00-00:00:00', '-', - 1),
    	30000
    );+------------+------------+----------+
    | sID        | sDate      | sHour    |+------------+------------+----------+
    | 1440190019 | 2019-05-07 | 16:06:01 |+------------+------------+----------+
    1 row in set
    mysql> 

But on this output it's not show the sID number 1440190025 though the value ofsHour (02:46:01) is included on slot time 15:00:00 - 03:00:00.

Do anyone have an idea why?

My code below.

    DROP TABLE IF EXISTS `dotable`;
    CREATE TABLE `dotable` (
      `sID` int(10) NOT NULL AUTO_INCREMENT,
      `sDate` date DEFAULT NULL,
      `sHour` varchar(255) DEFAULT NULL,
      PRIMARY KEY (`sID`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    -- ----------------------------
    -- Records of dotable
    -- ----------------------------
    INSERT INTO `dotable` VALUES ('1440190013', '2019-05-07', '10:56:14');
    INSERT INTO `dotable` VALUES ('1440190017', '2019-05-07', '12:59:02');
    INSERT INTO `dotable` VALUES ('1440190019', '2019-05-07', '16:06:01');
    INSERT INTO `dotable` VALUES ('1440190025', '2019-05-08', '02:46:01');

OCIEnvCreate failed with return code -1 but error message text was not available.

$
0
0

Hi,

I have installed Oracle - OraClient11g_home1 in my local system(windows 7, 32 bit configuration) and Toad for oracle also installed(Toad for Oracle 11.5).

Now my situation is-

I have installed SQL Server reporting services(SSRS) 2012 and while creating connection i am getting this error. can any body help me, why i m getting this error.

Error is-

OCIEnvCreate failed with return code -1 but error message text was not available.

Viewing all 1350 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>