How to conver this sqlserver code into Oracle
Hi,
Any one can help me how to covert below sqlserver code into Oracle?
DECLARE @t1 DATETIME;
DECLARE @t2 DATETIME;
SET @t1 = GETDATE();
select * from table;
SET @t2 = GETDATE();
SELECT DATEDIFF(millisecond,@t1,@t2) AS elapsed_ms;
Hi,
Do Like This ,
This is The function going to calculate elapsed time ,execute this before the second script,
CREATE function DATEDIFF
startTime in timestamp with time zone,
endTime in timestamp with time zone
return number
as
interval_ interval day (9) to second (3);
begin
interval_ := endTime - startTime;
return (extract(day from (interval_)) * 86400 +
extract(hour from (interval_)) * 3600 +
extract(minute from (interval_)) * 60 +
extract(second from (interval_))) * 1000;
end;And this Is the Script that i converted to oracle,
SET server out put on;
DECLARE
v_t1 TIMESTAMP;
v_t2 TIMESTAMP;
lv_cur sys_refcursor;
lv_elapsed VARCHAR2 (30);
BEGIN
v_t1 := SYSTIMESTAMP;
OPEN lv_cur FOR
SELECT *
FROM emp;
v_t2 := SYSTIMESTAMP;
SELECT datediff (v_t1, v_t2) elapsed_ms
INTO lv_elapsed
FROM DUAL;
DBMS_OUTPUT.put_line (v_t1);
DBMS_OUTPUT.put_line (v_t2);
END;Thanks & Rgds
BCV.
Similar Messages
-
How to transform this pascal code into java code!
I want to transform this pascal code into java code . Please tel me how to do it because I really don't know how to do it!
Thanks!
{CALCULATE HOHN-LONDON FACTORS}
var kk:tab4;
PROCEDURE INTENS(var kk:tab4);
begin
for n:=0 to nr+2 do
begin
kk^[1,n]:=sqrt(lup*lup*yg*(yg-4)+4*sqr(n+1)) +lup*(yg-2);
kk^[2,n]:= sqrt(lup*lup*yg*(yg-4)+4*sqr(n+1))-lup*(yg-2);
kk^[3,n]:=0.5*(kk^[1,n]*kk^[1,n]+4*(sqr(n+1)-lup*lup));
kk^[4,n]:= 0.5*(kk^[2,n]*kk^[2,n]+4*(sqr(n+1)-lup*lup));
kk^[5,n]:= sqrt(ldown*ldown*yd*(yd-4)+4*sqr(n+1)) +ldown*(yd-2);
end;
end;
BEGIN
new (kk);
intens(kk);
writeln(f2,' ','N ','V','branch ','H-L');
for n:=1 to np do
begin
fp1[n,v]:=(n-ldown)*(n+ldown+1)*sqr(kk^[2,n-1]*kk^[6,n]+4*(n+ldown)*(n-ldown+1));
fp1[n,v]:=fp1[n,v]/(4*(n+0.5)*kk^[4,n-1]*kk^[8,n]) ;
writeln(f2,' ',n,' ',v,' fp1 ',fp1[n,v]:10:2);
end;
for n:=1 to nq do
begin
fq1[n,v]:=sqr(kk^[2,n]*kk^[6,n]*(ldown+0.5)+4*(n-ldown+1)*(n+ldown+1)*(ldown-0.5)) ;
fq1[n,v]:=fq1[n,v]/(2*(n+0.5)*kk^[4,n]*kk^[8,n]*(n+1.5));
fq1[n,v]:=fq1[n,v]*(n+1);
writeln(f2,' ',n,' ',v,' fq1 ',fq1[n,v]:10:2);
end;
for n:=1 to nr do
begin
fr1[n,v]:=sqr(kk^[2,n+1]*kk^[6,n]+4*(n-ldown+2)*(n+ldown+1));
fr1[n,v]:=fr1[n,v]/(4*kk^[4,n+1]*kk^[8,n]*(n+1.5));
fr1[n,v]:=fr1[n,v]*(n-ldown+1)*(n+ldown+2) ;
writeln(f2,' ',n,' ',v,' fr1 ',fr1[n,v]:10:2);
end;Basically it looks like this:
public class KK{
private your_type[][] kk = new your_type[length][length];
private void intens(your_type[] kk){
for(int n= 0; n<nr+2; n++){
kk[1][n] = Math.sqrt(lup*lup*yg*(yg-4)+4*Math.pow((n+1), 2)) +lup*(yg-2);
kk[2][n] = Math.sqrt(lup*lup*yg*(yg-4)+4*Math.pow((n+1), 2))-lup*(yg-2);
kk[3][n] = 0.5*(kk[1][n]*kk[1][n]+4*(Math.pow((n+1), 2)-lup*lup));
kk[4][n] = 0.5*(kk[2][n]*kk[2][n]+4*(Math.pow((n+1), 2)-lup*lup));
kk[5][n] = Math.sqrt(ldown*ldown*yd*(yd-4)+4*Math.pow((n+1), 2)) +ldown*(yd-2);
public static void main(String args[]){
KK k = new KK();
k.intens(kk);
System.out.println(f2 + ' ' + 'N ' + 'V' + 'branch ' + 'H-L');
for(int n=1; n < np; n++){
fp1[n][v] = (n-ldown)*(n+ldown+1)*Math.pow((kk[2][n-1]*kk[6][n]+4*(n+ldown)*(n-ldown+1)), 2);
fp1[n][v] = fp1[n][v]/(4*(n+0.5)*kk[4][n-1]*kk[8][n]) ;
System.out.println(f2 + ' ' + n + ' ' + v + ' fp1 ' + fp1[n][v]:10:2);
for(int n=1; n< nq;n++){
fq1[n][v] = Math.pow((kk[2][n]*kk[6][n]*(ldown+0.5)+4*(n-ldown+1)*(n+ldown+1)*(ldown-0.5)), 2);
fq1[n][v] = fq1[n][v]/(2*(n+0.5)*kk[4][n]*kk[8][n]*(n+1.5));
fq1[n][v] = fq1[n][v]*(n+1);
System.out.println(f2 + ' ' + n + ' ' + v + ' fq1 ' + fq1[n][v]:10:2);
for(int n=1; n < nr; n++){
fr1[n][v] = Math.pow((kk[2][n+1]*kk[6][n]+4*(n-ldown+2)*(n+ldown+1)), 2);
fr1[n][v] = fr1[n][v]/(4*kk[4][n+1]*kk[8][n]*(n+1.5));
fr1[n][v] = fr1[n][v]*(n-ldown+1)*(n+ldown+2) ;
System.out.println(f2 + ' ' + n + ' ' + v + ' fr1 ' + fr1[n][v]:10:2); //fr1[n][v]:10:2 --> Here you must use the BigDecimal class
}I'm not very sure because my pascal knowledge is extremely "dated".
What about the converter I told you about? -
How to conver this System.nanoTime() into Hours,minutes and second
I am getting my Total time with the help of this function ie System.nanoTime(). But i want to Display in the form of Hours,minutes and second.
So can any one plz tell me that how i will do this conversion.If it's less than 24 hours you can use Calendar. or SimpleDateFormat. Add the epoch time for some convenient midnight to the milliseconds value (divide nanos by 1000000).
Otherwise it's just successive division and remaindering.
Probably nanos is higher resolution than you need, milliseconds is easier. -
How to convert this VB code into c#
Public Property Cell(ByVal row_index As Integer, ByVal col_index As Integer) As Object
Get
Return _excel.Cells(row_index, col_index).value
End Get
Set(ByVal value As Object)
_excel.Cells(row_index, col_index).value = value
End Set
End Property
Thanks.If you want to have a property called Cell that returns excel's Cells collection (which is a Range) then just do this:
public Range Cells
public get
return _excel.Cells;
// Range is accessed by .Cells
// Range has an index operator [,]
// so you can access .Cells[row,col]
If you want to intercept the indexing, then you must return a object that proxies the indexing.
class MyRange
public MyRange( Range range ) { this.range = range; }
Range range;
// This just might be the syntax you're actually looking for
public object this[int row, int col]
get {
return range[row,col];
set
range[row,col] = value;
public MyRange Cells
get {
return new MyRange( _excel.Cells ); -
How to insert a image file into oracle database
hi all
can anyone guide me how to insert a image file into oracle database now
i have created table using
create table imagestore(image blob);
but when inserting i totally lost don't know what to do how to write query to insert image fileHi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
out.println(" <input type='submit' name='submit' value='Submit' class='smalltext'>");
out.println("</form>"); Import this once you have the jar file:
import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
boolean result = true;
String fileName = null;
byte fileData[] = null;
String fileUploadError = null;
String imageType = "";
String error = "";
DiskFileUpload fb = new DiskFileUpload();
List fileItems = fb.parseRequest(request);
Iterator it = fileItems.iterator();
while(it.hasNext()){
FileItem fileItem = (FileItem)it.next();
if (!fileItem.isFormField()) {
fileName = fileItem.getName();
fileData = fileItem.get();
// Get the imageType from the filename extension
if (fileName != null) {
int dotPos = fileName.indexOf('.');
if (dotPos >= 0 && dotPos != fileName.length()-1) {
imageType = fileName.substring(dotPos+1).toLowerCase();
if (imageType.equals("jpg")) {
imageType = "jpeg";
String filePath = request.getParameter("FILE_PATH");
session.setAttribute("filePath", filePath);
session.setAttribute("fileData", fileData);
session.setAttribute("fileName", fileName);
session.setAttribute("imageType", imageType);
return result;
} And now finally the method to actually write the file to the database:
private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
//If the previous code found a file that can be uploaded then
//save it into the database via a pstmt
String sql = "";
UtilDBquery udbq = getUser(request).connectToDatabase();
Connection con = null;
int signatureID = 0;
PreparedStatement pstmt = null;
try {
udbq.setUsePreparedStatements(true);
con = udbq.getPooledConnection();
con.setAutoCommit(false);
if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
pstmt = con.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
signatureID = rs.getInt(1);
if (fileName != null && imageType != null) {
sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setInt(1, signatureID);
pstmt.setBinaryStream(2, is2, (int)(fileData.length));
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
if(mode.equals("U") && signatureIDIn != 0) {
signatureID = signatureIDIn.intValue();
if (fileName != null && imageType != null) {
sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setBinaryStream(1, is2, (int)(fileData.length));
pstmt.setInt(2, signatureID);
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
} catch (Exception e) {
con = null;
throw new Exception(e.toString());
return signatureID;
} -
How to use PDF417 Bar Code in Oracle Reports 6i
How to Use PDF417 Bar Code in Oracle 6i. One of my clients has a requirement that Customer Name and Address to be converted into PDF417.
Any help greatly appreciated.
Thanks,
PNYou will need to add this font to the system and Reports configuration files.
For adding font to the system, refer to your system specific guidelines for installing new fonts.
After you have installed this font on the system, you should be able to see the font in Reports builder font picker dropdown box. or with unix 'xlsfonts' command
For adding this font to the Reports application.
1. Modify the printer definition file ( you can get this info from uiprint.txt file for the .ppd or .hpd file used )
if the printer defination file is .ppd then look for "*Font Information" section and add the new font name there
like *Font <new_font_name> Standard '(00.1001)" Standard ROM
If hpd add the new font tfm file as
FONT= new_font_name
/tfm=new_font_tfm file.tfm
2. Copy the AFM or TFM ( these are fonts metrics files, which font vendor will provide ) into the relevant directory so the the Reports application should pick them up.
3. If necessary, make changes in the alias file (uifont.ali ) for mapping to this font. If the layout objects in your report are associated with the same font name as the new font then mapping is not required. But if the fonts for the layout objects are different then you need to map the original fonts to the new ones. Make sure that the mapping rules should be defined in the right section depending on the printer type being used. -
How to export sql server 2000 into oracle intergrally?
1.environment:
sql server 200 - character set: CHINESE_PRC_CI_AS
tables :include ntext field (I think it equals clob)
support english,simple chinese character.
oracle 9i - character set :NLS_LANG=AMERICAN_AMERICA.US7ASCII
2. aim
export sql server objects(main is tables) into oracle intergrally
3.question:
3.1 the field which includes chinese data,after exporting,displays "????" code.
3.2 how to export sql ntext field into oracle?
thanks a lotYou need to setup your Oracle Database use character set that support Chinesre Character. For example a unicode character set AL16UTF16.
More information her
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/ch6unicode.htm#i1006691
Also consider use Oracle Migration Workbench to transfer SQL Server Data
http://www.oracle.com/technology/tech/migration/workbench/files/mig_rel10104.html -
How do you turn java code into an .exe or etc...
I can't seem to figure out how to turn my java code into an executable in windows so that it runs by itself without a comipler, can someone help? (without using visual J++).
I can't seem to figure out how to turn my java code
into an executable in windows so that it runs by
itself without a comipler, can someone help? (without
using visual J++).I saw a tutorial on that, you might want to check it out.
http://developer.java.sun.com/developer/onlineTraining/new2java/divelog/?frontpage-headlinesfeatures -
How can I add advertisement code into flash game?
hi mates,
just want to ask about loading advertisement code!
How do you add the advertisement code (adsense) into flash games??
my site Funny Games have over 5k games but they are getting from others sites thus I have no original files. How can I add more code into the current files?Unless the games were pre-made to allow you to specify some variables in the page code or some external file, you won't be having any luck... you cannot add code to the games unless you have the source files, which you apparently don't have.
-
How do enter my product code into a trial version when I have a student copy of Adobe Photoshop CS6
How do enter my product code into a trial version when I have a student copy of Adobe Photoshop CS6
Redemption Code Help
Installing and Activating a Try & Buy product
Mylenium -
How to insert XML/dtd data into oracle db
Hi,
I have posted this question on couple
sites and unfortunately I haven't received
any response. Hopefully this time,
someone can at least direct me to the
website/document/sample codes which can provide me solutions of my question.
My question is:
Given a DTD, can the XML SQL Utility generate
the database schema?
I am trying to find out how the XML data can
be loaded into the oracle database.
Thanks in advance,
Judy
nullA DTD does not contain enough information to do a good job at creating a database schema. It contains no datatype information, no field length information for starters, so a table created by a hypothetical DTD->to->Tables utility would be at best able to create a table with all VARCHAR2(4000) columns. Not that useful.
My book contains lots of examples of techniques for loading XML data into Oracle, include lots of sample code and a whole chapter devoted to building a flexible "XMLLoader" utility for loading XML of arbitrary size into the database.
Steve Muench
Development Lead, Oracle XSQL Pages Framework
Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
Author, Building Oracle XML Applications
null -
How to convert pl/sql code into java/j2ee
Hi,
We have a PL/SQL Oracle App server application that we will support if we can convert in j2ee/java. But when i did take a look at the code, these pl/sql contains all HTML and java code inside the stored procedures.
And iam looking to explore some tools and mechanisms that can convert these pl/sql in a JAVA application so that i can deploy this new app into my BEA81 environment.
Does any body has any idea:
a) How to convert from pl/sql > java ?
b) Any plugins or tools of BEA that can run these pl/sql (the way thay are currently...i.e w/o converting) in BEA 81 container ?
thanks, sangitathese pl/sql contains all HTML and java code insideJava or JavaScript. They are not the same. I wouldn't expect to see Java inside html, whereas JavaScript would be intermixed. On the other hand you might have a java stored proc (Oracle 9/10) which is generating HTML.
>
Does any body has any idea:Refactor.
I doubt it just has html and JavaScript/Java. So what you have is a mess that mixes several things that should have been seperate in the first place. -
How do I break my codes into classes??
How do i break each tab into a class and call them inside a main program ??
Please show me how thanks.
import javax.swing.JTabbedPane;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.BorderFactory;
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import java.sql.*;
import java.io.*;
public class DatabaseApp extends JPanel {
// declare the width and height of UI
public static int WIDTH = 800;
public static int HEIGHT = 600;
// create textfield objects for user to enter the input
TextField employeeID = new TextField(15);
TextField name = new TextField(40);
TextField address = new TextField(40);
TextField suburb = new TextField(20);
TextField state = new TextField(5);
TextField pCode = new TextField(5);
TextField dob = new TextField(15);
TextField homePh = new TextField(15);
TextField workPh = new TextField(15);
TextField mobile = new TextField("0",15);
TextField eMail = new TextField(30);
TextField dbase = new TextField("employee",20);
TextField report = new TextField(15);
TextField query= new TextField(50);
TextArea displayArea = new TextArea(16,80);
TextArea helpArea = new TextArea(20,80);
public static void main (String[] args) {
JFrame frame = new JFrame ("S-League Management System");
frame.addWindowListener(new WindowAdapter(){
public void windowClosing (WindowEvent e) {
System.exit(0);
frame.getContentPane().add(new DatabaseApp(), BorderLayout.CENTER);
frame.setSize(800,600);
frame.setResizable(false);
frame.setVisible(true);
//centralise the screen
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
frame.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
/** add buttons to the database form
public JButton(String text,Icon icon)
Creates a button with initial text and an icon.
Parameters:
text - the text of the button.
icon - the Icon image to display on the button
JButton newButton = new JButton (" New ", new ImageIcon(DatabaseApp.class.getResource("img/New.gif")));
JButton addButton = new JButton (" Add ", new ImageIcon (DatabaseApp.class.getResource("img/Add.gif")));
JButton findButton = new JButton (" Retrieve ", new ImageIcon (DatabaseApp.class.getResource("img/Find.gif")));
JButton updateButton = new JButton (" Update ", new ImageIcon (DatabaseApp.class.getResource("img/Refresh.gif")));
JButton deleteButton = new JButton (" Delete ", new ImageIcon (DatabaseApp.class.getResource("img/Delete.gif")));
JButton submitButton = new JButton (" Submit Query ", new ImageIcon (DatabaseApp.class.getResource("img/Export.gif")));
JButton reportButton = new JButton (" Report File ", new ImageIcon (DatabaseApp.class.getResource("img/AlignLeft.gif")));
/** create tabbed pane for form
* public void addTab(String title,Icon icon,Component component,String tip)
* Parameters:
* title - the title to be displayed in this tab
* icon - the icon to be displayed in this tab
* component - The component to be displayed when this tab is clicked.
* tip - the tooltip to be displayed for this tab
public DatabaseApp() {
// create new tabbedPane object
JTabbedPane tabbedPane = new JTabbedPane(){
ImageIcon imageIcon = new ImageIcon("img/logo.jpg");
Image image = imageIcon.getImage();
public void paintComponent (Graphics g) {
g.setColor(new Color(220,220,220));
g.fillRect(0,0,643,74);
g.drawImage(image, 0, 4, this);
super.paintComponent(g);
tabbedPane.addTab(" Team Management ",null, buildQueryPanel(), "Team Management");
tabbedPane.addTab(" Player Registration ",null, buildGeneralPanel(), "Player Registration");
tabbedPane.addTab(" Author ",null, buildAuthorPanel(), "Author");
// assign layout manager
//setLayout(new GridLayout(1,1));
tabbedPane.setSelectedIndex(1);
tabbedPane.setBorder(BorderFactory.createEmptyBorder(78,0,0,0));
add(tabbedPane);
protected JPanel buildQueryPanel() {
JPanel mainPane = new JPanel();
// divided into three panes. these panes will be added to mainPanel
JPanel westPane = new JPanel();
JPanel centrePane = new JPanel();
JPanel southPane = new JPanel();
// assign the layout managers
mainPane.setLayout(new BorderLayout());
westPane.setLayout(new GridLayout(4,1));
centrePane.setLayout(new GridLayout(4,1));
// create array of Panels for label textfield and buttons and make them left align
Panel labelPane[] = new Panel[4];
Panel buttontxtPane[] = new Panel[4];
Panel textPane[] = new Panel[1];
for (int i=0; i < labelPane.length; ++i) {
labelPane[i] = new Panel();
labelPane.setLayout(new FlowLayout(FlowLayout.LEFT));
for (int i=0; i < buttontxtPane.length; ++i) {
buttontxtPane[i] = new Panel();
buttontxtPane[i].setLayout(new FlowLayout(FlowLayout.LEFT));
for (int i=0; i < textPane.length; ++i) {
textPane[i] = new Panel();
textPane[i].setLayout(new FlowLayout(FlowLayout.LEFT));
// add different label to the labelPane
labelPane[0].add(new JLabel("Database:"));
labelPane[1].add(new JLabel("Query:"));
labelPane[2].add(new JLabel("Report File:"));
labelPane[3].add(new Label(""));
// textfields
buttontxtPane[0].add(dbase);
buttontxtPane[1].add(query);
buttontxtPane[2].add(report);
// buttons
buttontxtPane[3].add(submitButton);
submitButton.setMnemonic('s');
buttontxtPane[3].add(reportButton);
reportButton.setMnemonic('r');
// text area to view the result
textPane[0].add(displayArea);
// add action listener to buttons
submitButton.addActionListener(new ButtonHandler());
reportButton.addActionListener(new ButtonHandler());
for(int i=0; i < labelPane.length; ++i)
westPane.add(labelPane[i]);
for(int i=0; i < buttontxtPane.length; ++i)
centrePane.add(buttontxtPane[i]);
for(int i=0; i < textPane.length; ++i)
southPane.add(textPane[i]);
mainPane.add(westPane, BorderLayout.WEST);
mainPane.add(centrePane, BorderLayout.CENTER);
mainPane.add(southPane,BorderLayout.SOUTH);
return mainPane;
/**Create a JPanel for General tab, divide it into three JPanels for label, displaytext
* and buttons.Assign a Flowlayout manager to each panel. Add label, textfield
* and buttons to respective panel. following constructors will be used
* for Jlabel
* public JLabel(String text)
* Creates a JLabel instance with the specified text. The label is aligned against the leading edge of its display area, and centered vertically.
* Parameters:
* text - The text to be displayed by the label.
protected Component buildGeneralPanel() {
// main panel
JPanel mainPanel = new JPanel();
// divided into three panes. these panes will be added to mainPanel
JPanel westPane = new JPanel();
JPanel centrePane = new JPanel();
JPanel southPane = new JPanel();
// assign the layout managers
mainPanel.setLayout(new BorderLayout());
westPane.setLayout(new GridLayout(12,1));
centrePane.setLayout(new GridLayout(12,1));
// create array of Panels for label textfield and buttons and make them left align
Panel labelPane[] = new Panel[12];
Panel textPane[] = new Panel[12];
Panel buttonPane[] = new Panel[2];
for (int i=0; i < labelPane.length; ++i) {
labelPane[i] = new Panel();
labelPane[i].setLayout(new FlowLayout(FlowLayout.LEFT));
for (int i=0; i < textPane.length; ++i) {
textPane[i] = new Panel();
textPane[i].setLayout(new FlowLayout(FlowLayout.LEFT));
for (int i=0; i < buttonPane.length; ++i) {
buttonPane[i] = new Panel();
buttonPane[i].setLayout(new FlowLayout(FlowLayout.LEFT));
// add different label to the labelPane
labelPane[0].add(new JLabel("Employee No"));
labelPane[1].add(new JLabel("Name"));
labelPane[2].add(new JLabel("Address"));
labelPane[3].add(new JLabel("Suburb"));
labelPane[4].add(new JLabel("State"));
labelPane[5].add(new JLabel("PostCode"));
labelPane[6].add(new JLabel("Date of Birth"));
labelPane[7].add(new JLabel("Home Phone"));
labelPane[8].add(new JLabel("Work Phone"));
labelPane[9].add(new JLabel("Mobile"));
labelPane[10].add(new JLabel("E-mail"));
// add textfield component to textPane
textPane[0].add(employeeID);
textPane[1].add(name);
textPane[2].add(address);
textPane[3].add(suburb);
textPane[4].add(state);
textPane[5].add(pCode);
textPane[6].add(dob);
textPane[7].add(homePh);
textPane[8].add(workPh);
textPane[9].add(mobile);
textPane[10].add(eMail);
// add button to buttonPane and assign keyboard key for shortcut e.g Alt + n
buttonPane[0].add(newButton);
newButton.setMnemonic('n');
buttonPane[0].add(addButton);
addButton.setMnemonic('a');
buttonPane[0].add(findButton);
findButton.setMnemonic('r');
buttonPane[0].add(updateButton);
updateButton.setMnemonic('u');
buttonPane[0].add(deleteButton);
deleteButton.setMnemonic('d');
// add actionlistener to the buttons
newButton.addActionListener(new ButtonHandler());
addButton.addActionListener(new ButtonHandler());
findButton.addActionListener(new ButtonHandler());
updateButton.addActionListener(new ButtonHandler());
deleteButton.addActionListener(new ButtonHandler());
for (int i = 0; i < labelPane.length; ++i)
westPane.add(labelPane[i]);
for (int i = 0; i < textPane.length; ++i)
centrePane.add(textPane[i]);
for (int i = 0; i < buttonPane.length; ++i)
southPane.add(buttonPane[i]);
mainPanel.add(westPane,BorderLayout.WEST);
mainPanel.add(centrePane,BorderLayout.CENTER);
mainPanel.add(southPane,BorderLayout.SOUTH);
return mainPanel;
protected JPanel buildAuthorPanel(){
JPanel authorPanel = new JPanel();
JPanel authorPane = new JPanel();
authorPanel.setLayout(new BorderLayout());
authorPane.setLayout(new GridLayout(9,1));
Panel pane[] = new Panel[9];
for (int i=0; i < pane.length; i++) {
pane[i] = new Panel();
pane[i].setLayout(new FlowLayout(FlowLayout.CENTER));
pane[0].add(new JLabel(""));
pane[1].add(new JLabel(""));
pane[2].add(new JLabel(""));
pane[3].add(new JLabel(""));
pane[4].add(new JLabel("Name:Jasper Lim Jiqiang"));
pane[5].add(new JLabel("Admin:992365G"));
pane[6].add(new JLabel(""));
pane[7].add(new JLabel(""));
pane[8].add(new JLabel(""));
for (int i=0; i < pane.length; i++)
authorPane.add(pane[i]);
authorPanel.add(authorPane, BorderLayout.CENTER);
return authorPanel;Maybe something like this:
<code>
JTabbedPane tabbedPane = new JTabbedPane();
JPanel introPanel = new JPanel();
introPanel.add(createIntroPanel());
ImageIcon img = new ImageIcon(getResourceString("tabIconFile"));
tabbedPane.addTab(getResourceString("introTab"), img, introPanel);
</code>
plus
<code>
protected JPanel createIntroPanel()
JPanel pane = new IntroPanel();
return pane;
</code>
Klint -
How to load excel-csv file into oracle database
Hi
I wanted to load excel file with csv extension(named as trial.csv) into
oracle database table(named as dept),I have given below my experiment here.
I am getting the following error,how should I rectify this?
For ID column I have defined as number(5) datatype, in my control file I have defined as interger external(5),where as in the Error log file why the datatype for ID column is comming as character?
1)my oracle database table is
SQL> desc dept;
Name Null? Type
ID NUMBER(5)
DNAME CHAR(20)
2)my data file is(trial.csv)
ID DNAME
11 production
22 purchase
33 inspection
3)my control file is(trial.ctl)
LOAD DATA
INFILE 'trial.csv'
BADFILE 'trial.bad'
DISCARDFILE 'trial.dsc'
APPEND
INTO TABLE dept
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(ID POSITION(1:5) INTEGER EXTERNAL(5)
NULLIF ID=BLANKS,
DNAME POSITION(6:25) CHAR
NULLIF DNAME=BLANKS
3)my syntax on cmd prompt is
c:\>sqlldr scott/tiger@xxx control=trial.ctl direct=true;
Load completed - logical record count 21.
4)my log file error message is
Column Name Position Len Term Encl Datatype
ID 1:5 5 , O(") CHARACTER
NULL if ID = BLANKS
DNAME 6:25 20 , O(") CHARACTER
NULL if DNAME = BLANKS
Record 1: Rejected - Error on table DEPT, column ID.
ORA-01722: invalid number
Record 21: Rejected - Error on table DEPT, column ID.
ORA-01722: invalid number
Table DEPT:
0 Rows successfully loaded.
21 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 21
Total logical records rejected: 21
Total logical records discarded: 0
Total stream buffers loaded by SQL*Loader main thread: 0
Total stream buffers loaded by SQL*Loader load thread: 0
5)Result
SQL> select * from dept;
no rows selected
by
balamuralikrishnan.sHi everyone!
The following are the steps to load a excell sheet to oracle table.i tried to be as simple as possible.
thanks
Step # 1
Prapare a data file (excel sheet) that would be uploaded to oracle table.
"Save As" a excel sheet to ".csv" (comma seperated values) format.
Then save as to " .dat " file.
e.g datafile.bat
1,Category Wise Consumption Summary,Expected Receipts Report
2,Category Wise Receipts Summary,Forecast Detail Report
3,Current Stock List Category Wise,Forecast rule listing
4,Daily Production Report,Freight carrier listing
5,Daily Transactions Report,Inventory Value Report
Step # 2
Prapare a control file that define the data file to be loaded ,columns seperation value,name and type of the table columns to which data is to be loaded.The control file extension should be " .ctl " !
e.g i want to load the data into tasks table ,from the datafile.dat file and having controlfile.ctl control file.
SQL> desc tasks;
Name Null? Type
TASK_ID NOT NULL NUMBER(14)
TASK_NAME VARCHAR2(120)
TASK_CODE VARCHAR2(120)
: controlfile.ctl
LOAD DATA
INFILE 'e:\datafile.dat'
INTO TABLE tasks
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(TASK_ID INTEGER EXTERNAL,
TASK_NAME CHAR,
TASK_CODE CHAR)
The above is the structure for a control file.
Step # 3
the final step is to give the sqlldr command to execute the process.
sqlldr userid=scott/tiger@abc control=e:\controlfile.ctl log=e:\logfile.log
Message was edited by:
user578762 -
How do I manually enter code into an iweb page??
iweb blogging is not bad; but there are times when I want to enter html code by hand; maybe a form script or CSS code.
I tried inputting the code into the blog.html page, but it will vanish every time I update iweb.
So; how can I manually add code to an iweb page? Surely this is possible?
thanksOf course it's possible. Lots of us do that on our pages already. Two things to keep in mind...1. No way to do this via iWeb directly, so it involves editing the published html files, and 2. Because iWeb republishes the html files whenever you update the your webpage, you will lose your changes and have to redo them to add your HTML back.
The general directions are as follows (using banner code as an example)...
1. Decide where you want your banner and know exactly what dimensions you need.
2. Insert a text box onto your page and adjust its size to exactly your dimensions.
3. Type in some uniquely identifiable text like, "BANNERCODEHERE" without changing the font or anything else...just type it in.
4. Publish your page with iWeb.
5. Find the html file associated with your published page (either on your iDisk or in a folder depending on how you published) and open it in any text editor (like Microsoft Word, or Textedit, or anything).
6. Scroll through the html file and locate your placeholder text, e.g. "BANNERCODEHERE".
7. Replace the placeholder text with your html code and publish your page.
That's it. You should see your html coded element show up where you placed the text box.
If any of this information is useful to you, please do me a favor and mark my reply as "solved" or "helpful" using the little buttons that you see in the title bar of this reply. I would appreciate it immensely. Thank you.
Maybe you are looking for
-
Goods receipt for Stock Transport Orders
Hi Gurus We create STO'S ( with in same plant and between two storage locations) and followed by delivery ,PGI with 641 movement type.When we run the MD04 list we have the open items because we haven't done the goods receipt when goods issue is don
-
Hard drive not mounting or being recognized by my MacBook???
Hello, I have a Glyph external hard drive that, all of a sudden, is no longer being recognized by my computer. I does not show up in the system profiler nor in disk utility. It connects using firewire. I have connected my digital camera via firewire
-
Planned order status details in rem
Hai gurus, In discrete manufacturing after confirming the respective production order we can go to T.C co02 and give the respective production order number to view the status and from that we can know the operation details and status in the routing.
-
AF Table-CommandLink and Open in New Window issue
I am using af:table to display the result set and inside the af:table i use af:commandLink to display the link to users. When the user clicks the individual link , user will go to the correponding detail page which is working fine. But the problem is
-
Top-level navigation & workset title
Hello, I have created a workset with three pages. Is it possible to display only the title of the pages and not the title of the workset in the top-level navigation ? Thanks VC