logo
down
shadow

SQL QUESTIONS

how to generate primary key values while inserting data into table through pl/sql stored procedure
how to generate primary key values while inserting data into table through pl/sql stored procedure
this one helps. You can generate primary key values as a surrogate key using an Oracle SEQUENCE. You can create a constraint on a column that uses TRANSLATE to check that no numeric digits exist in newly inserted/updated data.Some example code, suita
TAG : sql
Date : November 27 2020, 07:01 PM , By : Hitesh Jaisinghani
Calling stored procedure from another stored procedure and returning result as new columns
Calling stored procedure from another stored procedure and returning result as new columns
will be helpful for those in need How to call stored procedure from another stored procedure and return the result as first one's column? , Ouput parameter for one value:
TAG : sql
Date : November 27 2020, 07:01 PM , By : LMP
Are these tables respect the 3NF Database Normalization?
Are these tables respect the 3NF Database Normalization?
This might help you This looks a bit like a homework problem, but let me answer anyway: No, the tables are not in 3NF; tables with surrogate keys rarely are. For example, the READERS table has two candidate primary keys: READER_ID and (First_Name, La
TAG : sql
Date : November 27 2020, 07:01 PM , By : Ravi Choudhary
Complex query making site extremely slow
Complex query making site extremely slow
To fix the issue you can do The very best thing you can do is run the query, but put an EXPLAIN in front of it, and analyze the results.Without knowing the structure (especially the indexes) of all of the tables in that query, we'll be hard-pressed t
TAG : sql
Date : November 27 2020, 07:01 PM , By : Bhrushank Ved
SQL Full-Text Indexing Issue
SQL Full-Text Indexing Issue
I wish this helpful for you Full text searching is really supposed to be used as a natural language search based on whole words, however you can use it to look for words suffixes (not substrings) using CONTAINS with a pattern in the form "Jo*"
TAG : sql
Date : November 27 2020, 07:01 PM , By : Divya
finding a relationship accross many tables
finding a relationship accross many tables
like below fixes the issue I realize you are looking for a finished app to do the job, but in case you do not find one better than SQL Dependency Tracker, here is a tip to get you started writing your own:For SQL Server, Listing SQL Server Object Dep
TAG : sql
Date : November 27 2020, 07:01 PM , By : user3863657
Using Parameter Values In SQL Statement
Using Parameter Values In SQL Statement
Hope that helps There is probably a better way to do this, but what you are probably trying to do in your example is what's called dynamic SQL where you treat the statement as a string and the execute it. This would be section 2 here: http://www.mssq
TAG : sql
Date : November 27 2020, 07:01 PM , By : Gilles
oracle sql plus spool
oracle sql plus spool
this will help Are you concatenating delimiting your columns, or are you exporting fixed-width?See this documentation on SQL*Plus Script Tuning. Specific to your script, here are a few possible ways to speed it up:
TAG : sql
Date : November 27 2020, 07:01 PM , By : Rich
Multiple rows update trigger
Multiple rows update trigger
this one helps. Assuming SQL Server, A trigger only fires once per update, regardless of the number of rows that are updated. If you need to carry out some additional logic based on updates to multiple rows you can access the changed records by looki
TAG : sql
Date : November 27 2020, 07:01 PM , By : user3856707
SQL - Conditionally evaluate WHERE clauses
SQL - Conditionally evaluate WHERE clauses
around this issue I need to get a WHERE clause to only evaluate certain statements. something like:
TAG : sql
Date : November 26 2020, 07:01 PM , By : alex
Locking User account created under Windows Authentication in SQL Server
Locking User account created under Windows Authentication in SQL Server
wish helps you As per my project requirement i need to lock a user in SQL Server(Which is created using Windows Authentication). Is there any way to do this? , You need to keep two things apart:
TAG : sql
Date : November 26 2020, 07:01 PM , By : user3863486
trigger execution against condition satisfaction
trigger execution against condition satisfaction
help you fix your problem You are validating whether the entered RECEIPTS1.rctmemenrolno matches a memenrolno in MEMAST, right? Well a trigger is the wrong way to do this. The loop completely won't scale (the more rows in MEMAST the longer it will ta
TAG : sql
Date : November 26 2020, 07:01 PM , By : y0gga
oracle sql developer is truncating my results
oracle sql developer is truncating my results
this will help I was having the same issue in SQL Developer 4. Here is what worked for me:
TAG : sql
Date : November 26 2020, 07:01 PM , By : ani
“Function” calling inside stored procedure
“Function” calling inside stored procedure
I wish this helpful for you I have a big stored procedure that contains a lot of INSERTs. There are many INSERTS that almost identical - they're different by some parameter(s) (all INSERTs to the same table) , Sure. It is easy to create a private fun
TAG : sql
Date : November 26 2020, 07:01 PM , By : nishantSamsung
Excel VBA to Update SQL Table
Excel VBA to Update SQL Table
hop of those help? Instead of AddNew to open a new record, use Find to locate an existing one. Like:
TAG : sql
Date : November 26 2020, 07:01 PM , By : user3861629
I've caught an exception!! Now what?
I've caught an exception!! Now what?
To fix this issue Rule of thumb for exception handling--If you don't know what to do with it, don't catch it. Corollary to the rule of thumb for exception handling--Handle exceptions at the last responsible moment. If you don't know if this is the la
TAG : sql
Date : November 25 2020, 07:01 PM , By : user3863180
How to select the last two records for each topic_id in MySQL
How to select the last two records for each topic_id in MySQL
This might help you I have to select the last two records for every topic.
TAG : sql
Date : November 25 2020, 07:01 PM , By : user3863013
SQL Server 2005 triggered audit tables moved to SQL Server 2008, now trigger does not respond when trying to insert row
SQL Server 2005 triggered audit tables moved to SQL Server 2008, now trigger does not respond when trying to insert row
Any of those help well that trigger appears to have the old name to me. But if it really does have the new name...hmmm...Since it is a distributed transaction are you sure you have the linked server set up correctly?
TAG : sql
Date : November 24 2020, 07:00 PM , By : Alka Koul
Using NHibernate to insert/update using a SQL server-side DEFAULT value
Using NHibernate to insert/update using a SQL server-side DEFAULT value
Hope this helps When mapping the class property to the table column, set insert="false" update="false".
TAG : sql
Date : November 24 2020, 07:00 PM , By : Venk Natarajan
How to convert column type from varchar to date in PostgreSQL?
How to convert column type from varchar to date in PostgreSQL?
To fix this issue I have varchar data type column and date data type column.
TAG : sql
Date : November 24 2020, 07:00 PM , By : thatguynz
Combining the UNIQUE and CHECK constraints
Combining the UNIQUE and CHECK constraints
hope this fix your issue Create an indexed view returning a and b with a filter WHERE C = false, then create a unique index on the view. This is a general approach
TAG : sql
Date : November 23 2020, 07:00 PM , By : user3862549
MS SQL Server decimal data type rounds up
MS SQL Server decimal data type rounds up
it helps some times You need to declare it like decimal(18,3) to specify the number of digits after the point.In case you are using stored procedure parameter also should have precision next to decimal
TAG : sql
Date : November 23 2020, 07:00 PM , By : Stackerflows
sp_addlinkedserver on sql server 2005 giving problem
sp_addlinkedserver on sql server 2005 giving problem
I hope this helps . I am able to find the solution. The following 2 lines will solve the problem.
TAG : sql
Date : November 22 2020, 07:01 PM , By : Paulverized
Transitive SQL query on same table
Transitive SQL query on same table
I hope this helps . Hey. consider d following table and data...
TAG : sql
Date : November 22 2020, 07:01 PM , By : jdoe
Strange use of the index in Mysql
Strange use of the index in Mysql
hope this fix your issue The MySQL optimizer makes a lot of decisions that sometimes look strange. In this particular case, I believe that you have a very small table (188 rows total from the looks of the first EXPLAIN), and that is affecting the opt
TAG : sql
Date : November 22 2020, 07:01 PM , By : sscout
Oracle - pl sql selecting from SYS_REFCURSOR
Oracle - pl sql selecting from SYS_REFCURSOR
I hope this helps . A SYS_REFCURSOR won't work for the intended use - you need to create an Oracle TYPE:
TAG : sql
Date : November 21 2020, 07:01 PM , By : user3861961
Broken count(*) after adding LEFT JOIN
Broken count(*) after adding LEFT JOIN
To fix the issue you can do If you wonder about a count, just run the query without a group by. You'll see where the rows in the count come from.In your case, you could probably fix it by changing count(*) to count distinct(n.entry_id).
TAG : sql
Date : November 21 2020, 07:01 PM , By : ncwoehler
Product Catalog Schema design
Product Catalog Schema design
like below fixes the issue I've worked with a similar problem only with legal contracts in a multi-tenant application instead of products. Some attributes are common to all and some are arbitrary attributes meant for tracking. I've said many times th
TAG : sql
Date : November 21 2020, 07:01 PM , By : user3861813
ODBC Connection String Problem
ODBC Connection String Problem
I wish this help you I can recommend connectionstrings.com for details on the supported syntax across all of the supported ADO.NET providers.
TAG : sql
Date : November 20 2020, 07:00 PM , By : user3861617
What's a reasonable number of rows and tables to be able to join in MySQL?
What's a reasonable number of rows and tables to be able to join in MySQL?
With these it helps MySQL is perfectly capable of handling joins involving 5 million rows or even many more than this.Your problem is probably one of two things:
TAG : sql
Date : November 20 2020, 07:00 PM , By : Scotty
CFQuery where param
CFQuery where param
Hope that helps It seems to be a simple sql bug. The field which you would like to compare with your searchstring is missing.Should rather be:
TAG : sql
Date : November 20 2020, 07:00 PM , By : Lendlice
Split a Column in SQL Server
Split a Column in SQL Server
hope this fix your issue Trim spaces from right, then take the date, then trim spaces from left:
TAG : sql
Date : November 19 2020, 07:01 PM , By : Azhar
What does the % symbol do at the end of a string in SQL?
What does the % symbol do at the end of a string in SQL?
I hope this helps you . I am working through the Databricks Spark SQL tutorial and found the bit of code below. , Anything LIKE 'murder%' would include:
TAG : sql
Date : November 19 2020, 07:01 PM , By : Bryan Chu
sql server 2005 express - Invalid Object Name error
sql server 2005 express - Invalid Object Name error
fixed the issue. Will look into that further You may be executing the query in the wrong database. If you are running it manually in SSMS, use the 'use' statement or the 'available databases' drop down list to select the correct db.Or fully qualify t
TAG : sql
Date : November 19 2020, 07:01 PM , By : user3861211
Merge overlapping date intervals
Merge overlapping date intervals
fixed the issue. Will look into that further I was looking for the same solution and came across this post on Combine overlapping datetime to return single overlapping range record.There is another thread on Packing Date Intervals.
TAG : sql
Date : November 19 2020, 07:01 PM , By : andriamparany
Loop Control within a DataflowTask in ETL
Loop Control within a DataflowTask in ETL
help you fix your problem Any OLEDB command transformation (which is used to execute a database command) in an SSIS dataflow is executed once per input row - which I think is the behaviour you want. More details here.In your scenario, the minimum you
TAG : sql
Date : November 19 2020, 07:01 PM , By : Gunasekar
SQL | How to always round up regardless of the last integer value, even when that may be 0
SQL | How to always round up regardless of the last integer value, even when that may be 0
hop of those help? I am currently outputting values out to 6 decimal places, and would like to round up the 6th place regardless of the integer value. , Here is one approach:
TAG : sql
Date : November 18 2020, 07:00 PM , By : Ihor Venher
how to convert any char to - in sql server?
how to convert any char to - in sql server?
help you fix your problem In SQL Server 2017, you can also do it using TRANSLATE like following.
TAG : sql
Date : November 18 2020, 07:00 PM , By : Rex
how to create function in postgres
how to create function in postgres
Does that help As documented in the manual an IF requires a THEN. Additionally, parameters cannot be prefixed with a @. To avoid a name clash between a parameter name and a column name you should use a different name for the parameter. A common appro
TAG : sql
Date : November 17 2020, 07:01 PM , By : muhammad umair
Need to speed up the results of this SQL statement. Any advice?
Need to speed up the results of this SQL statement. Any advice?
help you fix your problem I've got the following SQL Statement that needs some major speed up. The problem is I need to search on two fields, where each of them is calling several sub-selects. Is there a way to join the two fields together so I call
TAG : sql
Date : November 17 2020, 07:01 PM , By : mihiman
How do I retrieve 10 days data up to date 'XYZ' from mysql with Perl when some days data are missing, i.e. public holida
How do I retrieve 10 days data up to date 'XYZ' from mysql with Perl when some days data are missing, i.e. public holida
hop of those help? Data is put into a MYSQL DB in the following format: , If you want a ten-day range of data, use WHERE. As in,
TAG : sql
Date : November 17 2020, 07:01 PM , By : user3860661
How to export data with Oracle SQL Developer?
How to export data with Oracle SQL Developer?
I hope this helps you . In SQL Developer, from the top menu choose Tools > Data Export. This launches the Data Export wizard. It's pretty straightforward from there. There is a tutorial on the OTN site. Find it here.
TAG : sql
Date : November 17 2020, 07:01 PM , By : lprahalad
Aggregate SQL column values by time period
Aggregate SQL column values by time period
should help you out Here's a nice trick. If you cast a SQL DATETIME to a FLOAT it gives you the date as days.fractionofdayTherefore if you floor that, and turn it back to a DATETIME it gives you minight on the given date.
TAG : sql
Date : November 17 2020, 07:01 PM , By : Shweta
Are soft deletes a good idea?
Are soft deletes a good idea?
I wish this help you I say it's a bad idea, generally (with some exceptions, perhaps). First, your database should be backed up regularly, so you should never be in a situation where you would lose data permanently because of a DELETE (unless it's a
TAG : sql
Date : November 17 2020, 07:01 PM , By : Jakub Kamiński
DBCC SHRINKFILE 1 sproc for multiple databases
DBCC SHRINKFILE 1 sproc for multiple databases
To fix this issue Here is the code I use to perform this operation to shrink the logs on the databases beginning with 'MPS_' that are simple recovery. This can be set as an SQL Execution Task maintenance plan and scheduled as appropriate. The current
TAG : sql
Date : November 17 2020, 07:01 PM , By : Abhinand Pl
SQL VBA syntax issue
SQL VBA syntax issue
like below fixes the issue You shouldn't quote the column name - notice there are no quotes in your first example.
TAG : sql
Date : November 16 2020, 07:01 PM , By : Cyrus Javan
How to select a subset of results from a select statement
How to select a subset of results from a select statement
will help you This might not work with every database, but the keyword in can do this:
TAG : sql
Date : November 16 2020, 07:01 PM , By : user3860298
Oracle SQL: ROLLUP not summing correctly
Oracle SQL: ROLLUP not summing correctly
hop of those help? I think it is the DISTINCT. You are getting the total number of DISTINCT values, not the sum of the count of distinct values for each record.
TAG : sql
Date : November 16 2020, 07:01 PM , By : Robindro Laishram
How to select the second row in a table without where clause
How to select the second row in a table without where clause
around this issue There is no "second row" in a table, because tables represent unordered sets. You can have a second row based on some ordering however. So let me assume you have an ordering column.Then, you can use nested queries and top:
TAG : sql
Date : November 15 2020, 07:01 PM , By : Volodymyr S
How to compare the date in SQL
How to compare the date in SQL
To fix the issue you can do You are using a date string and relying on implicit conversion for comparing it with date type. Use DATE literals or TO_DATE function instead.
TAG : sql
Date : November 15 2020, 07:01 PM , By : suyog chaudhari
Sql Server xml column with Entity Framework - how to keep insignificant whitespaces
Sql Server xml column with Entity Framework - how to keep insignificant whitespaces
To fix this issue I found a workaround for the problem. You can set the xml attribute 'xml:space=preserve" at the document level. Both Sql server 2005 and 2008 respect the attribute setting and keep the whitespaces. it was a pleasant surprise. Unfort
TAG : sql
Date : November 15 2020, 07:01 PM , By : Prasad Tharanga
Finding all related tables to a given table
Finding all related tables to a given table
wish helps you If your database supports the information schema views (most do), then you can run this query:
TAG : sql
Date : November 15 2020, 07:01 PM , By : manoj
Two different tables or just one with bool column?
Two different tables or just one with bool column?
To fix this issue Whether the document is valid or invalid, it is still a document so it makes inital sense for them all to be in the same table.However, if an invalid document is treated differently by your application to the point where it is almos
TAG : sql
Date : November 15 2020, 07:01 PM , By : Amit Panghal
Rotating sql table
Rotating sql table
seems to work fine SQL 2005 Introduced a pivot and matching unpivot clause, and this looks like a prime case, if you're unable to fix the underlying schema
TAG : sql
Date : November 15 2020, 07:01 PM , By : ahtshun83
How i can execute function?
How i can execute function?
Hope that helps I don't know if PL/SQL blocks are even allowed there, but if they are you may miss a DECLARE at the beginning.But you don't need PL/SQL to get a value from a function. You can query dual.
TAG : sql
Date : November 14 2020, 07:01 PM , By : Praveen
How to write an error message from an BCP operation to a log file and stop processing the batch file.
How to write an error message from an BCP operation to a log file and stop processing the batch file.
Hope that helps The -m argument specifies max errors. "A row that cannot be copied by the bcp utility is ignored and is counted as one error. If this option is not included, the default is 10."The -e argument specifies the file that the data is store
TAG : sql
Date : November 14 2020, 07:01 PM , By : Rahgozar
Does MySQL have an equivalent of SQL Server "indexed views"?
Does MySQL have an equivalent of SQL Server "indexed views"?
I wish this helpful for you An Indexed View is SQL Server terminology for a materialized view, which MySQL does not support. You can either:
TAG : sql
Date : November 14 2020, 07:01 PM , By : Andreas Siegmund
Can i use MAX function for each tuple in the retrieved data set
Can i use MAX function for each tuple in the retrieved data set
it should still fix some issue My table result contains fields:
TAG : sql
Date : November 14 2020, 07:01 PM , By : lamtoidi
Is there a way to make Identity Specification show up in the table designer next to the Allow Nulls column?
Is there a way to make Identity Specification show up in the table designer next to the Allow Nulls column?
I wish this help you Not exactly what you wanted but you can do it on a database diagram by right clicking the table -> Table View -> Custom and Modifying Custom to include the Identity Specification.
TAG : sql
Date : November 14 2020, 07:01 PM , By : user3859548
How to pass a date in query
How to pass a date in query
will be helpful for those in need You can use EXISTS and a correlated subquery that checks if a row in period exists, where the booking date is between the begin and end date and the status is 1.
TAG : sql
Date : November 13 2020, 07:01 PM , By : Zane Zeltina

shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk