Help required in connecting sql devloper to db 11g
any please tell me how to connect to the database 11g using SQL developer
What r the configuration settings to be used
For a basic connection (using the jdbc thin driver) you need to specify the hostname of the database server, the database serveice name and the port number (probably 1521). You also need to provide a username and password.
Similar Messages
-
Help required in developing SQL developer extension
Hi,
We have a requirement to develop an extension for Sql Developer. The requirement matches the Reports framework in Sql Developer.
We need to have a separate dock as in reports where we can navigate through the tree and execute some predefined queries.
I implemented this using the Docking Sample of Sql Developer extensions. I am able to show a separate dock with the tree hieararchy of the nodes and adding context menus to the nodes.
But , the problem is how do we integrate this UI with the queries and how do we prompt the user to select the connections and other bind variables.
We can do this by using an XML file and importing it in the reports. But, we need a separate dock for our functionality.
I tried modifying the reports API by obtaining the code from the oracle.sqldeveloper.report.jar . But , facing problems while compiling the modified code to a jar.
Any help in this regard is appreciated.
Edited by: 883431 on Sep 8, 2011 12:32 AMSorry for that,
Here is what I did,
Create a variable for posting period
Put posting period in column.
Create 2 selections for the KF.
Restrict 1st sel from Jan Variable-1
Restrict 2nd sel from Variable Dec -
Urgent Help Required for Connect Four Game
Hi all,
I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
Sorry there is so much code.
This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
Interface code..............
interface Player {
void init (Boolean color);
String name ();
int move ();
void inform (int i);
Player1 class......................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player1 implements Player
public Player1()
public int move()
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player1;
System.out.println ("What is your Number, player 1?");
player1 = scan.nextInt();
System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
System.out.println();
return player1;
//Player.move();
//return player1;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "Koonda";
}//end player1 class
Player2 class...........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player2 implements Player
public int move()
//int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
// cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
//int num1, num2;
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player2;
System.out.println ("What is your Number, player 2?");
player2 = scan.nextInt();
System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
System.out.println();
//return player1;
return player2;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "malook";
}//end player1 class
PlayGame class which contains all the functionality.........................................................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class PlayGame
//Player player1;
//Player player2;
int [][]ConnectFourArray;
boolean status;
int winner;
int player1;
int player2;
public PlayGame()
//this.player1 = player1;
//this.player2 = player2;
public void StartGame()
try{
// int X = 0, Y = 0;
//int value;
int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
int[][] ConnectFourArray = new int[6][7];
int num1, num2;
for(int limit=21;limit!=0;limit--)
BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
String column1;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=1;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=1;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=1;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=1;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=1;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=1;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=1;
cup6=cup6-1;
System.out.println();
BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
String column2;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=2;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=2;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=2;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=2;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=2;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=2;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=2;
cup6=cup6-1;
System.out.println();
System.out.println();
catch (Exception E){
System.out.println("Error with input");
System.out.println("Would you like to play again");
try{
String value;
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
// Scanner scan = new Scanner(System.in);
System.out.println("Enter yes to play or no to quit");
// value = scan.nextLine();
// String value2;
value = reader.readLine();
//value2 = reader.readLine();
if (value.equals("yes"))
System.out.println("Start again");
StartGame(); // calling the StartGame method to play a game once more
else if (value.equals("no"))
System.out.println("No more games to play");
// System.exit(0);
else
System.exit(0);
System.out.println();
catch (Exception e){
System.out.println("Error with input");
finally
System.out.println(" playing done");
//StartGame();
//check for horizontal win
public int hasWon()
int status = 0;
for (int row=0; row<6; row++)
for (int col=0; col<4; col++)
if (ConnectFourArray[col][row] != 0 &&
ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
//status = true;//int winner;
if(status == player1)
System.out.println("Player 1 is the winner");
else if(status == player2)
System.out.println("Player 2 is the winner" );
}//end inner for loop
}// end outer for loop
} // end method Winner
return status;
}//end class
ClassConnectFour which designs the board........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class ClassConnectFour
//Player player1;
//Player player2;
public ClassConnectFour()
//this.player1 = player1;
public void DrawBoard()
int[][] ConnectFourArray = new int[6][7] ;
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
}//end class
TestConnetFour class which uses most of the above class..................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class TestConnectFour
public static void main(String[] args)
ClassConnectFour cf = new ClassConnectFour();
cf.DrawBoard();
Player1 player1 = new Player1();
Player2 player2 = new Player2();
player1.move();
player2.move();
System.out.println("Number 1 belongs to player " + player1.name());
System.out.println("Number 2 belongs to player " + player2.name());
PlayGame pg = new PlayGame();
pg.StartGame();
pg.hasWon();
//pg.Play();
//System.out.println(player.name());
//System.out.println(player2.name());
}// end main
}//end class
I am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
Thanks in advance.
Koonda
//Hi,
Thanks for your help but I really don't understand the table lookup algorithm. Could you please send me some code to implement that.
I will send you the formatted code as well
Thanks for your help.
looking forward to your reply.
Koonda
Hi all,
I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
Sorry there is so much code.
This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
Interface code..............
interface Player {
void init (Boolean color);
String name ();
int move ();
void inform (int i);
Player1 class......................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player1 implements Player
public Player1()
public int move()
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player1;
System.out.println ("What is your Number, player 1?");
player1 = scan.nextInt();
System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
System.out.println();
return player1;
//Player.move();
//return player1;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "Koonda";
}//end player1 class
Player2 class...........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player2 implements Player
public int move()
//int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
// cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
//int num1, num2;
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player2;
System.out.println ("What is your Number, player 2?");
player2 = scan.nextInt();
System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
System.out.println();
//return player1;
return player2;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "malook";
}//end player1 class
PlayGame class which contains all the functionality.........................................................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class PlayGame
//Player player1;
//Player player2;
int [][]ConnectFourArray;
boolean status;
int winner;
int player1;
int player2;
public PlayGame()
//this.player1 = player1;
//this.player2 = player2;
public void StartGame()
try{
// int X = 0, Y = 0;
//int value;
int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
int[][] ConnectFourArray = new int[6][7];
int num1, num2;
for(int limit=21;limit!=0;limit--)
BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
String column1;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=1;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=1;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=1;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=1;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=1;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=1;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=1;
cup6=cup6-1;
System.out.println();
BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
String column2;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=2;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=2;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=2;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=2;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=2;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=2;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=2;
cup6=cup6-1;
System.out.println();
System.out.println();
catch (Exception E){
System.out.println("Error with input");
System.out.println("Would you like to play again");
try{
String value;
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
// Scanner scan = new Scanner(System.in);
System.out.println("Enter yes to play or no to quit");
// value = scan.nextLine();
// String value2;
value = reader.readLine();
//value2 = reader.readLine();
if (value.equals("yes"))
System.out.println("Start again");
StartGame(); // calling the StartGame method to play a game once more
else if (value.equals("no"))
System.out.println("No more games to play");
// System.exit(0);
else
System.exit(0);
System.out.println();
catch (Exception e){
System.out.println("Error with input");
finally
System.out.println(" playing done");
//StartGame();
//check for horizontal win
public int hasWon()
int status = 0;
for (int row=0; row<6; row++)
for (int col=0; col<4; col++)
if (ConnectFourArray[col][row] != 0 &&
ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
//status = true;//int winner;
if(status == player1)
System.out.println("Player 1 is the winner");
else if(status == player2)
System.out.println("Player 2 is the winner" );
}//end inner for loop
}// end outer for loop
} // end method Winner
return status;
}//end class
ClassConnectFour which designs the board........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class ClassConnectFour
//Player player1;
//Player player2;
public ClassConnectFour()
//this.player1 = player1;
public void DrawBoard()
int[][] ConnectFourArray = new int[6][7] ;
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
}//end class
TestConnetFour class which uses most of the above class..................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class TestConnectFour
public static void main(String[] args)
ClassConnectFour cf = new ClassConnectFour();
cf.DrawBoard();
Player1 player1 = new Player1();
Player2 player2 = new Player2();
player1.move();
player2.move();
System.out.println("Number 1 belongs to player " + player1.name());
System.out.println("Number 2 belongs to player " + player2.name());
PlayGame pg = new PlayGame();
pg.StartGame();
pg.hasWon();
//pg.Play();
//System.out.println(player.name());
//System.out.println(player2.name());
}// end main
}//end classI am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
Thanks in advance.
Koonda -
Help required in connecting to Implicit SSL FTP server
Hi,
I am working on a scenario of File to Idoc.
Here the File server (FTP server) is using the Implicit SSL protocol which is not supported by PI.
Hence, we thought of using the scripts for this.
Using Script we will move the file from the FTP server to the PI directory & then using NFS protocol in channel, PI will read the file.
Here my query is, is it possible to go for such a design in case of Implicit SSL?
If yes, please let me know how it can be achieved.
I am referring the below blog of writing the scripts in case of SSH protocol:
/people/daniel.graversen/blog/2008/12/11/sftp-with-pi-the-openssh-way
Please let me know if any such blog/material is available for Implicit SSL protocol as well.
Your help is highly appreciated.
-Supriya.have you tried calling from ABAP ?
Connect FTP Server through R/3
There is something called SAP cryptographic kit which you need to install ,please check this link I am not sure
File has to pass through FTPS connection.. Connection parameters?
Port for Implicit SSL is 990
regards
Ninad -
i am new to sql and have to write following program
my tables r
department
dept_id location
1 London
2 New York
3 Singapore
4 Tokyo
employee
emp_id dept_id salary tier_id
1 2 20000 4
2 4 200000 1
3 3 25000 4
4 1 60000 2
5 1 30000 3
tier
tier_id tier_name
1 Director
2 Manager
3 Analyst
4 Intern
I need to write
1.the DDL to create the following three tables and the DML to insert the data into the table. Create a sequence for the ID field on all three tables and use the sequence in the DML. The DDL to create the tables should include the logical referential integrity.
2.the PL/SQL to create two stored procedures in a package. The first procedure will take in an department ID and will return both the current timestamp and a list of the different distinct tiers belonging to that department ID. These will be returned as two separate parameters.
3.The second stored procedure will take in a tier ID and provide back the second highest salary for that tier.
4. the syntax to add a modified_time field to all three tables as a timestamp, and populate this field with the current timestamp.
4.the syntax to drop all three tables, sequences and the package as commented out in the script.
Plz helpuser10502390 wrote:
atleast help in writing stored procedure as i have no idea abt ithttp://www.oracle.com/pls/db112/homepage
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10766/toc.htm
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10766/tdddg_subprograms.htm#CIHDFDJG
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10766/tdddg_subprograms.htm#BABDHFAC
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/toc.htm -
Help required to build SQL loader control file
I have a table, That we need to load using SQL loader.
table structure is --
<emp_id>,<first_name>,<middle_name>,<last_name>,<sal>
The structure of flat file is like below,
<emp_id>|<emp_name>|<sal>
<emp_name> field can contain space to define first name, middle name and last name,
if no space is there means we only need to load first name. and one space means First and last name should load.
Sample flat file--
1001|Ram|10000
1002|Syam Kumar Sharma|20000
1003|Jadu Prashad|15000
Please help me out to build the control file.
Thanks in AdvanceMeans, can use DBMS_SCHEDULER for loading data ?Yes, you can create procedures for that and let the scheduler execute them on the desired interval
(you can even execute OS commands through DBMS_SCHEDULER).
Read about it here:
http://www.oracle.com/pls/db102/search?word=DBMS_SCHEDULER&partno=
http://www.oracle-base.com/articles/10g/Scheduler10g.php
By the way, instead of using sqlloader why not switch to using external tables?
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6611962171229
http://www.oracle-base.com/articles/9i/SQLNewFeatures9i.php#ExternalTables
A few other approaches (pre 10g)
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2048340300346698595
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3084681089099 -
Query Help required to Connect JDT1 with OINV tables
Dear Experts,
I have the following query which gives me the customer ageing report. I want some addtional fields from the OINV table and the document numbering table like Document Series Name, AR Invoice document Number,AR invoice remarks, BP Projects Number ( filled in accounting tab in BP projects) and in the query in Reference 1 column its giving the Invoice Numbers as posted in the Journal but for manual Journal Entries it not giving the Journal Number which I also want to be shown in Ref 1 or a seperat field.
The Query is as under :
select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',
case JDT1.transtype
when '13' then 'INV'
when '14' then 'AR CN'
when '24' then 'INCOMING'
else 'Other'
end 'Type',
Ref1,
fccurrency 'BP Currency',
CONVERT(VARCHAR(10), refdate, 103)'Posting Date' ,
CONVERT(VARCHAR(10), duedate, 103) 'Due Date',
CONVERT(VARCHAR(10), taxdate, 103) 'Doc Date' ,
CASE
when (DATEDIFF(dd,refdate,current_timestamp))+1 < 31
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "0-30 days",
case when ((datediff(dd,refdate,current_timestamp))+1 > 30
and (datediff(dd,refdate,current_timestamp))+1< 61)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "31 to 60 days",
case when ((datediff(dd,refdate,current_timestamp))+1 > 60
and (datediff(dd,refdate,current_timestamp))+1< 91)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "61 to 90 days",
CASE
when (DATEDIFF(dd,refdate,current_timestamp))+1 > 90
then
case
when syscred= 0 then sysdeb
when sysdeb= 0 then syscred * - 1
end
end "90 + days"
from JDT1,OCRD where JDT1.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
ORDER BY OCRD.CARDCODE, taxdate
Would appreciate if you can help me to get a solution in it.
Regards,
KamleshDear Gordon,
While executing the followings modified query it giving an error of
Incorrect Syntax near the keyword 'to' and incorrect Syntax near 'Series'
the query is as under :
{select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',
case l.transtype
when '13' then 'INV'
when '14' then 'AR CN'
when '24' then 'INCOMING'
else 'Other'
end 'Type',
j.BaseRef'Trans #',
case l.transtype
when '13' then
(Select Comments from OINV where OINV.Transid=j.Transid)
else '-'
end 'Inv.Rem.',
(Select SeriesName From NNM1 Where Series=j.DocSeries and ObjectCode=l.TransType)'Series',
to
(Select Isnull(SeriesName, 'Manual') From NNM1 Where Series=j.DocSeries and ObjectCode=l.TransType)'Series',
l.Ref1,
fccurrency 'BP Currency',
CONVERT(VARCHAR(10), l.refdate, 103)'Posting Date' ,
CONVERT(VARCHAR(10), l.duedate, 103) 'Due Date',
CONVERT(VARCHAR(10), l.taxdate, 103) 'Doc Date' ,
CASE
when (DATEDIFF(dd,l.refdate,current_timestamp))+1 < 31
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "0-30 days",
case when ((datediff(dd,l.refdate,current_timestamp))+1 > 30
and (datediff(dd,l.refdate,current_timestamp))+1< 61)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "31 to 60 days",
case when ((datediff(dd,l.refdate,current_timestamp))+1 > 60
and (datediff(dd,l.refdate,current_timestamp))+1< 91)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "61 to 90 days",
CASE
when (DATEDIFF(dd,l.refdate,current_timestamp))+1 > 90
then
case
when syscred= 0 then sysdeb
when sysdeb= 0 then syscred * - 1
end
end "90 + days"
from JDT1 l
Inner Join OJDT j On j.TransId=l.TransId
,OCRD where l.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
ORDER BY OCRD.CARDCODE, l.taxdate}
Regards,
Kamlesh -
Hi Guys,
I am looking for some help to frame the update query.
I have two tables temp_1 and temp_2.
I want to update temp_2 based on data from temp_1. However i do not want to make an update where temp_1 has null value.
One approach i can think of is creating two different update statements but is there any chance to get it done through
only one statement. Also i would like to add here that temP_1 has 250K data and i going to make update on approx 500K
rows from temp_2. So i need to look from performance point of view as well.
Temp_1 temp_2
Col1 Col2 Col3 col1 col2 col3
1 abc abc 1 null null
2 abc null 2 xyz xyz
3 null null 3 xyz null
After update i am looking forward to get data in below format.
temp_2
col1 col2 col3
1 abc abc
2 abc xyz
3 xyz nullUSE TESTdb
go
create table express (col1 int, col2 varchar(25), col3 varchar(25))
go
create table express2 (col1 int, col2 varchar(25), col3 varchar(25))
go
insert into express values (1,'abc','abc'),(2,'abc',null),(3,null,null)
insert into express2 values (1,null,null),(2,'xyz','xyz'),(3,'xyz',null)
select * from express
select * from express2
update express2
set col2= case when x.col2 is null and e.col2 is not null then e.col2
else x.col2
end ,
col3= case when x.col3 is null and e.col3 is not null then e.col3
else x.col3
end
from express e inner join express2 x on e.col1=x.col1
--drop table express, express2
ebro -
Help Required with PL/SQL loading logic
Hi All,
We have a simple pl/sql code which does loading(insertions) of records into the table. This pl/sql code actually refers to an translation website URL(microsoft based) and inserts the translated text into our table. What happens is sometimes this URL gets blocked out due to some issue. So we are forced to restart our entire operation of loading once again. Actually we have a commit at the end(outside the loop). on the other hand we cant keep commit inside the loop as it may pose an overhead to performance since its commiting once every insert happens.
What we are expecting is something like this. Say we have 10,000 records. the loading fails at 5500 record. next time when we start again we want to start from 5501 record and NOT from beginning. In informatica kind of ETL tools we have an option to do this. However not sure if we can do this through PL/SQL.
we thought of keeping counter variable and keep it incrementing for each and every insert happens. but before doing this we have to order by our table according to primary key. This is taking huge amount of time since the table is very big.
can you please tell any alternative to this?
Regards,
PaulIf I understand correctly, you are doing something as follows:
// process a defined data set
for c in (select .. some data... )
loop
// translate the data (via a web service call)
Translate( c, translatedOutput )
// insert the translated data
insert into some_table translatedOutput
end loop
commitIn principle, nothing wrong with this approach. And yes, committing inside the loop for every x number of rows will increase the complexity of code and could perhaps violate ANSI SQL standards of fetching across commits.
A better approach would be to consider parallelising this process. Run multiple copies of that code - but provide each copy of the code with a small and unique data set to process. So instead of doing 10,000 rows in serial, you schedule a 100 jobs and give each a unique set of a 100 rows to translate.
Let's say your job queue size is set to 20. This means up to 20 of these processes will run in parallel. Should one fail, the job manager will automatically reschedule it for execution (up to 16 times after which it will be marked as broken).
So not only does this type of approach enables you spread the processing load, it also enables you to scale your processing (you can handle much larger data volumes like this, and more powerful server h/w will enable you to use more parallel processes). In addition, restart is automated courtesy of the Oracle job manager.
Compare this type approach with committing inside a loop.. The latter buys you what ito flexibility and performance and scalability? Nothing really - it only makes the process a lot more complex as it needs to be able to correctly restart after a failure. You will not be able to process bigger volumes of data. You will not be able to increase existing performance.
One needs to carefully consider the approach used to processing data - serialisation is inherently limited. Restarting serialised processes is difficult and complex. -
Connecting SQL server from Oracle 11g
Hello,
I know there are several threads available to this post but please help me in
*step by step process to follow in connecting 2 servers.
I tried everything in internet but got Connection closed error after tnsping of DNS name. Do i need to run any instance sort of thing in SQL server?
I dont have any access on SQL server.Whatever i have to do that has to be only in Oracle server.I got all those information and created ODBC (using SQL server driver) and tested the connection successfully in Oracle server. Altered INIT*.ORA,TNSNAMES.ORA and LISTENER.ORA but when pinging TNS awfully getting the afore said error.
My environment : Oracle 11g server - SQL server 2008 ( both in windows platform).
My
TNS names entry
GSIS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.1)(PORT = 63455))
(CONNECT_DATA = (SID=GSIS)
(SERVER = DEDICATED)
(HS=OK)
Listener entry
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = COB417147.cob.apac.bosch.com)(PORT = 1522))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\bin\oraclr11.dll")
(SID_DESC =
(SID_NAME = GSIS)
(ORACLE_HOME = C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1)
(PROGRAM = hsodbc)
and
initGSIS
entry
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
# HS init parameters
HS_FDS_CONNECT_INFO = GSIS
HS_FDS_TRACE_LEVEL = OFF
# Environment variables required for the non-Oracle system
#set
when tnsping i am getting
TNS connection closed.
I am awfully stuck here.
Please guide..Status
C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\BIN>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 11-MAY-2012 17:48
:14
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 11-MAY-2012 17:36:30
Uptime 0 days 0 hr. 11 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\network\
admin\listener.ora
Listener Log File c:\oracle\app\amk1cob\diag\tnslsnr\COB417147\listener\
alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1522ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=COB417147.cob.apac.bosch.com)(PORT=1
522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=COB417147.cob.apac.bosch.com)(PORT=8
080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "GSIS" has 1 instance(s).
Instance "GSIS", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl.cob.apac.bosch.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.cob.apac.bosch.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
TNS ping
C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\BIN>tnsping GSIS
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 11-MAY-2
012 18:21:55
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.
1.1)(PORT = 63455)) (CONNECT_DATA = (SID=GSIS)) (HS=OK))
TNS-12537: TNS:connection closed
C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\BIN>
BTW it is 32-bit machine.
Edited by: 933729 on May 11, 2012 5:57 AM -
How to connect Sql Developer with Oracle 11g Xe
Hi all.
I am new in the mac os x world and i want to now if it`s possible to connect the sql developer (running at mac os) with oracle xe (running at windows 8 at parallels vm).
Thank u all.Perhaps the Building ASP.NET Web Applications with Oracle Developer Tools for Visual Studio from the Oracle By Example series will be enough to get you going.
-
Help required with (soundcard) connection / settings, thanks in advan
Help required with connection / settings between a Creative Sound Blaster Audigy Platinum EX (soundcard) and a Creative DTT3500 Digital (5. speakers).
The problem
No sound from any of the speakers. (Exception can plug in headphones at front)
Background
My computer has been recently upgraded at my local computer shop and all programs re-installed (including driver update from Creative's website). However after reconnecting speakers and restoring the original settings I?m getting no sound from any of the speakers. I?ve followed all the available advice/instructions I can find on this website and manuals to no avail.
Set-up
Physical
(Digital DIN) Speakers/decoder amplifier (DTT3500) connected to the (digital out) soundcard (Audigy Platinum EX) using minijack to DIN cable. (As per instruction manual)
Software
Creative Audio Consul ? setting as per instructions, however have tried variations in vain. (Note: above tabs there is a select device box with SB Audigy [A0000] in it ? only option. Just wondering what [A0000] means?)
Your advice please. A simple step by step guide would be appreciated, many thanks in advance, Jon"My computer has been recently upgraded at my local computer shop and all programs re-installed (including driver update from Creative's website). "
Do you have the original installation disk?
If so, try installing THOSE drivers, ESPECIALLY if it worked before. Be sure to uninstall what is there now, first.
Its natural for most people to want the 'latest' drivers for their hardware. However:
After experiencing some difficulties with some CL 'updates' for certain products, I now avoid them UNLESS I am having a PROBLEM with the existing drivers. -
How to connect SQL SHAPED Child RecordSet to A VB6 Embeded Sub Report?
Please Help me in connect SQL SHAPED Child RecordSet to A VB6 Embeded Sub Report.
Here is the Code I am currently Using in VB6 SP6.
I want to Connect to "Command1" Child Recordset with "item" Sub Report.Please Help Me.
Option Explicit
' The ADO connection to the local database.
Public oConn As ADODB.Connection
Public ocmd1 As ADODB.Command
Public ocmd2 As ADODB.Command
Public ocmd3 As ADODB.Command
Dim rs As ADODB.Recordset
Dim rs_sb1 As ADODB.Recordset
Dim rs_sb2 As ADODB.Recordset
Public invoice_report As New CrystalReport1
Public itemsub_report As Report
Public servicesub_report As Report
Public sConnectString As String
Public strSQL As String
Dim ADOrs As ADODB.Recordset
Private Sub Form_Load()
minvno = 3
'msubtype_id = 16
'Create ADO Connection object
Set oConn = New ADODB.Connection
sConnectString = "Provider = MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\stocks\business.mdb;" & "Persist Security Info=False;" & "User ID=Admin;" & "Jet OLEDB:Database Password=apple14;"
oConn.Open sConnectString
'Create ADO Command object
Set ocmd1 = New ADODB.Command
Set ocmd1.ActiveConnection = oConn
ocmd1.CommandText = " SHAPE {SELECT invoices_customer., contacts., invoice_subtypes.* FROM invoices_customer, contacts, invoice_subtypes WHERE invoices_customer.contact_id = contacts.contact_id AND invoices_customer.subtype_id = invoice_subtypes.subtype_id AND invoices_customer.inv_no = " & minvno & " AND invoices_customer.type = 'service'} AS invoice_customer APPEND ({SELECT * FROM `item_customer`} AS Command1 RELATE 'inv_no' TO 'inv_no','invoices_customer.subtype_id' TO 'subtype_id') AS Command1,({SELECT * FROM `service_customer`} AS Command2 RELATE 'inv_no' TO 'inv_no','invoices_customer.subtype_id' TO 'subtype_id') AS Command2"
ocmd1.CommandType = adCmdText
Set rs = New ADODB.Recordset ' Recordset for the main report
Set rs = ocmd1.Execute
Dim crs As ADODB.Recordset
Set crs = rs.Fields("Command1").Value
'Set crs = rs!command1.Value
Me.Caption = crs.RecordCount
' Add the datasource to the report
invoice_report.Database.AddADOCommand oConn, ocmd1
' Connect the recordset to the main report
invoice_report.DiscardSavedData
invoice_report.Database.SetDataSource rs, 3, 1
invoice_report.AutoSetUnboundFieldSource crBMTName
If rs.RecordCount > 0 Then
With invoice_report
.Field1.SetUnboundFieldSource ("{ADO.date}")
If rs("post") = "None" Then
.Field2.SetUnboundFieldSource ""
Else
.Field2.SetUnboundFieldSource ("{ADO.post}")
End If
.Field4.SetUnboundFieldSource ("{ADO.name}")
.Field5.SetUnboundFieldSource ("{ADO.address}")
.Field6.SetUnboundFieldSource ("{ADO.mpay}")
If rs("mpay") = "Cash" Then
.Text2.SetText ""
Else
If rs("mpay") = "Cheque" Then
.Text2.SetText "Cheq.Date"
.Field7.SetUnboundFieldSource ("{ADO.cheque}")
.Field8.SetUnboundFieldSource ("{ADO.bank}")
.Field9.SetUnboundFieldSource ("{ADO.cheque_date}")
Else
If rs("mpay") = "Credit Card" Then
.Text2.SetText "Exp.Date"
.Field7.SetUnboundFieldSource ("{ADO.ccard}")
.Field8.SetUnboundFieldSource ("{ADO.bank}")
.Field11.SetUnboundFieldSource ("{ADO.cctype}")
.Field9.SetUnboundFieldSource ("{ADO.exp_date}")
Else
End If
End If
End If
.Field10.SetUnboundFieldSource ("{ADO.vno}")
End With
Else
End If
invoice_report.Subreport1.OpenSubreport.Database.AddADOCommand oConn, ocmd1
'Set itemsub_report = invoice_report.Subreport1.OpenSubreport
Set itemsub_report = invoice_report.OpenSubreport("item")
' connect the other recordset to the sub-report
itemsub_report.DiscardSavedData
itemsub_report.Database.SetDataSource rs, 3, 1
itemsub_report.AutoSetUnboundFieldSource crBMTName
If rs.RecordCount > 0 Then
With itemsub_report
'.Text1.SetText "Invoice - " & rs("subtype")
.Text1.SetText "Invoice - " & itemsub_report.Database.Tables(1).Fields(41).Name
.Field2.SetUnboundFieldSource itemsub_report.Database.Tables(1).Fields(41).Name
' .Field1.SetUnboundFieldSource ("{ADO.Command1-qty}")
'.Field2.SetUnboundFieldSource ("{ADO.Command1-brand}")
.Field3.SetUnboundFieldSource ("{ADO.Command1-brand_id}")
.Field4.SetUnboundFieldSource ("{ADO.Command1-category}")
.Field5.SetUnboundFieldSource ("{ADO.Command1-price}")
.Field6.SetUnboundFieldSource ("{ADO.Command1-value}")
.Field7.SetUnboundFieldSource ("{ADO.job_no}")
End With
invoice_report.Field12.SetUnboundFieldSource ("{ADO.item_charge}")
Else
End If
invoice_report.Subreport2.OpenSubreport.Database.AddADOCommand oConn, ocmd1
Set servicesub_report = invoice_report.Subreport2.OpenSubreport
' connect the other recordset to the sub-report
servicesub_report.DiscardSavedData
servicesub_report.Database.SetDataSource rs, 3, 1
servicesub_report.AutoSetUnboundFieldSource crBMTName
If rs.RecordCount > 0 Then
With servicesub_report
.Text1.SetText "Service Charges"
.Field1.SetUnboundFieldSource ("{ADO.Command2-desc}")
.Field2.SetUnboundFieldSource ("{ADO.Command2-service_charge}")
.Field3.SetUnboundFieldSource ("{ADO.Command2-total_scharge}")
End With
invoice_report.Field12.SetUnboundFieldSource ("{ADO.item_charge}")
Else
End If
invoice_report.Text3.SetText "Total Bill Value ="
invoice_report.Field13.SetUnboundFieldSource ("{ADO.bill_value}")
CRViewer1.ReportSource = invoice_report
CRViewer1.ViewReport
End SubHi lalantha,
It looks like you are using the RDC as your report engine. The RDC has been deprecated since version 9 meaning there has been no new funcitonalty added to it. There is no option in the RDC to set location to a Command object, it was added to RAS in Cr Xi R2 ( 11.5 ).
Only work around is to make a connection to the Database directly or using a disconnect record set, there may be other ways but it will require you to rebuild your report. We don't have the ability to map a report that used a COmmand object to another data source.
Thank you
Don -
Is there any segment adviser or shrinking fecility availabe in sql devloper
Hi,
is there any segment adviser or shrinking fecility availabe in sql devloper. for oracle 11g express.
yorus sincerlyView > DBA
Add connection to your database
Then drill into the Storage node. Select your tablespace and resize your file.
As a newbie, I recommend you read the Oracle docs on tablespace management. -
Need help with a Java-SQL connection
My classmates and I created a DesktopFrame. Within it are reports that require a connection to an MS Access Database. When a report in an InternalFrame is opened: the SQL command works, there is a connection, and everything goes well on the first run.
However, when another InternalFrame is opened or when the same InternalFrame is opened the 2nd time, an error occurs. It produces a java.sql.SQLException: General Error.
Can anyone help me? Thanks in advance.Provide more info, maybe even some code segments. (Not all). May be easier to help
Maybe you are looking for
-
Problem updating photos in new ios7.0.2 for iphone 5
Hi My iphone want update the photos that I had taken under the old operating system. It keeps saying downloading.....even when I use a wifi connection. Some of the photos I can see, but most of them are grey blank squares Does anyone have a suggesti
-
PLEASE HELP!! HOW DO I RUN A .EXE APPLICATION INSIDE A BROWSER!!
hello everyone, i Run a website, named www.anarchywars.com and basicaly i made a mini game in a program called "Game-Make 6", basicaly when i save it to an .exe its very useful because all it needs to run is that .exe and you can play the game. Basic
-
Imported images upside down and blurred Lightroom 1.4
Hiya everyone. First post on here so I hope I am putting this in the right place but hope you can help me. I have had a trawl through the archives but havent seen a fix for this problem. When I try to import images direct from my camera (Canon EOS 30
-
this is a question-i seem to be haveing problems with my PS-CC WHEN I GO TO THE FILL BOX AND TRY TO GET A TREE OR FRAME I GET ERRORS SOMETHING ABOUT WIDGETS NOT WORKING AND I ALSO GET THIS SORT OF THING IN AUTOMATE/CAN I RELOAD A NEW PHOTOSHOPcc and
-
After having had to upgrade to windows 7 i cant find the product key for my photoshop elements 8
i kept the download for my photoshop elements 8 but after the windows 7 upgrade i cant find the product key for the PSE8