SQL Question - Interesting One
I need to write a SINGLE SQL statement which has two different
queries, if the first query retrieves records then there is no
need to execute the second one, if the first query doesn't
retrieve the records then I need to make use of second query to
retrieve records.
Is it possible to do in a SINGLE SQL statement? I want to use it
in building a View, i.e, the reason why I am looking for SINGLE
SQL statement
For example,
First Query :- Select Ename from Emp where Deptno=10 and Sal=100;
If this query can retrieve records then I need not execute the
second query
Second Query :- Select Ename from Emp where Deptno=10;
Any help much appreciated?
Thanks,
Venu
John,
My understanding of the requirements is that, if there are rows
where deptno = 10 and sal = 100, then the query should return
only those rows that meet that criteria. However, if there are
no rows where deptno = 10 and sal = 100, then the query should
return all rows where deptno = 10, regardless of the sal.
I included some tests and results below. In the first test, I
used the emp demo table with test data that did not include any
rows where deptno = 10 and sal = 100. I then demonstrated a
query that correctly returned 3 rows where deptno = 10. I then
ran your query which incorrectly resulted in no rows returned.
Then I added a row where deptno = 10 and sal = 100 and re-ran
both queries and they both correctly returned only the 1 row
where deptno = 10 and sal = 100.
In the next test, I created a table similar to your table and
inserted the sample data that you provided, which did not
include any rows where ft_pct = 30. I ran both queries and they
both correctly returned 14 rows where job_no = 'EG01'. Then, I
added a row where ft_pct = 30 and re-ran both queries. My query
correctly returned only the one row where ft_pct = 30. Your
query incorrectly returned 15 rows, which included the original
14 and the one I added, instead of just the one I added.
The manner in which your query performed with your data is what
I expected it to do. However, I don't understand why it seems
to behave differently with the emp demo data. With one table it
produces the wrong results under one condition and with the
other table it produces the wrong results under the other
condition.
Barbara
SQL> -- test using emp demo table:
SQL> -- table structure:
SQL> DESC emp
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SQL> DELETE FROM emp
2 WHERE deptno = 10
3 AND sal = 100
4 /
1 row deleted.
SQL> COMMIT
2 /
Commit complete.
SQL> -- test data without sal = 100:
SQL> SELECT ename, deptno, sal
2 FROM emp
3 /
ENAME DEPTNO SAL
SMITH 20 800
ALLEN 30 1600
WARD 30 1250
JONES 20 2975
MARTIN 30 1250
BLAKE 30 2850
CLARK 10 2450
SCOTT 20 3000
KING 10 5000
TURNER 30 1500
ADAMS 20 1100
JAMES 30 950
FORD 20 3000
MILLER 10 1300
14 rows selected.
SQL> -- query with correct results:
SQL> SELECT ename, deptno, sal
2 FROM emp
3 WHERE deptno = 10
4 AND sal = 100
5 UNION
6 SELECT ename, deptno, sal
7 FROM emp
8 WHERE deptno = 10
9 AND NOT EXISTS
10 (SELECT ename, deptno, sal
11 FROM emp
12 WHERE deptno = 10
13 AND sal = 100)
14 /
ENAME DEPTNO SAL
CLARK 10 2450
KING 10 5000
MILLER 10 1300
SQL> -- QUERY WITH WRONG RESULT:
SQL> -- ???????????????????????
SQL> SELECT ename, deptno, sal
2 FROM emp
3 WHERE (deptno=10 and sal=100)
4 OR deptno=10
5 /
no rows selected
SQL> -- ???????????????????????
SQL> -- ABOVE RESULT IS WRONG
SQL> INSERT INTO emp (empno, ename, deptno, sal)
2 VALUES (9999, 'TEST', 10, 100)
3 /
1 row created.
SQL> COMMIT
2 /
Commit complete.
SQL> -- test data with sal = 100
SQL> SELECT ename, deptno, sal
2 FROM emp
3 /
ENAME DEPTNO SAL
SMITH 20 800
ALLEN 30 1600
WARD 30 1250
JONES 20 2975
MARTIN 30 1250
BLAKE 30 2850
CLARK 10 2450
SCOTT 20 3000
KING 10 5000
TURNER 30 1500
ADAMS 20 1100
JAMES 30 950
FORD 20 3000
MILLER 10 1300
TEST 10 100
15 rows selected.
SQL> -- query with correct results:
SQL> SELECT ename, deptno, sal
2 FROM emp
3 WHERE deptno = 10
4 AND sal = 100
5 UNION
6 SELECT ename, deptno, sal
7 FROM emp
8 WHERE deptno = 10
9 AND NOT EXISTS
10 (SELECT ename, deptno, sal
11 FROM emp
12 WHERE deptno = 10
13 AND sal = 100)
14 /
ENAME DEPTNO SAL
TEST 10 100
SQL> -- query with correct results:
SQL> SELECT ename, deptno, sal
2 FROM emp
3 WHERE (deptno=10 and sal=100)
4 OR deptno=10
5 /
ENAME DEPTNO SAL
TEST 10 100
SQL> -- test using org_t table:
SQL> CREATE TABLE org_t
2 (org_cd VARCHAR2 (5) NOT NULL,
3 job_no VARCHAR2 (4) NOT NULL,
4 ft_pct NUMBER (3) NOT NULL)
5 /
Table created.
SQL> INSERT INTO org_t
2 VALUES ('03538', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('06763', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08026', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08105', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08200', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08232', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08233', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08286', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08909', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('08984', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('09073', 'EG01', 40)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('09723', 'EG01', 1)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('09724', 'EG01', 100)
3 /
1 row created.
SQL> INSERT INTO org_t
2 VALUES ('09752', 'EG01', 1)
3 /
1 row created.
SQL> COMMIT
2 /
Commit complete.
SQL> -- test data without ft_pct = 30:
SQL> SELECT org_cd, job_no, ft_pct
2 FROM org_t
3 /
ORG_C JOB_ FT_PCT
03538 EG01 40
06763 EG01 40
08026 EG01 40
08105 EG01 40
08200 EG01 40
08232 EG01 40
08233 EG01 40
08286 EG01 40
08909 EG01 40
08984 EG01 40
09073 EG01 40
09723 EG01 1
09724 EG01 100
09752 EG01 1
14 rows selected.
SQL> -- query with correct results:
SQL> SELECT org_cd, job_no, ft_pct
2 FROM org_t
3 WHERE job_no = 'EG01'
4 AND ft_pct = 30
5 UNION
6 SELECT org_cd, job_no, ft_pct
7 FROM org_t
8 WHERE job_no = 'EG01'
9 AND NOT EXISTS
10 (SELECT org_cd, job_no, ft_pct
11 FROM org_t
12 WHERE job_no = 'EG01'
13 AND ft_pct = 30)
14 /
ORG_C JOB_ FT_PCT
03538 EG01 40
06763 EG01 40
08026 EG01 40
08105 EG01 40
08200 EG01 40
08232 EG01 40
08233 EG01 40
08286 EG01 40
08909 EG01 40
08984 EG01 40
09073 EG01 40
09723 EG01 1
09724 EG01 100
09752 EG01 1
14 rows selected.
SQL> -- query with correct results:
SQL> SELECT org_cd,job_no,ft_pct
2 FROM org_t
3 WHERE (job_no = 'EG01' and ft_pct = 30)
4 OR job_no = 'EG01'
5 /
ORG_C JOB_ FT_PCT
03538 EG01 40
06763 EG01 40
08026 EG01 40
08105 EG01 40
08200 EG01 40
08232 EG01 40
08233 EG01 40
08286 EG01 40
08909 EG01 40
08984 EG01 40
09073 EG01 40
09723 EG01 1
09724 EG01 100
09752 EG01 1
14 rows selected.
SQL> INSERT INTO org_t
2 VALUES ('99999', 'EG01', 30)
3 /
1 row created.
SQL> COMMIT
2 /
Commit complete.
SQL> -- test with ft_pct = 30:
SQL> -- query with correct results:
SQL> SELECT org_cd, job_no, ft_pct
2 FROM org_t
3 WHERE job_no = 'EG01'
4 AND ft_pct = 30
5 UNION
6 SELECT org_cd, job_no, ft_pct
7 FROM org_t
8 WHERE job_no = 'EG01'
9 AND NOT EXISTS
10 (SELECT org_cd, job_no, ft_pct
11 FROM org_t
12 WHERE job_no = 'EG01'
13 AND ft_pct = 30)
14 /
ORG_C JOB_ FT_PCT
99999 EG01 30
SQL> -- QUERY WITH WRONG RESULT:
SQL> -- ???????????????????????
SQL> SELECT org_cd,job_no,ft_pct
2 FROM org_t
3 WHERE (job_no = 'EG01' and ft_pct = 30)
4 OR job_no = 'EG01'
5 /
ORG_C JOB_ FT_PCT
03538 EG01 40
06763 EG01 40
08026 EG01 40
08105 EG01 40
08200 EG01 40
08232 EG01 40
08233 EG01 40
08286 EG01 40
08909 EG01 40
08984 EG01 40
09073 EG01 40
09723 EG01 1
09724 EG01 100
09752 EG01 1
99999 EG01 30
15 rows selected.
SQL> -- ???????????????????????
SQL> -- ABOVE RESULT IS WRONG
Similar Messages
-
A General FTP Question - Interesting One?
Hi,
We have a domain hosted through a hosting company and can access the ftp in two ways...
ftp.mydomain.co.uk - user/pass
ftp.hostingcompany - user/pass
We have a OS X Server (email) in house and an iMac running PureFTP.
I need to allow a 3rd party ftp access to dump regular info to us so I want the iMac to be our dedicated FTP server (hence Running PureFTP).
We have a Fixed 881.137.215.123 IP address with our ISP.
now in my stupidity I thought of point some A/C NAME records for ftp.mydomain.co.uk to our fixed IP address then forwarding the ports on the router to the iMac.
But then I realised that ftp.mydomain.co.uk is already used for us to access our http hosting.
So this is where my brain over the last few days has overloaded and gone blank.
How would I make the iMac accessable to the oustide world.
Ideally I'm thinking of using our 81.137.215.123 as the ftp.
Maybe I'm wrong but could someone run me through this as my head is hurting and I think I'm now making a mountain out of a molehill.>How would I make the iMac accessable to the oustide world.
Ideally I'm thinking of using our 81.137.215.123 as the ftp.
You can do that. what's the problem?
If your problem is because the name 'ftp.mydomain.co.uk' is already used, you can either change the IP address that ftp.mydomain.co.uk points to, or use a different name. For what difference it makes you can setup 'fred.mydomain.co.uk' to point to your IP address. There's nothing special about the name 'ftp' other than it makes it easy for users to remember. -
Hi, How to move SQL database from one location to another location i.e. from C' drive to D' drive ? please share some link.
Thanks and Regards, Rangnath MaliHi Rangnath,
According to your description, my understanding is that you want to move databased from C drive to D drive.
You can detach Database so that the files become independent, cut and paste the files from source to destination and attach again.
There are two similar posts for your reference:
http://mssqltalks.wordpress.com/2013/02/28/how-to-move-database-files-from-one-drive-to-another-or-from-one-location-to-another-in-sql-server/
http://stackoverflow.com/questions/6584938/move-sql-server-2008-database-files-to-a-new-folder-location
Best Regards,
Wendy
Wendy Li
TechNet Community Support -
SQL Question Bank and Answers for Practise
Dear Readers:
Does any one have any recommendation on SQL question bank and answers where I could practice my SQL.
I have developed some basic knowledge of SQL thanks to the MS community, but I am looking for some additional Questions or textbook recommendations which has questions and answers to queries for practice.
Best Wishes,
SQL75Hi,
Refer below post.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/446b2247-5124-49c1-90c9-b7fea0aa4f83/sql-dba-books?forum=sqlgetstarted
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
Praveen Dsa | MCITP - Database Administrator 2008 |
My Blog | My Page -
Sql question : TRUNCATE vs Delete
hi
this is sql question, i don't know where i should post it, so here it is.
i just want to know the best usage of each. both commands delete records in a table, one deletes all, and the other can do the same plus option to delete specified records. if i just want to purge the table. which one is better and why? thanksthis is crucial to my design, i need to be able to
rollback if one of the process in the transaction
failed, the whole transaction should rollback. if
truncate does not give me this capability, then i have
to consider Delete.From the Oracle manual (sans the pretty formatting):
TRUNCATE
Caution: You cannot roll back a TRUNCATE statement.
Purpose
Use the TRUNCATE statement to remove all rows from a table or cluster. By default,
Oracle also deallocates all space used by the removed rows except that specified by
the MINEXTENTS storage parameter and sets the NEXT storage parameter to the size
of the last extent removed from the segment by the truncation process.
Removing rows with the TRUNCATE statement can be more efficient than dropping
and re-creating a table. Dropping and re-creating a table invalidates the table?s
dependent objects, requires you to regrant object privileges on the table, and
requires you to re-create the table?s indexes, integrity constraints, and triggers and
respecify its storage parameters. Truncating has none of these effects.
See Also:
DELETE on page 16-55 and DROP TABLE on page 17-6 for
information on other ways to drop table data from the database
DROP CLUSTER on page 16-67 for information on dropping
cluster tables
Prerequisites
To truncate a table or cluster, the table or cluster must be in your schema or you
must have DROP ANY TABLE system privilege. -
Sql squery for one to many relationship
I need to write sql for below requirement:
table structure is
serial no LPN
1 4
2 4
3 6
4 6
5 6
6 3
7 3
8 3
9 1
I have to pick distinct 'LPN' like below:
(any serial no can be picked for the distinct LPN)
results needs to be as below:
serial no LPN
1 4
3 6
6 3
9 1
Please suggest with sql.Hi,
915766 wrote:
I need to write sql for below requirement:
table structure is
serial no LPN
1 4
2 4
3 6
4 6
5 6
6 3
7 3
8 3
9 1
I have to pick distinct 'LPN' like below:That sounds like a job for "GROUP BY lpn".
(any serial no can be picked for the distinct LPN)It looks like you're displaying the lowest serial_no for each lpn. That's easy to do, using the aggregate MIN function.
results needs to be as below:
serial no LPN
1 4
3 6
6 3
9 1
Please suggest with sql.Here's one way:
SELECT MIN (serial_no) AS serial_no
, lpn
FROM table_x
GROUP BY lpn
ORDER BY lpn -- if wanted
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002} -
Hi all,
Could anyone tell me if it would be supported to pair a two node enterprise edition front end pool inc mirror sql with a one node enterprise edition front end pool inc single sql?
MUCH THANKS.The answer from TechNet found at http://technet.microsoft.com/en-us/library/jj204697.aspx Is, and I quote:-
Enterprise Edition pools can be paired only with other Enterprise Edition pools. Similarly, Standard Edition pools can be paired only with other Standard Edition pools.
Also, "Neither Topology Builder nor topology validation will prohibit pairing two pools in a way that does not follow
these recommendations. For example, Topology Builder allows you to pair an Enterprise Edition pool with a Standard Edition pool.
However, these types of pairings are not supported."
Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer" -
How do I unlink my Apple ID from another persons I tunes account? I keep getting their security questions and one of my emails can't be used. It keeps telling me I its linked to another account but it shouldn't anymore. Plus my security questions belong to the other person and it has no reset option
depend on the version of itunes and if it's OS X or windows i suppose
in itunes on ny computer in the upper right corner left of the search bar there is a circle with a black siloet and my name beside it
if I click on the v beside it I can a menu with logout as an option -
Add multiple users to a certain database in the SQL server in one go
I wonder if there is any method to add multiple users to a certain database in the SQL server in one go and without using transact code.
I can add a single user to a certain database “Q” for example by right click on the user “U1” for example then properties then in user mapping tab select
the database “Q”, so there should be a method to add multiple users ( U1,U2,U3…) to this database?
Best Regards,
AhmadMany thanks Visakh16,
I can do this using the below script, but what I am searching for is do to this without any scripting.
USE TestDatabase; --Make sure you have the right database
DECLARE @sql VARCHAR(MAX) = '';
SELECT @sql = @sql + 'CREATE USER ' + name + ' FOR LOGIN ' + name + ';
' +
'GRANT CREATE TABLE, CREATE PROCEDURE, CREATE VIEW, VIEW DEFINITION TO ' + name + ';
FROM sys.server_principals p
WHERE p.type in ('S','U') -- SQL Logins and Windows Login. Do not change!
and p.name in ('U1','U2','U3'); -- List of names to add. alter to suit
PRINT @sql; -- Show the statements being executed in the messages pane
EXEC(@sql); -- Run the statements that have been built
Thanks,
Ahmad -
Setting or Resetting a password using SQL in Business One 9.0
In the link shown below, we started a discussion on how to set a password using SQL in Business One. (I am re-opening the discussion in a new thread.)
http://scn.sap.com/thread/3430860
I have been using a similar query to do the same. In the query below, I set the MANAGER password to some value and copy it to all other active users.
update OUSR
set PASSWORD = (select PASSWORD from OUSR where USERID = 1)
where USERID > 1 and GROUPS <> 99 and USER_CODE not like 'B1i%'
This process works just fine in pre-9.0 p09 versions. However, there is something in the new release(s) that is different and being validated so this method no longer works. (I have checked AUSR as the initial control, but this is not the case.)
When using the query above in the current release, logging into users account will generate "Enter valid user name and password". Changing the password manually works just fine. This tells me that there is an additional location where the password is being updated/stored which needs to be included within the script. I am guessing that this location is also where the single-sign-on information might be held, but I am unable to find anything.
I realize that this is not supported. However, when creating a "SANDBOX" database and needing to change 150 users passwords, it is unreasonable that we change these by hand, one-by-one. (And I realize that we should not change those which are using DOMAIN passwords.)
Anyone have any ideas about what else needs to be updated to make this work?
Thanks,
~ terry.Gordon,
That's part of the challenge!...
I would like the SANDBOX database to be useable by anyone wanting to log in, test, and learn.
But, I do not want it to have the same password as the LIVE database. That way we can better secure the LIVE database and the users will have to type in a different password to access the SANDBOX, eliminating the possibility someone processes live data in a test database.... or visa-versa.
Best practices tell me that we need to do our training and testing in a SANDBOX. Occasionally, we need to copy the LIVE database to a SANDBOX to have current data for this functionality. And I am trying to avoid spending 30-60 minutes manually changing over 100 user passwords.
Thanks,
~ terry.
Message was edited by: Terry Oplinger -
Urgent SQL question : how to flip vertical row values to horizontal ?
Hello, Oracle people !
I have an urgent SQL question : (simple for you)
using SELECT statement, how to convert vertical row values to horizontal ?
For example :
(Given result-set)
MANAGER COLUMN1 COLUMN2 COLUMN3
K. Smith ......1
K. Smith ...............1
K. Smith ........................1
(Needed result-set)
MANAGER COLUMN1 COLUMN2 COLUMN3
K. Smith ......1 .......1 .......1
I know you can, just don't remeber how and can't find exactly answer I'm looking for. Probably using some analytic SQL function (CAST OVER, PARTITION BY, etc.)
Please Help !!!
Thanx !
Steve.scott@ORA92> column vice_president format a30
scott@ORA92> SELECT f.VICE_PRESIDENT, A.DAYS_5, B.DAYS_10, C.DAYS_20, D.DAYS_30, E.DAYS_40
2 FROM (select t2.*,
3 row_number () over
4 (partition by vice_president
5 order by days_5, days_10, days_20, days_30, days_40) rn
6 from t2) f,
7 (SELECT T2.*,
8 row_number () over (partition by vice_president order by days_5) RN
9 FROM T2 WHERE DAYS_5 IS NOT NULL) A,
10 (SELECT T2.*,
11 row_number () over (partition by vice_president order by days_10) RN
12 FROM T2 WHERE DAYS_10 IS NOT NULL) B,
13 (SELECT T2.*,
14 row_number () over (partition by vice_president order by days_20) RN
15 FROM T2 WHERE DAYS_20 IS NOT NULL) C,
16 (SELECT T2.*,
17 row_number () over (partition by vice_president order by days_30) RN
18 FROM T2 WHERE DAYS_30 IS NOT NULL) D,
19 (SELECT T2.*,
20 row_number () over (partition by vice_president order by days_40) RN
21 FROM T2 WHERE DAYS_40 IS NOT NULL) E
22 WHERE f.VICE_PRESIDENT = A.VICE_PRESIDENT (+)
23 AND f.VICE_PRESIDENT = B.VICE_PRESIDENT (+)
24 AND f.VICE_PRESIDENT = C.VICE_PRESIDENT (+)
25 AND f.VICE_PRESIDENT = D.VICE_PRESIDENT (+)
26 AND f.VICE_PRESIDENT = E.VICE_PRESIDENT (+)
27 AND f.RN = A.RN (+)
28 AND f.RN = B.RN (+)
29 AND f.RN = C.RN (+)
30 AND f.RN = D.RN (+)
31 AND f.RN = E.RN (+)
32 and (a.days_5 is not null
33 or b.days_10 is not null
34 or c.days_20 is not null
35 or d.days_30 is not null
36 or e.days_40 is not null)
37 /
VICE_PRESIDENT DAYS_5 DAYS_10 DAYS_20 DAYS_30 DAYS_40
Fedele Mark 35473 35209
Fedele Mark 35479 35258
Schultz Christine 35700
South John 35253
Stack Kevin 35701 35604 35402 35115
Stack Kevin 35705 35635 35415 35156
Stack Kevin 35706 35642 35472 35295
Stack Kevin 35707 35666 35477
Stack Kevin 35667 35480
Stack Kevin 35686
Unknown 35817 35698 35596 35363 35006
Unknown 35702 35597 35365 35149
Unknown 35724 35599 35370 35155
Unknown 35600 35413 35344
Unknown 35601 35451 35345
Unknown 35602 35467
Unknown 35603 35468
Unknown 35607 35475
Unknown 35643 35508
Unknown 35644
Unknown 35669
Unknown 35684
Walmsley Brian 35725 35598
23 rows selected. -
Four yes, no type of questions in one slide
What I like to do is to put four true-or-false (yes-or-no) type of questions in one slide if possible.
I achieved this using yes, no widget (I cannot remember where I got it)
But in this widget, I can just choose yes or no without any feedback.
But someone frome the top asked me to add feedback on each question.
Can we achieve this kind of functionality using advance action?
If possible, I would like to make each question appear one at a time.
For example, the first question appear. After users select either yes or no, then
appropriate feedback appear with arrow buttow. If youers click on the arrow button,
the second yes-or-no question will appear etc. I attached a picture to illustrate my point.
What is the best practice to achieve this kind of activity? Any advice would be greatly appreciated.Lieve is right, whether you are deploying it for LMS or not is vital.
Also if you like you can insert 8 transparent buttons for i.e. 2 for each section, under button properties if you like you can set Reporting to -- Include in Quiz, a button would by default have Hint, Success Failure caption, enable the one you like, also you can initiate an action to make rest appear once you click arrow.
This might be a little longer route to achive it, but should work.
Thanks,
Anjaneai -
Multiple Oracle SQL statements in one Add Command
I am creating a report that needs a bunch of processing(SQL DDL statements) before the final select statement is generated for the report.
I am connecting to Oracle database however Crystal Report only allows me to give one SQL statement in one Add Command.
Is there a way to give multiple statements in one "Add Command" for the report ?
Thanks.you can add more than one "Add Command" in the same report, and you can also treat them as views or table, so you can link them to each others and so on
good luck -
Does Java support mutliple sql statements in one call?
statment.executeUpdate("DROP DATABASE IF EXISTS diy55;CREATE DATABASE IF NOT EXISTS diy55 DEFAULT CHARACTER SET utf8;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX,USAGE on diy55.* TO 'diy55'@'localhost' identified by 'diy55';FLUSH PRIVILEGES;");Java seemes doesn't support multiple sql statements in one call, just like PHP mysql_query(), is it?
Then just extend the java.sql.Statement to your own Statement class and write logic which splits the given query at the right places and executes them one by one.
That the mysql_query() already has it built-in wouldn't say that it isn't possible in Java. Comparing with PHP is a bit pointless, it is a completely different language. -
Ultiboard 12 - one question and one error
Hello,
I came back with the same question and one more. First, I installed the demo version NI Design Suite 12 and I want to know, please:
1. I want know if in Ultiboard 12 I can tuning the length of a net as in Altium Designer software:
http://www.altium.com/files/pdfs/Tuning-Net-Lengths-Interactively_EN.pdf
2. I can use "Polygon Splitter" function to cut and polish "Power Plane" ? For example, look in the next image attached below, where I displayed only Copper Top layer.
So...
Attachments:
power plane Ultiboard error.jpg 318 KBThanks Tien_P,
Concerning the second response, I tried to apply the option "Keep out/Keep in area" but every time I applied it and I wanted to cut or crop Power Plane, the option to take due account the default distance between PCB tracks or between the power plane and tracks / pads, and I don't want that (is quite annoying).
So, when I cut the Power Plane with the option "Keep Out / Keep In Area" I wish they did not take into account the distance between the tracks. And how I can remove "Keep On / Keep Out Area" (suppose that after several uses I would like to remove some keep out/keep In area)?
Maybe you are looking for
-
How to sync ical with multiple apple devices and android?
Does anybody have use an android phone in addition to apple devices, and have you figured out how to sync ical with all? (I know there are other calendars that can be used by all, but it means a lot to my husband to stay with ical.)
-
I cannot see all mobile phone numbers in Messages after upgrade to iOS 6
I have two mobile number entries for most of my contacts, for example: +853 1234 5678 0060 853 1234 5678 The first entry is for dialing the mobile number when I am overseas, and need to use the international prefix "+". I also use this for sending SM
-
Using DBCA to duplicate a 10gR2 RAC DB to another box...
Hi All :) Background: ========= I am attempting to use DBCA to create a database based on a template dump (structure and data) from my source system. My source systems is/was RAC enabled and was using a NFS "clustered" file system for shared storage
-
Dev and QA pointing to Same SLD
Hi Experts, We have a situation in our landscape. Just want to confirm if it is right approach or will be face any issue in future. We have DEV and QA box of SAP PI in our landscape. (PRD under construction) 1. The DEV PI and QA PI are installed on t
-
Fans on and off are driving me insane (MacBook Pro 13, Windows 7 x32)
I have had this problem for the past three weeks or so. When I am using Windows, the fan will spend half its time on, half off. It never used to be this way and I am not sure what could have pushed it over the edge - I have not installed any new prog