How to put the SQL-statement returned value into the field (as a default)

Hi,
I am using Developer/2000 (Forms Designer) under windows 98.
Please tell me how to put the SQL-statement value (as a default value) into the field before enter-query mode. Noted that I have tried the following ways but still some problems:-
1) Place the SQL-statement into PRE_QUERY trigger in the form/block level.
There is a message box which ask 'Do you want to save the changes?'.
2) Place the SQL-statement before execute enter_query. There is still a
message box which ask 'Do you want to save the changes?'.
Any hints? Thanks. Urgent.

solved it!
1) Suppress DEFAULT save message
if form_failure then
raise form_trigger_failure;
end if;
2) Place the default value before enter-query.
Ref: Title='Default value in query field in ENTER_QUERY mode' in designer forum by CVZ
form level trigger
============
WHEN-NEW-ITEM-INSTANCE
=======================
if :system.mode = 'ENTER-QUERY' then
:block.item := 'default waarde';
end if;
3) Suppress the changes whenever leaving the default field.
if :block.item is null then
-- assign statement
end if;

Similar Messages

  • BIDS 2008 DataFlow viewer not showing even though the sql statement returns data

    Have a dataflow and trying to see why no rows are being written to the destination.  I popped a viewer on the connection, but it doesnt show up when I run.  What can I check?
    The DataFlow source runs a sql statement and it runs fine and returns a result.

    Why would that be if I can execute the sql statement that is being used in the OLEDB Source, and I get a result, yet the destination gets no rows afterwards.  Even executing the Dataflow task by itself, no rows are written.
    I do have a script task that modifies the connection before the dataflow, but this was working fine yesterday :)
    Even so, if there was a problem with the connection, I would get an error.  There no no errors, it just sees no rows and the dataviewer is never displayed.
    What the heck can I check?

  • Help with dynamic statement returning values into collection

    Hi All
    I am trying to use dynamic statement to return values into a collection using the returning clause. However, I get an ORA-00933 error. Here is a simple setup:
    create table t(
        pk number,
        id_batch varchar2(30),
        date_created date,
        constraint t_pk primary key ( pk )
    create or replace type num_ntt is table of number;
    create or replace type vc2_ntt is table of varchar2(30);
    create or replace
    package pkg
    as
      type rec is record(
          pk        num_ntt,    
          id_batch  vc2_ntt
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
    end pkg;
    create or replace
    package body pkg
    as
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
      is
      begin
          execute immediate '
          insert into t
          select level, ''x'' || level, sysdate
          from   dual
          connect by level <= :p_count
          returning pk, id_batch into :pk, :id_batch'
          using p_count returning bulk collect into p_rt.pk, p_rt.id_batch;
      end p;
    end pkg;
    declare
      r  pkg.rec;
    begin
      pkg.p( 5, r );
    end;
    /

    sanjeevchauhan wrote:
    but I am working with dynamic statement and returning multiple fields into a collection.And using an INSERT...SELECT statement combined with a RETURNING INTO clause still does not work. Whether it's dynamic SQL or not: it doesn't work. The link describes a workaround.
    By the way, I don't see why you are using dynamic SQL here. Static SQL will do just fine. And so you can literally copy Adrian's setup.
    Regards,
    Rob.

  • How to put in Capital letter  a value of a field in Report ?

    Hello,
    In my report, there is a field that the value is in small letter. Then I want to put it in capital letter always.
    How must I realize it ?
    Regardly.

    I have used the upper function in a select statement of my data model but it doesn't worK.It can not be. How did you come to know?
    >
    then the field to be converted in uppercase letters is already in a group in data model of report.
    Perhaps it's the cause of the problem because when I apply the function ( uppder(column) ) , the column disappears to the group.maybe in your report's layout you are using different column as source for the display field. While using UPPER function in query use any alias for that field for example SELECT UPPER(column_name) my_col FROM... then in the report's layout use the my_col as source for the displayed field.
    -Ammad

  • How to put a SQL Agent Job wait in the trigger while the job is running.

    Hello!
    I am not a geek in writing t-sql code so I am seeking forum help in completion of my task.
    I have a trigger which fires upon a action and with in that code, I am starting a job via t-sql like
    EXEC msdb.dbo.sp_start_job N'JobName';
    Now, I want to check the condition like that, If the trigger got invoked while the job is running, it should wait till the successfully completion of the job.
    Thanks for your time and help on this.

    You can use Context_info with Wait for delay 
    Below are some useful links..
    http://www.sqlservercentral.com/articles/T-SQL/2765/ 
    http://technet.microsoft.com/en-us/library/ms180125(v=sql.110).aspx 
    http://ask.sqlservercentral.com/questions/42786/how-to-avoid-a-stored-procedure-to-be-executed-par.html
    Thanks,
    Saurabh 
    http://www.linkedin.com/in/sbhadauria http://www.experts-exchange.com/M_6313078.html

  • Toplink generate the SQL statement correctly but it does not return any row

    Hi
    I faced an strange problem when using Toplink as JPA provider. Following snippet shows how I create and execute a query using Toplink JPA:
    q = em.createQuery("SELECT B FROM Branch B WHERE B.street LIKE :street");
    q.setParameter("street", "'%a%'");
       List<Branch> l = q.getResultList();
      System.out.println("List Size: " + l.size());The SQL statement resulted by this query is as follow (according to the generated log file)
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST (? AS VARCHAR(32672) ))
      bind => [%a%]Problem is that List size is always 0, independent of what I provide as parameter. I tried and executed the generated SQL statement in the SQL manager and I got some tens of record as the result. The SQL statement i tested in the SQL manager is like:
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST ('%a%' AS VARCHAR(32672) ))Can someone please let me know what I am missing and how I can fix this problem?
    Thanks.

    Hi,
    Thank you for reply.
    All data are stored in lower case so, the case sensitivity is not a problem. I am wondering how the generated query works fine when I execute it in the sql manager but it return no result when it is executed by the JPA.
    Thanks for looking into my problem.

  • How to run a sql statement with bind variable in a test environment

    Hello,
    I have a sql statement in prod that I like to run in test. I got the sql statement from statspack, but the statement has bind variables. How do I get this statement to run in test? Thank you.

    Hi,
    If you have the SQL statement and all the referenced objects are available in your test env then what is the problem to run it?
    If I am not wront to get your reqmnt...
    i.e
    SQL> select * from emp
    where emp_no = &empno
    and dept_code = &deptcode;
    Thanks

  • Setting the sql statement

    http://www.egbolig.dk/drift_bo_syd.rpt (HERE IS THE REPORT)
    We are using SAP Crystal Report .NET Runtime files (http://scn.sap.com/docs/DOC-7824 newest version 13.0.9.1312) in our web asp.net application. Everything have been working fine, but we have can into problems when showing the certain kinda reports.
    In our code get the reports sql statement using getSQLStatement.
    Dim gp As New GroupPath() Dim sql As String = report.ReportClientDocument.RowsetController.GetSQLStatement(gp)
    This will get the sql, and we use this sql (getSqlStatement) and attach a sql WHERE clause from the code to only get a certain number of records.
    The report Drift_bo_syd.rpt has 5 tables, and the following sql statement. 
    Database/Show Sql Statement
    SELECT "rekvstam"."Sel", "rekvstam"."Afd", "rekvstam"."Levadresse", "rekvstam"."Rekvisition", "rekvstam"."Lejemaal", "rekvstam"."Lejer", "rekvstam"."Udfoertaf", "rekvstam"."Udfoertdato", "rekvstam"."Krit", "Selskab"."Adresse", "Selskab"."Postby", "Selskab"."Tlf", "Selskab"."Fax", "rekvstam"."Kontor", "rekvstam"."Hjemme", "rekvstam"."Rekvdato", "rekvstam"."Aftale", "rekvstam"."InitialRet", "rekvstam"."Arbejde", "kreditor"."Att", "rekvstam"."Konto", "Selskab"."Navn", "Selskab"."Email", "Interessentadresse"."Navn", "Interessentadresse"."Adresse", "Interessentadresse"."Postby", "Interessentadresse"."Email1", "Interessentadresse"."Telefon_Fax", "Interessentadresse"."Type", "Interessentadresse"."Tlf1", "rekvstam"."tlfLejer", "kreditor"."Kred", "Interessentadresse"."Interessentnr" FROM  (("Rekvstam" "rekvstam" INNER JOIN "Selskab" "Selskab" ON "rekvstam"."Sel"="Selskab"."Sel") LEFT OUTER JOIN "Kreditor" "kreditor" ON "rekvstam"."Kred"="kreditor"."Kred") INNER JOIN "Interessentadresse" "Interessentadresse" ON "kreditor"."Interessentnr"="Interessentadresse"."Interessentnr" WHERE  "Interessentadresse"."Type"='K' 
    But if we run the report from our asp.net code, we get the following error: 
    Cannot determine the queries necessary to get data for this report. Failed to retrieve data from the database. Error in File Drift_Bo_Syd {97FED382-1BAC-4DB1-970F-9E098ECE28F1}.rpt: Failed to retrieve data from the database.
    After a long time searching for a solution, we found out that if we place the column kred from the kreditor table on the report, the report will work. (field explorer / database fields / kreditor (table) / kred (column)
    Very important is that the field "kreditor.kred" is a primary key of the table kreditor, and also used in the linking.!
    (We can get the report to work if we call the sql statement with the "kreditor"."kred" in the SELECT statement.
    SELECT "kreditor"."kred", "rekvstam"."Sel", "rekvstam"."Afd", "rekvstam"."Levadresse", "rekvstam"."Rekvisition", "rekvstam"."Lejemaal", "rekvstam"."Lejer", "rekvstam"."Udfoertaf", "rekvstam"."Udfoertdato", "rekvstam"."Krit", "Selskab"."Adresse", "Selskab"."Postby", "Selskab"."Tlf", "Selskab"."Fax", "rekvstam"."Kontor", "rekvstam"."Hjemme", "rekvstam"."Rekvdato", "rekvstam"."Aftale", "rekvstam"."InitialRet", "rekvstam"."Arbejde", "kreditor"."Att", "rekvstam"."Konto", "Selskab"."Navn", "Selskab"."Email", "Interessentadresse"."Navn", "Interessentadresse"."Adresse", "Interessentadresse"."Postby", "Interessentadresse"."Email1", "Interessentadresse"."Telefon_Fax", "Interessentadresse"."Type", "Interessentadresse"."Tlf1", "rekvstam"."tlfLejer", "kreditor"."Kred", "Interessentadresse"."Interessentnr" FROM  (("Rekvstam" "rekvstam" INNER JOIN "Selskab" "Selskab" ON "rekvstam"."Sel"="Selskab"."Sel") LEFT OUTER JOIN "Kreditor" "kreditor" ON "rekvstam"."Kred"="kreditor"."Kred") INNER JOIN "Interessentadresse" "Interessentadresse" ON "kreditor"."Interessentnr"="Interessentadresse"."Interessentnr" WHERE  "Interessentadresse"."Type"='K'
    But it should not be necessary to include this field (which is the primary key and used in linking the report) in the sql statement,
    BECAUSE it is not used in the report. So maybe this is a bug?
    It has not been necessary in RDC Crystal Report or RAS Crystal Report in a classic asp envoriment.
    Here is the code we use to set the reports SQL Statement)
    Try
    Dim conn As New SqlConnection(connString)
    conn.Open()
    Dim sd As New SqlDataAdapter(New SqlCommand(nySQL, conn))
    Dim ds As New Data.DataSet()
    Dim navn As String = report.Database.Tables.Item(0).Name
    sd.Fill(ds, navn)
    report.SetDataSource(ds)
    conn.Close()
    Catch ex As Exception
    Throw
    End Try

    Hi Jan
    I understand your problem completely but we have asked  R&D to be able to edit the SQL and they explained due to how the report Engine works it's simply not possible anymore. It would take a complete rewrite in all of our DB drivers and query dll's to be able to allow it. They did that in CR 9 when they rewrote the DB drivers and removed the SQL part of the code into separate dll's and that is when the ability was removed, it's been that way ever since.
    One possibility is to get the SQL from the Report and then connect to your DB using a .NET and if the results from the SQL is less than 5K rows and not too many columns you could then set the Report data source to a Dataset.
    As long as all of the field names are the same CR will run the report using this work flow.
    For data larger than 5K rows, limit is due to memory resources, you could save the DS to an XML file and then set the reports data source to the XML file. We've seen 100meg XML's used so the amount of data should not be a problem, but of course there are limits to everything so test...
    This should not affect performance much.
    So the work flow would be:
    Load the report
    Get the SQL Statement
    Paste it into a Dataset Query
    Something like this should get you started:
    //string connString = "Provider=SQLOLEDB;Data Source=MySQLServer;Database=xtreme;User ID=sa;Password=pw";
    string connString = "Provider=SQLNCLI10;Server=MySQLServer;Database=xtreme;User ID=sa;Password=pw";
    Detail"".""Quantity"" FROM   ""xtreme"".""dbo"".""Orders Detail"" ""Orders Detail""";
    string sqlString = @"SELECT top 10*  FROM  ""xtreme"".""dbo"".""Financials"" ""Financials""";
    System.Data.OleDb.OleDbConnection oleConn = new System.Data.OleDb.OleDbConnection(connString);
    System.Data.OleDb.OleDbCommand cmd = oleConn.CreateCommand();
    cmd.CommandText = sqlString;
    System.Data.DataSet ds = new System.Data.DataSet();
    OleDbDataAdapter oleAdapter = new OleDbDataAdapter(sqlString, oleConn);
    //OleDbDataAdapter oleAdapter2 = new OleDbDataAdapter(sqlString2, oleConn);
    DataTable dt1 = new DataTable("Financials");
    //DataTable dt2 = new DataTable("Orders Detail");
    oleAdapter.Fill(dt1);
    //oleAdapter2.Fill(dt2);
    ds.Tables.Add(dt1);
    //ds.Tables.Add(dt2);
    ds.WriteXml("c:\\reports\\sc2.xml", XmlWriteMode.WriteSchema);
    // as long as the field names match exactly Cr has no problems setting report to a DS.
    try
        rpt.SetDataSource(ds.Tables[0]); // incremtent [0] for more than 1 table.
        rpt.SetDataSource(ds);
    catch (Exception ex)
        MessageBox.Show("ERROR: Schema Mismatch. Error reported by CR: " + ex.Message);
    //Now check for subreport and set to same DS
    foreach (CrystalDecisions.CrystalReports.Engine.Section section in rpt.ReportDefinition.Sections)
        foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)
            if (reportObject.Kind == ReportObjectKind.SubreportObject)
                CrystalDecisions.CrystalReports.Engine.SubreportObject subReport = (CrystalDecisions.CrystalReports.Engine.SubreportObject)reportObject;
                CrystalDecisions.CrystalReports.Engine.ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);
                subDocument.SetDataSource(ds);
    And for XML it would use this part, not above I am saving the data and structure in the XML file so it should match what is in the report:
    foreach (CrystalDecisions.CrystalReports.Engine.Table rptTable in rpt.Database.Tables)
        try
            rptTable.Location = btrDataFile.ToString(); // @"D:\Atest\" + rptTable.Location + ".xml";
        catch (Exception ex)
            MessageBox.Show("ERROR: " + ex.Message);
    Only issue you may run into is sometimes XML does not have a direct field type and your original data source but you'll get an error if that happens which could be trapped and handled.
    If you have a report that only uses 2 tables I do have code that will convert it to use a Command Object. That is the limit the engine is capable of, there is a lot of logic to be able to do this in CRD and the SDK so that is all we could get for now.
    I hope that helps
    Don

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • SQL Server 2012 Management Studio: Creating a Database and a dbo Table. Inserting VALUES into the table. How to insert 8 Values for future use in XQuery?

    Hi all,
    In my SQL Server 2012 Management Studio (SSMS2012), I tried to create a Database (MacLochainnsDB) and a dbo Table (marvel). then I wanted insert 8 VALUES into the Table by using the following code:
    USE master
    IF EXISTS
    (SELECT 1
    FROM sys.databases
    WHERE name = 'MacLochlainnsDB')
    DROP DATABASE MacLochlainnsDB
    GO
    CREATE DATABASE MacLochlainnsDB
    GO
    CREATE TABLE [dbo].[marvel] (
    [avenger_name] [char] (30) NULL)
    INSERT INTO marvel
    (avenger_name)
    VALUES
    ('Hulk', 1),
    ('Iron Man', 2),
    ('Black Widow', 3),
    ('Thor', 4),
    ('Captain America', 5),
    ('Hawkeye', 6),
    ('Winter Soldier', 7),
    ('Iron Patriot', 8)
    I got the following error Message:
    Msg 110, Level 15, State 1, Line 5
    There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
    How can I correct this problem?
    Please kindly help and advise.
    Thanks in advance,
    Scott Chang
    P. S.
    The reason I tried to create the Database, dbo Table, and then to insert the VALUES is to learn the following thing:
    You can query the entire node tree with the following xquery statement because it looks for the occurrence of any node with the /* search string:
    DECLARE @x xml;
    SET @x = N'<marvel>
    <avenger_name>Captain America</avenger_name>
    </marvel>';
    SELECT @x.query('/*');
    You can query the avenger_name elements from the marvel_xml table with the following syntax:
    SELECT xml_table.query('/marvel/avenger_name')
    FROM marvel_xml;
    It returns the following set of avenger_name elements:
    <avenger_name>Hulk</avenger_name>
    <avenger_name>Iron Man</avenger_name>
    <avenger_name>Black Widow</avenger_name>
    <avenger_name>Thor</avenger_name>
    <avenger_name>Captain America</avenger_name>
    <avenger_name>Hawkeye</avenger_name>
    <avenger_name>Winter Soldier</avenger_name>
    <avenger_name>Iron Patriot</avenger_name>
    You can query the fourth avenger_name element from the marvel_xml table with the following xquery statement:
    SELECT xml_table.query('/marvel[4]/avenger_name')
    FROM marvel_xml;
    It returns the following avenger_name element:
    <avenger_name>Thor</avenger_name>

    Hi Scott,
    The master database records all the system-level information for a SQL Server system, so best practise would be not to create any user-defined
    object within it.
    To change your default database(master by default) of your login to another, follow the next steps so that next time when connected you don't have to use "USE dbname" to switch database.
    Open SQL Server Management Studio
    --> Go to Object explorer(the left panel by default layout)
    --> Extend "Security"
    --> Extend "Logins"
    --> Right click on your login, click "propertites"
    --> Choose the "Default database" at the bottom of the pop-up window.
    --or simply by T-SQL
    Exec sp_defaultdb @loginame='yourLogin', @defdb='youDB'
    Regarding your question, you can reference the below.
    SELECT * FROM master.sys.all_objects where name ='Marvel'
    --OR
    SELECT OBJECT_ID('master.dbo.Marvel') --if non empty result returns, the object exists
    --usually the OBJECT_ID is used if a if statement as below
    IF OBJECT_ID('master.dbo.Marvel') IS NOT NULL
    PRINT ('TABLE EXISTS') --Or some other logic
    What is the sys.all_objects? See
    here.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to use presentaion variable in the SQL statement

    Is there any special syntax to use a presentation variable in the SQL Statement?
    I am setting a presentation variable (Fscl_Qtr_Var)in the dashboard prompt.
    If i set the filter as ADD->VARIABLE->PRESENTATION, it shows the statement as 'Contract Request Fiscal Quarter is equal to / is in @{Fscl_Qtr_Var} '.
    And this works fine but when i convert this to SQL, it returns
    "Contract Request Date"."Contract Request Fiscal Quarter" = 'Fscl_Qtr_Var'
    And this does not work.It is not being set to the value in the prompt.
    I need to combine this condition with other conditions in the SQL Statement. Any help is appreciated. Thanks

    Try this: '@{Fscl_Qtr_Var}'

  • How to view the SQL statement generated during execution of the BW Query?

    Dear Experts,
    I am trying to retrieve data in a SAP BW Query from a Non-SAP system.
    I think if I am able to see the complete SQL statement that was generated when I executed the BW Query, I may be able to use it to retrieve the data.
    Do you know how and where I can see the SQL statement of a BW Query's SQL statement?
    I tried RSRT options to execute the Query but still could not find the SQL statement.
    Thanks in advance.
    Regards,
    Shunhui.

    hi
    goto rsrt
    give your query name
    select execute + debug option
    in the debug option under data manager check the check box "display SQL/BIA query
    selcet continue
    you can see the sql statement
    thanq

  • How to map AM method return values in the bean

    Hello -
    I have this requirement to map AM method return values in the bean as explained below. Please suggest a solution.
    Scenario: I am calling an AM method, which returns a String object on page load.
    AMImpl Method-
    public String getProfileName (){
    return "Profile";
    I wish to catch this retun value in the Bean Variable on page Load. I have created a methodAction biding on page and invokeAction to call this method on Page Load, but I don't know how to catch this value in the bean. Please suggest how to achieve this. Also, I need to achieve this in jsp page. I can't use TaskFlow for this.
    I am using ADF 11g.
    Regards -
    Rohit
    Edited by: Rohit Makkad on Apr 21, 2010 12:23 AM

    Hi, I think there are two ways, from the data control drag n drop the methods return value to the page. This way a binding for that will be created at the page definition eg retVal.
    and in the backing bean you can access it by calling resolveExpression("#{bindings.retVal.inputValue}")
    You can also call your method directly from the backbean
    ((YourAppModuleImpl) getBindings().getDataControl().getApplicationModule()).yourMethod();
    public DCBindingContainer getBindings() {
    return (DCBindingContainer) resolveExpression("#{bindings}");
    I dont know if the second method suits you
    Tilemahos

  • How Can I Retrieve SQL Statement From The User ?

    Hi
    I want to know, how can I make the user can enter the SQL statement from himself ?? in this code he can't enter it. Only he can display the SQL that i wrote it...
    this is my Code:
    import java.sql.*;
    public class db_testing {
         static final String DRIVER = "com.mysql.jdbc.Driver";            
         static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
         public static void main(String[] args) {
              Connection cn=null;
              Statement st= null;
              ResultSet rset=null;
              try{
                   Class.forName(DRIVER);
                   cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
                   st=cn.createStatement();
                   rset=st.executeQuery("select * from employee");
                   ResultSetMetaData metadata=rset.getMetaData();
                   System.out.println("The begining: ");
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(metadata.getColumnName(i)+"\t");
                   System.out.println();
                   System.out.println();
                   while(rset.next()){
                   for(int i=1;i<=metadata.getColumnCount();i++)
                   System.out.print(rset.getObject(i)+"\t\t");
                   System.out.println();}
              catch(Exception e){
                   e.printStackTrace();
              finally{
                   try{
                   cn.close();
                   st.close();
                   rset.close();
                   catch(Exception e1){
                        e1.printStackTrace();
    }

    The following changes in the code will make the user to give the input
    import java.sql.*;
    public class db_testing {
    static final String DRIVER = "com.mysql.jdbc.Driver";
    static final String DATABASE_URL = "jdbc:mysql://localhost/S204111933";
    public static void main(String[] args) {
    Connection cn=null;
    Statement st= null;
    ResultSet rset=null;
    try{
    Class.forName(DRIVER);
    cn=DriverManager.getConnection(DATABASE_URL, "root", "admin");
    // st=cn.createStatement();
    // rset=st.executeQuery("select * from employee");
    PreparedStatement pstmt=null;
    pstmt=cn.prepareStatement("select * from employee where id=?");
    pstmt.setInt(1,Integer.parseInt(args[0]));
    rset=pstmt.executeQuery();
    ResultSetMetaData metadata=rset.getMetaData();
    System.out.println("The begining: ");
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(metadata.getColumnName(i)+"\t");
    System.out.println();
    System.out.println();
    while(rset.next()){
    for(int i=1;i<=metadata.getColumnCount();i++)
    System.out.print(rset.getObject(i)+"\t\t");
    System.out.println();}
    catch(Exception e){
    e.printStackTrace();
    finally{
    try{
    cn.close();
    st.close();
    rset.close();
    catch(Exception e1){
    e1.printStackTrace();
    }

  • How to write the sql statement of my finder function in cmp?

    hi,
    I create a cmp ejb from table INFOCOLUMN,and I create a my finder function ,which sql statement is :
    select * from INFOCOLUMN WHERE employee_id=id
    employee_id is a column of the table,and id is the finder function parameter.
    The error is : invalid column name
    So,how to write the sql statement.
    Thanks .

    Mole-
    Bind variables are of the form $1, $2, etc., so your query stmt should look like:
    select * from INFOCOLUMN WHERE employee_id=$1
    -Jon

Maybe you are looking for

  • Converting HTML to PDF substitutes fonts

    Hello! On one of our workstations that is running Acrobat 9 Pro, whenever the user converts from an HTML document to a PDF for proofing purposes, we're getting different fonts in the output to than we had in the input. For example, any text in Arial

  • Keep getting error message unknown error -15000

    Same as title

  • PSE 12- Loading ASL files

    Just got PSE 12, I have added mutliple brushes without difficulty. But I can not get the ASL files I want to add to show up. I have loaded them into the correct folder in presets but they are not showing when I open 12. Any help? DGGallery

  • Help in Normalization

    Hi All, i have tow table "Student","Teacher". I want to Build "Many to many" relationship between these two table. At the time of table creation , how i implements Many to may relationship Thanks in Advance

  • Data Flow from Drop Down and Visibility

    Hello VCers, I am building a sample VC app, where I have one iView and two forms, "Country Selection" and "Country Results". Initially "Country Selection" form only will be visible and "Country Results" for will be invisible. In the First form, I wan