|
Got it!
Correct query:
select * from ao_campaigns where ao_campaigns.id not in (select orders.ao_campaign_id from orders where ao_campaign_id IS NOT NULL);
Some of ao_campaign_id in orders were NULL, which are treated as "unknown" and therefore uncomparable. It is not intuitive in this particular case, though.
Reference: sql null logic - Szukaj w Google[^]
|
|
|
|
|
Or get used to use EXISTS instead of IN .
EXISTS does not use three valued logic.
SELECT *
FROM ao_campaigns
WHERE NOT EXISTS (
SELECT *
FROM orders
WHERE orders.ao_campaign_id = ao_campaigns.id
)
|
|
|
|
|
I am adding up combo boxes to array of combobox and assigning combo boxes to them like this
ComboBox[] arrSize = new ComboBox[5];
arrSize[0] = cbSize_00;
arrSize[1] = cbSize_01;
arrSize[2] = cbSize_02;
arrSize[3] = cbSize_03;
arrSize[4] = cbSize_04;
I would like to know if there is a way to delegate the array as a whole instead of me delegating each combo box manually.
Please help. Thanks in advance.
|
|
|
|
|
You've posted this in the wrong forum - this question has nothing to do with databases.
What do you mean by "delegate the array"?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
If you had posted this in the correct forum - C# Discussion Boards - CodeProject[^] or even Quick Answers - CodeProject[^] then you would have probably had an answer much earlier. Please take more care in future.
You could do it this way
var arrSize = (from object c in Controls where c.GetType() == typeof(ComboBox) select c as ComboBox).ToArray();
|
|
|
|
|
Dear All,
We have below requirement kindly suggest the best solutions.
Requirement :
Extract specific data from the production database and need to load those data to test environment database.
For example, in production database has 100 tables, need to exact 40 tables with specific data ( Don't want to extract all data only few data based on input rule).
Kindly suggest best solution to avoid huge effort.
Thank you in advance.
Best Regards
|
|
|
|
|
Well, it would help to know what database you are using....
Don't you have any kind of database backup in place? Can't you just sue that to populate your test database? But anyway, most databases have admin tools that allow you to export data in one form or another... and failing that, you could always write your own script to create a bunch of SQL INSERT statements....
|
|
|
|
|
Is this MS SQL Server you are referring to? If so you can use the SSMS Wizard to set up a package to export the data - very easy to use and once the package is in place you can tweak it if you need to use it again... We had a similar set up on our Test database (so that we could change it without having to have update permissions on Production)
|
|
|
|
|
We are planning to use datastax cassandra as database for sturctured data. Also we are evaluating the cassandra whether we can use it to store files such as email attachments. while i am able to store the files into cassandra file system (cfs:/// or cfs-archive:///) through linux terminal commands. example: $DSE_HOME/dse hadoop fs -put /home/user/test.txt cfs:///test.txt
I am looking for a RESTful API which allows me to put the files to cassandra file sytem from a remote machine, it can be either linux or windows machine. I am looking for an API which is similar to WebHDFS, which is a RESTful API for hdfs file system. I know that CFS compatabile to HDFS and all APIs of HDFS works for CFS as per datastax'x document Redirect Notice[^]
It would be a great help, if anyone posts a link to CFS API or a working sample application code.
Thanks.
|
|
|
|
|
What is schema, dimention, fact?
|
|
|
|
|
This will explain it much better than I can -> clickety[^].
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Hi All,
I am writing a Dynamic Sql in a while loop which loop through all Tables and then columns in ever table, I have written a general Dynamic sql to read the columns but some tables do not have CreatedBy and ModifiedBy columns and when it is getting executed the Dynamic Sql is failing for some of the scenarios.
Can somebody suggest me how to write that Dynamic Sql to fit for both the scenarios. Any suggestion is helpful thanks in advance.
Here is my Dynamic sql
SET @sql =N'INSERT INTO TrackUpdatedColumnNamesFlatTable (TableName, ColumnName, PrimaryKeyColumnName, PrimaryKeyValue, TransactionId
, TransactionType, CreatedBy, ModifiedBy, CreatedDate, ModifiedDate, IsSoftDelete, IsCmsActive, ColumnValueAfter)
select ''' + @TblName + ''', ''' + @ColName + ''', ''' + @PKColName + '''
, ' + @PKColName + ', $start_lsn , CASE WHEN ($operation=1) THEN ''Delete''
WHEN $operation=2 THEN ''Insert''
WHEN __$operation=4 THEN ''Update''
END TransactionType, CreatedBy, ModifiedBy, CreatedDate, ModifiedDate
, ' + CAST(@IsDeleted AS varchar(max)) + '
, ' + CAST(@IsCmsActive AS varchar(max)) + '
, CASE WHEN __$operation=1 THEN NULL ELSE CAST(' + @ColName + ' AS nvarchar(max)) END<br />
FROM [cdc].' + @cdcinstancename
+ ' WHERE CAST(sys.fn_cdc_map_lsn_to_time($start_lsn) AS DATE)=CAST(''' + @DateToTrack + ''' AS DATE)
AND sys.fn_cdc_is_bit_set(sys.fn_cdc_get_column_ordinal(''' + @captureinstance +
''',''' + '' + @ColName + '''), __$update_mask) = 1
AND __$operation IN (1, 2, 4)';
exec sp_executesql @sql, N'@IsColumnModified int out', @IsColumnModified out
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Query the sys.columns table for @TbleName and add if the CreatedBy, ModifiedBy columns exist on that table add that in to the dynamic SQL
|
|
|
|
|
Hi All.
Firstly.I use Database link from my SQL to Oracle to get Data.In The Oracle the field sta_datetime is date type.
Now I use
convert(varchar(10),sta_datetime,111) as Sdate,
convert(time,sta_datetime) as S_Time,
To get data to Sdate field date type and S_Time field is time(0)type.
Now I show them in the gridview and then get them back when user lick on the row to show on another child gridview.
So many convert time.So it is so difficult to get them back.
|
|
|
|
|
Your question is also confusing. So much so that I'm not sure what your question is!
However, Don't convert date, datetime or time to varchar(anything) ... use the appropriate types. It is only in the final presentation of the data that you need to worry about how it looks
|
|
|
|
|
Original type of field in Oracle Database is date.Now I select this and insert to SQL server.Then show in gridview.
The question is
How to get exactly data from oracle database link?
And How to show exactly data to the user?
|
|
|
|
|
I'm moving my sql server db to oracle. But oracle seems not to support Date Name with date data type.
Looking for solution as changing name from Date to Vdate or bDate requires lot of changes in app code.
|
|
|
|
|
"Date" will probably be a reserved word which is why you get this issue.
Outside of changing the column name,which I strongly recommend doing(calling a column "date" is asking for trouble), which will involve quite a bit of work, the only workaround is to use whatever Oracle uses to delimit column names ([],"" etc)
My experience is that it is best to fix these sorts of issues early i.e. rename the column as the problems you currently experience will be magnified in a few months time when you have more that depends on a column called "date". The amount of work it will take you to fix this issue now will be far less than later.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Guy is spot on on all accounts, Date isn't just a reserved word in Oracle but also by ANSI, you have a list here.
As a delimiter in Oracle you use the ANSI standard "". But also here I agree with Guy, don't do it, it'll save you a lot of trouble later.
|
|
|
|
|
Another benefit of changing the column name will be the opportunity to give it a semantically meaningful name. Just "Date" could be any sort of date anyone might ever think of. Calling it what it actually is (like "CreatedDate", "PurchaseDate", etc.) will make much more sense.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Hello All,
I would like to convert reports in the format .rdlc into format .rdl using Visual Studio 2015.
What I did: I've created a Reporting project(existent under Visual C# templates) where I added two reports. Those reports come with the extension .rdlc. After creating the project I checked its properties and the type of project is windows application. Further I decided to use SQl Server Reporting Services to do my reports. I installed Data Tool preview for Visual Studio 2015 and created a Reporting Services project under Business Intelligence template.
Issue:
The reports I initially created using the Reporting project have the extension .rdlc and the ones created with Reporting Services .rdl. I imported the .rdlc ones into my Reporting Services project. However if I change the extension from .rdlc to .rdl i can design but not preview. When trying to preview, Visual Studios says "an error occurred during local report processing. error in the application. Object reference not set to an instance of an object".
I would not want to loose those two reports as the design took me one day to do.If anyone knows a solution that I could use to import/convert .rdlc reports into .rdl I would appreciate.
|
|
|
|
|
|
jonatan_556 wrote: I would not want to loose those two reports as the design took me one day to do.If anyone knows a solution that I could use to import/convert .rdlc reports into .rdl I would appreciate. This advice may help you - use some form of version control.
You need never find yourself in the position of losing any previous work if you set up the correct protocols for changes and use version control.
My person suggestion is to use GIT[^].
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Hi,
Sorry the delay in answering.
Many thanks on this.
|
|
|
|
|
You're welcome - version control is your friend in these sorts of situations
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|