I'm calling a stored function like this:
select XML_INVOICE.GENERATE_XML_DOC('84200006823') from dual;
The query results then show up in a table underneath, which I can right click and select "Export Data" -> XML
<?xml version='1.0' encoding='UTF8' ?>
<RESULTS>
<ROW>
<COLUMN NAME="XML_INVOICE.GENERATE_XML_DOC('84200006823')" <...
When writing views and nesting views within deeper views I sometimes miss something and end up losing rows/data. How can I check that columns from two different tables have an exact match of data?
Example:
select count(distinct table1.col1)
from table1
where table1.col1 not in (select distinct table2.col1
...
How to query data from table_1 which ID is not available on table_2 that has duplicate ID's. See example below.
I want to get ID 5 and 6 of Table 1 from Table 2
Table 1
-------------
| ID | Name |
| 1 | a |
| 2 | b |
| 3 | c |
| 4 | d |
| 5 | e |
| 6 | f |
-------------
Table 2
-------------
Table 1 ID |
| 1 ...
Hi,
I'm using pyodbc to talk to a legacy Access 2000 .mdb file.
I've got a cursor, and am trying to execute this:
c.execute("INSERT INTO [Accounts] ([Name], [TypeID], [StatusID], [AccountCat], [id]) VALUES (?, ?, ?, ?, ?)", [u'test', 20, 10, 4, 2])
However, doing so results in
pyodbc.Error: ('HYC00', '[HYC00] [Microsoft][ODBC Mic...
Hello!
I have articles on my site, and I would like to add tags which would describe each article, but I'm having problems with design mysql table for tags. I have two ideas:
1) each article would have field "tags", and tags would be in format: "tag1,tag2,tag3"
2) create other table called tags with fields: tag_name, article_id, so when...
I am working on a database join and I want to do the following:
Select tabel_one.id,
tabel_one.title,
tabel_one.content,
table_two.value as table_two.key
from tabel_one
Join table_two ON table_two.id = table_one.id ....
The Important part is:
table_two.value as table_two.key
Is there a way this could w...
I am writing a script to update a database to add Filestream capability. The script needs to be able to be run multiple times without erroring. This is what I currently have
IF ((select count(*) from sys.columns a
inner join sys.objects b on a.object_id = b.object_id
inner join sys.default_constraints c on c.parent_obje...
I think we may have trouble with our existing project. For some reasons we have to switch from SQL Server to Sybase SQL Anywhere 11. now we trying to find a way continue use our existing LINQ code.
We wish we can still use L2S? If cannot, we wish we can use L2E, then we have to change to ADO.
how to generate dbml file from Sybase Anyw...
I'm curious if following code would be considered safe?
using (SqlConnection cn = new SqlClient.SqlConnection(connectionString))
{
cn.Open();
using (SqlTransaction tr = cn.BeginTransaction())
{
try
{
if (!Data.DoSomething1(tr, p1, p2))
{
tr.Rollback();
return false;
...
I want to use the SqlExpress2008 Bootstrapper for a new installation on Windows7, I do not want to use the default SQLEXPRESS Instance.
I have attempted to edit the package.xml file located in:
C:\Program Files\Microsoft
SDKs\Windows\v7.0A\Bootstrapper\Packages\SqlExpress2008\en\package.xml
and updated the command argument instan...
Oftentimes I want to query my MySQL data directly without a server running or without having access to the server (but having read / write rights to the files).
Is there a tool or maybe even a library around to query MySQL data files like it is possible with SQLite? I'm specifically looking for InnoDB and MyISAM support. Performance is ...
Part-time reluctant DBA here. I want to change an existing primary key index from clustered to non-clustered. And the syntax is escaping me.
This is how it's scripted out right now.
ALTER TABLE [dbo].[Config] WITH NOCHECK ADD
CONSTRAINT [PK_Config] PRIMARY KEY CLUSTERED
(
[ConfigID]
) ON [PRIMARY]
I am not...
This is a follow up issue relating to the answer for http://stackoverflow.com/questions/2445029/sql-placeholder-in-where-in-issue-inserted-strings-fail
Quick background: We have a SQL query that uses a placeholder value to accept a string, which represents a unique tag/id. Usually, this is only a single tag, but we needed the ability to...
Hello,
I have a User which can have many Emails. This is mapped through a List collection (exposed by IEnumerable Emails on the User).
For each User one of the Emails will be the Primary one ("Boolean IsPrimary" property on Email).
How can I get the primary Email from User without NHibernate loads every email for the User ?
I have the...
I'm using the ancestry gem to help organise my app's tree structure in the database. It basically writes a childs ancestor information to a special column called 'ancestry'. The ancestry column for a particular child might look like '1/34/87' where the parent of this child is 87, and then 87's parent is 34 and 34's is 1.
It seems possib...
I have two types of users for my system, normal human users with a username / password, and delegation authorized accounts through OAuth (i.e. using a token identifier). The information that is stored for each is quite different, and are managed by different subsytems. They do however interact with the same tables / data within the syste...
I have created this trigger which should give a error, whenever the value of new rctmemenrolno of table-receipts1 is matched with the memenrolno of table- memmast, but it is giving error in both condition(it is matched or not matched).
kindly help me.
CREATE OR REPLACE TRIGGER HDD_CABLE.trg_rctenrolno
before insert ON HDD_CABLE.RECEIPTS...
Hi all, i have a couple of sql views with composite primary keys that i want to query, and since Hibernate makes it a pain to work with composite keyes, im using createSQLQuery. The problem is that this method can only return a List, and i need to refer to the colums by their index.
Any chance i could do like jdbc and refer to the col...
Hi everybody!
I'm junior rails programmer. I have some optimization questions about eager loading and Models at all.
So I have such relationships:
Program --< Subprograms --< Events --< Financings
\--<Events --< Financings
Program and subprogram is self-referrental sti models. I need to have a bunch of virtual fields in event...
Hi,
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?
For example: For a SQL login if you try to login using wrong Password more than 3 or 4 attempts, then that account gets locked out. User cannot login to SQL Server using this username. I wan...