Help with test case

Hi,
I'm trying to produce a test case for a subtle problem, but can't get a
simple one to work :-(
I think I'm doing something wrong:
Source:
package kodo;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Properties;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import junit.framework.TestCase;
public class KodoTest1 extends TestCase
* @param id
public KodoTest1(String id)
super(id);
public void test1() throws Exception
PersistenceManagerFactory pmf = getFactory();
PersistenceManager pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
A a = new A();
a._b = new ArrayList();
pm.makePersistent(a);
Object aId = JDOHelper.getObjectId(a);
B b = new B();
b._parent = a;
a._b.add(b);
pm.currentTransaction().commit(); // looks good after this -- _b is
a ProxyLinkedList
pm.close();
pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
A aClone = (A) pm.getObjectById(aId, false);
assertNotNull(aClone);
Collection c = aClone._b;
assertNotNull(c); // fails
assertEquals(1,aClone._b.size());
pm.currentTransaction().commit();
private static PersistenceManagerFactory getFactory() throws Exception
InputStream propStream =
KodoTest1.class.getResourceAsStream("/kodo-local.properties");
Properties props = new Properties();
props.load(propStream);
return JDOHelper.getPersistenceManagerFactory(props);
package.jdo:
<?xml version="1.0"?>
<jdo>
<package name="kodo">
<class name="B"/>
<class name="A">
<field name="_b">
<collection element-type="B"/>
<extension vendor-name="kodo" key="inverse" value="_parent"/>
</field>
</class>
</package>
</jdo>
kodo-local.properties:
javax.jdo.option.RetainValues: true
javax.jdo.option.RestoreValues: true
javax.jdo.option.Optimistic: true
javax.jdo.option.NontransactionalWrite: false
javax.jdo.option.NontransactionalRead: true
javax.jdo.option.Multithreaded: true
javax.jdo.option.MsWait: 5000
javax.jdo.option.MinPool: 1
javax.jdo.option.MaxPool: 80
javax.jdo.option.IgnoreCache: false
javax.jdo.option.ConnectionUserName: tomd
javax.jdo.option.ConnectionURL: jdbc:oracle:thin:@holygrail:1521:db1
javax.jdo.option.ConnectionPassword: password
javax.jdo.option.ConnectionDriverName: oracle.jdbc.OracleDriver
javax.jdo.PersistenceManagerFactoryClass:
com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory
com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure: true
com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass:
com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory
com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping: true
com.solarmetric.kodo.impl.jdbc.AutoReturnTimeout: 10
#com.solarmetric.kodo.Logger:
#stdout
# (Kodo 2.4 license key)
com.solarmetric.kodo.LicenseKey: xxxxxxxxxxxxxxxxxxxxxxx
com.solarmetric.kodo.EnableQueryExtensions: false
com.solarmetric.kodo.DefaultFetchThreshold: -1
com.solarmetric.kodo.impl.jdbc.DictionaryProperties:NameTruncationVersion=1
com.solarmetric.kodo.impl.jdbc.UseBatchedStatements=false
com.solarmetric.kodo.impl.jdbc.StatementCacheMaxSize=1

You should not be directly accessing fields of PersistenceCapable
instances or should enhance as Persistence aware:
e.g. jdoc kodo.KodoTest1.
However, I strongly recommend against this. It is bad object oriented
design to be exposing internal variables so (wrap at the least in a
get method). And in JDO, can easily cause strange behavior if not
handled correctly as you see in your test case.
Btw, I would recommend against packaging in kodo as we may be moving
towards simplifying our package structures into kodo prefixed packages.
On Wed, 18 Jun 2003 20:11:45 +1000, Tom Davies wrote:
Hi,
I'm trying to produce a test case for a subtle problem, but can't get a
simple one to work :-(
I think I'm doing something wrong:
Source:
package kodo;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Properties;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import junit.framework.TestCase;
public class KodoTest1 extends TestCase {
* @param id
public KodoTest1(String id)
super(id);
public void test1() throws Exception
PersistenceManagerFactory pmf = getFactory(); PersistenceManager pm =
pmf.getPersistenceManager(); pm.currentTransaction().begin();
A a = new A();
a._b = new ArrayList();
pm.makePersistent(a);
Object aId = JDOHelper.getObjectId(a); B b = new B();
b._parent = a;
a._b.add(b);
pm.currentTransaction().commit(); // looks good after this -- _b is
a ProxyLinkedList
pm.close();
pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
A aClone = (A) pm.getObjectById(aId, false); assertNotNull(aClone);
Collection c = aClone._b;
assertNotNull(c); // fails
assertEquals(1,aClone._b.size());
pm.currentTransaction().commit();
private static PersistenceManagerFactory getFactory() throws Exception
InputStream propStream =
KodoTest1.class.getResourceAsStream("/kodo-local.properties");
Properties props = new Properties();
props.load(propStream);
return JDOHelper.getPersistenceManagerFactory(props);
package.jdo:
<?xml version="1.0"?>
<jdo>
<package name="kodo">
<class name="B"/>
<class name="A">
<field name="_b">
<collection element-type="B"/>
<extension vendor-name="kodo" key="inverse" value="_parent"/>
</field>
</class>
</package>
</jdo>
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Help with test case compilation error

    I keep getting this error cant figure out why??
    Warning: compiled but with compilation errors
    Errors for PACKAGE BODY FF1_PKG
    LINE/COL ERROR
    *11/28 PLS-00386: type mismatch found at 'FF1_TB_OUT' between FETCH curs*
    or and INTO variables
    *11/1 PL/SQL: SQL Statement ignored*
    --desc user_cons_columns
    drop type ff1_tb;
    drop type ff1_typ;
    create or replace type ff1_typ as object( tb varchar2(30),col varchar2(4000));
    create or replace type ff1_tb as table of ff1_typ;
    desc user_cons_columns
    create or replace package ff1_pkg is
    function ff1 (rownumx number) return ff1_tb;
    maxrow number default 10000;
    cursor c1(p_rownum number) is select table_name,column_name from user_cons_columns where rownum < p_rownum;
    end ff1_pkg;
    show errors;
    CREATE OR REPLACE PACKAGE BODY ff1_pkg IS
    function ff1(rownumx number) return ff1_tb is
    ff1_tb_out ff1_tb;
    begin
    open c1(rownumx);
    loop
    fetch c1 bulk collect into ff1_tb_out limit maxrow;
    exit when c1%notfound;
    end loop;
    return ff1_tb_out;
    end;
    end ff1_pkg;
    show errors;

    but it works when do a using cast(multiset())?? why??
    --desc user_cons_columns
    drop type ff1_tb;
    drop type ff1_typ;
    create or replace type ff1_typ as object( tb varchar2(30),col varchar2(4000));
    create or replace type ff1_tb as table of ff1_typ;
    desc user_cons_columns
    create or replace package ff1_pkg is
    function ff1 (rownumx number) return ff1_tb;
    maxrow number default 10000;
    cursor c1(p_rownum number) is select table_name,column_name from user_cons_columns where rownum < p_rownum;
    end ff1_pkg;
    show errors;
    CREATE OR REPLACE PACKAGE BODY ff1_pkg IS
    function ff1(rownumx number) return ff1_tb is
    ff1_tb_out ff1_tb;
    begin
    select cast( multiset(select table_name,column_name from user_cons_columns where rownum < rownumx  ) as ff1_tb)  into ff1_tb_out from dual;
    open c1(rownumx);
    loop
    fetch c1 bulk collect into ff1_tb_out limit maxrow;
    exit when c1%notfound;
    end loop;
    return ff1_tb_out;
    end ff1;
    end ff1_pkg;
    show errors;

  • Help with "Testing Failed" Error message in iWeb09

    I bought the iLife 09 upgrade purely so I could publish to my own domain server. I have a MobileMe account and iWeb09 publishes fine there--no problems.
    My domain name is hosted on a Windows NT server. The admin is willing to help, but I was hoping someone could point me to documentation for this error:
    "Testing Failed.
    Unable to write to server. Verify your settings and try again."
    If I ftp to the site in a terminal window and do a put, I can write to the site. Obviously, I could at some point, because it servers the "dummy" page I put up, but I tested again in case my permissions had changed.
    I looked at the "Publishing to Windows-based FTP Server" but it does not seem to describe this error.
    BTW, I pay AppleCare for support, but when I tried to get support documentation from them, the tech said they "can't help" with this part of iWeb and hung up on me--the call lasted exactly 90 seconds.
    I am hoping someone out here will know where the errors are documented or will be able to help me figure it out.

    I waded through the posts for iWeb09 and came across a recommendation for Cyberduck (www.cyberduck.ch), so I tried a copy. Works like a champ. Unlike iWeb09, all I had to do was type in my server name, user name, and password to open the connection. Then I published my site to a folder in iWeb and uploaded the folder in Cyberduck. Cyberduck had no problem writing to the server.
    I still would love to know why iWeb can't write to my web server.

  • Need help with testing a package with Junit

    Hi guys,
    I am currently testing a bunch of files under a particular package. I have compiled all the files in this package successfully. I have written a testcase file which is in the folder above the package folder. I am using Junit to test this. I am getting errors stating that Java cannot find the package.
    To explain in detail.....My package name is coinbox which contain some classes which need to be tested. These files are in the folder "coinbox". My testcase file is in the folder which is directly above this folder. My testcase file has the statement import coinbox.* which will import all the classes in the coinbox package;
    But I am getting an error stating that the package coinbox cannot be found. I tried adding the package path to the CLASSPATH variable but still it isnt working.
    The command am using to run the Junit test cases is as follows:
    javac -cp junit.jar;junit.samples.CoinBoxTest-d CoinBoxTest.java
    Any help or suggestions regarding will be appreciated. The coinbox package is not being detected by java.
    Thanks in advance.
    Edited by: calvin_nr on Sep 30, 2007 5:12 PM

    It smells like a classpath problem. Post a sample of the code you are testing, the package statement in particular and the directory structure where the .class files are.

  • Help with a CASE statement

    Please help me with a CASE Statement:
    - When ID = 15, 16, 17, 18 then "Bad"
    - when ID = 19, then "Average"
    - when ID = 21, then "Good"
    - else "Null"
    Thank you!!

    Well the 1st thing to do would be to correct my poor spelling... change    Delault : to Default :
    Don't know why you would get an error stating "The result of selection formula must be a boolean". It's working fine on my machine.
    If your ID field is numbers stored text you have a couple different options...
    1) Convert the ID to a number...
    Select  ToNumber({home.noone_ID})
    2) Wrap the ID values in double quotes...
       Case "15", "16", "17", "18" :
          "BAD"
    Even if this were your problem... the error should be something other than the boolean thing...
    Jason

  • Need help with upper case

    I'm stuck on my coding when I have to write a function to
    detect upper cases has been used in a sentence
    For example if my array element has this:
    2345
    SAINT PAUL
    STREET
    APT 5
    PHILADELPHIA
    I need to be able to write a code to let me know that the 2nd
    OR 3rd OR 5th element is written in upper case letter
    Or if I set the variable not as array, 2345 SAINT PAUL STREET
    APT 5 PHILADELPHIA
    I need to be able to detect that at least one of the section
    on that street name is written with upper case
    Can anyone help please?

    compare() cf function performs a case-sensitive comparison of
    2 strings
    and returns 0 is the strings are the same. so you can compare
    an
    uppercase version of the string to the original string, and
    if the
    comparison returns 0 then your string is in uppercase:
    <cfif compare(ucase(myarray[2]), myarray[2]) is 0>
    <!--- the string in myarray[2] IS in uppercase --->
    <cfelse>
    <!--- it is NOT in uppercase --->
    </cfif>
    the above code compares the value of the second array element
    converted
    to uppercase to the original value of the second array
    element. if the
    result is 0, i.e. the uppercase and original strings are the
    same, then
    you know the original string is in uppercase.
    if you are dealing with a single string (which is equivalent
    to a
    space-delimited list), then use appropriate list function to
    get
    required list element, i.e. listfirst(), listlast(),
    listgetat()...
    <cfif compare(ucase(listlast(mylist, " ")),
    listlast(mylist, " ")) is 0>
    <!--- the last element in the list IS in uppercase --->
    <cfelse>
    <!--- it is NOT in uppercase --->
    </cfif>
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Help with multiple case statements

    Hello,
    I am new to BO.  I am on XI 3.0.  SQL 2005.  In Designer, I am trying to create a measure in a financial universe that would end up being multiple case statements within one select.  This is what I tried to do, but it doesn't work with the two case statements.  Can I use an ELSE leading into the second CASE WHEN somehow?  How can I accomplish this?  Sorry for my ignorance!
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 12 THEN dbo.ClientBudgetMonth.Stage1Sales END
    CASE WHEN  dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 11 THEN dbo.ClientBudgetMonth.Stage1Sales END
    Any Suggestions?
    Thanks,
    Holly

    Holly,
    I don't know enough about your data or requirement to provide a solution, however, the construct that you post will not work because it causes you to build an object with multiple case statements when only one case statement per object is permitted.  From what I see in your code I would be inclined to combine the two statements into one as such:
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month in (11,12) THEN dbo.ClientBudgetMonth.Stage1Sales else null END
    Thanks,
    John

  • Help with testing a live jee application...

    I cant figure this out..
    I am using netbeans and my JEE application seems to work fine in the netbeans IDE. I then move to the glassfish v2 server and deploy the .ear which contains
    a single war with sevlet and jsp's. Testing a live version of war works 100% as intended but issues occur when running my app-client and the following is thrown...
    yucca@yucca-laptop:~/Desktop$ java -jar CCDEnterprise-app-client.jar
    Sep 5, 2009 2:46:19 PM ccd.client.gui.ApplicationStarter$1 uncaughtException
    SEVERE: ccd/domain/utilities/PhoneType
    java.lang.NoClassDefFoundError: ccd/domain/utilities/PhoneType
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
         at java.lang.Class.getDeclaredMethod(Class.java:1935)
         at java.awt.Component.isCoalesceEventsOverriden(Component.java:5948)
         at java.awt.Component.access$500(Component.java:169)
         at java.awt.Component$3.run(Component.java:5902)
         at java.awt.Component$3.run(Component.java:5900)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Component.checkCoalescing(Component.java:5899)
         at java.awt.Component.<init>(Component.java:5868)
         at java.awt.Container.<init>(Container.java:251)
         at java.awt.Window.<init>(Window.java:430)
         at java.awt.Frame.<init>(Frame.java:403)
         at javax.swing.JFrame.<init>(JFrame.java:207)
         at ccd.client.gui.MainWindow.<init>(MainWindow.java:121)
         at ccd.client.gui.ApplicationStarter.<init>(ApplicationStarter.java:92)
         at ccd.client.gui.ApplicationStarter.<init>(ApplicationStarter.java:53)
         at ccd.client.gui.ApplicationStarter.main(ApplicationStarter.java:42)
    Caused by: java.lang.ClassNotFoundException: ccd.domain.utilities.PhoneType
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
         ... 18 moreMy classpaths, paths are all set as follows:
    JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.14"
    CLASSPATH="/home/yucca/SUNWappserver/lib/j2ee.jar"
    JDK_HOME="/usr/lib/jvm/java-6-sun-1.6.0.14"
    IDEA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.14"I keep getting no class def found and have tried various workarounds but too much hacking away has lead me to believe that something needs attention...
    Any help or suggestions would be appreciated.

    The %CLASSPATH% environment variable is totally ignored by anything else than the java/javac without the -cp, -classpath and -jar arguments.
    In case of a webapplication, you need to include third party libraries in WEB-INF/lib.

  • Need help with switch/case

    Thanks in advance.
    I read the tut on switch statements. My assignment is asking me to do something that is not detailed in that explanation ;
    I have a total of 5 case statements, 1-4 and a default statement. The instructions for them are as follows:
    Case 1: If the user enters a 1, display a message that informs users they are correct, as any input canbe saved as a String. Enter the break statement.
    Case 2: If the user enters a 2, parse the value into tryInt. Display as message that informs the users they are correct. Enter the break statement.
    Case 3. If they user enters a 3, parse the value into tryDouble. Display a message tha t informs users they are correct. Enter the break statement.
    Case 4: Set done equal to true. Enter code to display a closing message. Enter a break statement.
    Case default: throw a new NumberFormatException.;
    Here is the code
    import java.io.*;
    import javax.swing.JOptionPane.*;
    public class MyType1
         public static void main(String[] args)
              //declaring variables
              String strChoice, strTryString, strTryInt, strTryDouble;
              int choice, tryInt;
              double tryDouble;
              boolean done = false;
              //loop while not done
              while (!done)
                   try
                        choice = Integer.parseInt(strChoice);
                        switch(choice)
                             case 1:
                                  JOptionPane.showMessageDialog(null,"You are correct!");
                                  break;
                             case 2:
                                  choice = Integer.parseInt(tryInt); JOptionPane.showMessageDialog(null,"You are correct!");
                                  break;
                             case 3:
                                  choice = Double.parseDouble(tryDouble);
                                  JOptionPane.showMessageDialog(null,"You are correct!");
                                  break;
                             case 4:
                                  done = true; JOptionPane.showMessageDialog(null,"Goodbye!");
                                  break;
    As usual Im doing something wrong. Please help.

    Thanks for your input. The directions for the assignment tells me to first declare the variables.
    Begin a while(!done) loop to repeat as long as teh user does not click the Cancel button.
    Inside a try statement, enter code to display an input box with three choices.
    Type choice = Integer.parseInt(strChoice); on the next line to parse the value for the choice entered by the user.
    (HERE THE SWITCH STATEMENT WITH CAST STATEMENTS)
    Close the switch statement with brackets
    Create a catch statement.
    import java.io.*;
    import javax.swing.JOptionPane.*;
    public class MyType1
         public static void main(String[] args)
              //declaring variables
              String strChoice, strTryString, strTryInt, strTryDouble;
              int choice, tryInt;
              double tryDouble;
              boolean done = false;
              //loop while not done
              while (!done)
                   try
                        String message = "What is My Type:" + "\n\n1) String\n2)Integer\n3)double\n4)Quit the program\n\n";
                        choice = Integer.parseInt(strChoice);
                        //test for valid choice 1, 2, 3, or 4
                        if (choice<1 || choice>4) throw new NumberFormatException();
                        else done = true;
                        switch(choice)
                             case 1:
                                  JOptionPane.showMessageDialog(null,"You are correct!");
                                  break;
                             case 2:
                                  choice = Integer.parseInt(tryInt); JOptionPane.showMessageDialog(null,"You are correct!");
                                  break;
                             case 3:
                                  choice = Double.parseDouble(tryDouble);
                                  JOptionPane.showMessageDialog(null,"You are correct!");
                                  break;
                             case 4:
                                  done = true; JOptionPane.showMessageDialog(null,"Goodbye!");
                                  break;
                   catch (NumberFormat Exception e)
                        JOptionPane.showMessageDialog(null, "Please enter a 1, 2, 3 or 4:",  "Error", JOptionPane.INFORMATION_MESSAGE);
              }Typing this now, I see I dont have anything in my try statement entering code to display an input box with three choices.
    (PS. I know I would write a catch statement for the NumberFormatException, but why would I also write this exception in the case statement also??)

  • Help with testing MultitouchInputMode without installing on phone

    I am sure there is an easy answer that I am over looking.  But would someone please help me.
    I am programming with Flash 5.5.  My app uses MultitouchInputMode.TOUCH_POINT and I would like to be able to test without having to create the ipa, move to iTunes and install on iPhone.
    I tried to get Adobe Device Central to emulate the iPhone but could not seem to get it set up correctly to do this.
    Can you point me to a specific tutorial or give a few steps in the right direction?  Thank you for your help!
    Grace & Peace,
    jim

    Device Central will not work for that use case. Although it does support emulation of multi-touch, it is only for browser based content.
    You are going to have to install your .ipa on a device to properly test it.
    Good luck,
    Chris

  • Help with Test Server & Binding Recordset ASP-SQL

    Using CS 3.3/DW. Behavior is the same on two different
    machines. One is Vista Home Premium SP1 IIS 7 with 6 compatability,
    other is XP SP 3 IIS 5.1, both have IE 7 and full SQL 2005 with
    SP's.
    Haven't gotten very far away from static page yet, because I
    can't test. Have scoured forums and even talked to Adobe who
    recreated the problem then told me that they hadn't done sufficient
    testing to SQL 2005 prior to release, were supposed to call me
    back, did once, supposed to call back again and haven't (3 days).
    So I'm turning to the community for help, please.
    Set up test server in folder 'TServer' under
    C:\inetpub\wwwroot. Built a 'Hello World' ASP/VB Script page with
    no data attached, tests fine, puts in the appropriate folder and
    says "Hello World" in browser like a good little box should! Have
    built many DSN's, they tested during the building fine, I've tried
    various versions of ODBC and OLE DB, including but not limited to
    Native SQL Client, which is my preference and have been quite
    successful setting up the DSN's...they add to the ASP page/Site
    (it's greyed out unless you have an open ASP page) fine. Test at
    that point works fine. As soon as I bind a Recordset (whether I
    have dropped data on the page or not...same 'Hello World' page with
    Recordset info near the top of the code) and test, I error out.
    Any thoughts? I'm sure you'll need more info...I've tried to
    put as much as I can for starters. Thanks in advance.
    Peter

    When you say that you error out, what error are you getting?
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "Peter AZ" <[email protected]> wrote in
    message news:g5qb7n$n30$[email protected]..
    > Using CS 3.3/DW. Behavior is the same on two different
    machines. One is Vista
    > Home Premium SP1 IIS 7 with 6 compatability, other is XP
    SP 3 IIS 5.1, both
    > have IE 7 and full SQL 2005 with SP's.
    >
    > Haven't gotten very far away from static page yet,
    because I can't test. Have
    > scoured forums and even talked to Adobe who recreated
    the problem then told me
    > that they hadn't done sufficient testing to SQL 2005
    prior to release, were
    > supposed to call me back, did once, supposed to call
    back again and haven't (3
    > days). So I'm turning to the community for help, please.
    >
    > Set up test server in folder 'TServer' under
    C:\inetpub\wwwroot. Built a
    > 'Hello World' ASP/VB Script page with no data attached,
    tests fine, puts in the
    > appropriate folder and says "Hello World" in browser
    like a good little box
    > should! Have built many DSN's, they tested during the
    building fine, I've tried
    > various versions of ODBC and OLE DB, including but not
    limited to Native SQL
    > Client, which is my preference and have been quite
    successful setting up the
    > DSN's...they add to the ASP page/Site (it's greyed out
    unless you have an open
    > ASP page) fine. Test at that point works fine. As soon
    as I bind a Recordset
    > (whether I have dropped data on the page or not...same
    'Hello World' page with
    > Recordset info near the top of the code) and test, I
    error out.
    >
    > Any thoughts? I'm sure you'll need more info...I've
    tried to put as much as I
    > can for starters. Thanks in advance.
    >
    > Peter
    >
    >

  • Need some help with a case statement implementation

    I am having trouble using a CASE statement to compare values and then display the results. The other issue is that i want to put these results in a separate column somehow.
    Heres how the code would look:
    SELECT "Task"."Code",
    "Stat" = CASE WHEN "Task.Code" = 1 THEN string
    ....and so on
    I wanted to make "Stat" the new column for the results, and string represents the string to be assigned if 1 was the value for code. I keep getting syntax error, any help would be nice.

    This is a lot easier than you might think.
    1) First, move another column of "Code" to your workspace.
    2) Click on the fx button and then on the BINS tab.
    3) Click on "Add BIN" and with the operand on "is equal to/is in," input 1 and then click "OK."
    4) Name this what you had for "string."
    Repeat for all the different values you want to rename as another "string" value.
    5) Finally, check the "custom heading" checkbox, and rename this column "Stat" as you indicated.
    That's it.

  • Help with a CASE!!!

    I did started a thread about the same problem this morning but no one couldn't help.
    I tried to write it my self , well, still not working out. When i try to ran it, it just freezes........ORA-01652: unable to extend temp segment by 64 in tablespace TEMP
    Can someone please see where is my problem with CASE..Im trying to put a case statment into WHERE.........
    All I want is if the gl_tr_type = 'SO' then execute the rest in the case statment if the transaction is not 'SO' or 'WE' then cust_name would be blank.......If it's blank then i need N/A inserted there
    This is what i need
    WHEN gl_tr_type = 'SO' and a.gl_doc = inv_nbr
    AND h.inv_cust_bill_to_nbr = g.cust_nbr
    and
    WHEN gl_tr_type = 'WE' and a.gl_doc = inv_code
    AND h.inv_cust_bill_to_nbr = g.cust_nbr
    Thank-you very much!!!!
    SELECT
    b.en_ent,
    e.sa_sub,
    c.cc_cstctr,
    d.acct_acc,
    b. EN_ENTITY_LNG,
    e. SA_SUB_LNG,
    c. COST_CTR_LNG,
    d. ACCT_ACC_LNG ,
              g. cust_name,
    f. FISCAL_MONTH,
    f. FISCAL_YEAR_LNG,
    d. ACCT_TYPE,
    SUM(a.gl_amt)
    FROM
    F_ACCT_TRX_HIST_STG1 a,
    D_ENTITY_STG2 b,
    D_COSTCTR_STG2 c,
    D_ACCTS_STG2 d,
    D_SUBACCTS_STG2 e,
    D_PERIOD_STG1 f,
    FINMART.D_CUSTOMER g,
    DSSMART.F_SALES_INVOICE h
    WHERE a.gl_eff_dt BETWEEN '02-april-2007' AND '15-april-2007' AND
    a.GL_ENT = b.EN_ENT AND
    c.CC_CSTCTR = UPPER (a.GL_CC) AND
    d.acct_acc = a.gl_acc AND
    e.sa_sub = a.gl_sa AND
    a.gl_eff_dt = f.calendar_date AND
    a.gl_doc =
    CASE WHEN a.gl_tr_type = 'SO'
    AND h.inv_cust_bill_to_nbr = g.cust_nbr
    THEN h.inv_nbr
    END
    GROUP BY b.EN_ENT, e.sa_sub, c.cc_cstctr, d.acct_acc,
    b. EN_ENTITY_LNG,
    e. SA_SUB_LNG,
    c. COST_CTR_LNG,
    d. ACCT_ACC_LNG ,
              g. cust_name,
    f. FISCAL_MONTH,
    f. FISCAL_YEAR_LNG,
    d. ACCT_TYPE

    Can someone please see where is my problem with
    CASE..Im trying to put a case statment into
    WHERE.........The select clause has a quite fixed structure, because it descripts the format of the result set, and the use of case statement add some more flexibility to this structure in order to make some changes to the result set that don't go in opposition with the output structure.
    SQL> select case
      2     when (rownum < 2) then
      3             1
      4     else
      5             sysdate
      6     end
      7  from dual
      8  connect by level < 5
      9  /
                    sysdate
    ERROR at line 5:
    ORA-00932: inconsistent datatypes: expected NUMBER got DATEThe where clause doesn't have such a fixed structure and has enought expressive power to implement any sort of condition.
    In your "case".
    WHERE
    CASE WHEN (( a.gl_tr_type = 'SO') AND (h.inv_cust_bill_to_nbr = g.cust_nbr)) THEN h.inv_nbr
    END
    /can be expressed with
    WHERE
    not(( a.gl_tr_type = 'SO') AND (h.inv_cust_bill_to_nbr = g.cust_nbr)) or (h.inv_nbr)
    /here is an example
    SQL> select rn,word
      2  from (
      3     select rownum as rn,to_char(to_date(rownum,'j'),'JSP') word
      4     from dual
      5     connect by level <= 10
      6  )
      7  where (not(rn <= 5) or ( length(word)=3 )) /*case  (rn < 5) then ( lenght(word)=3)*/
      8  /
            RN WORD
             1 ONE
             2 TWO
             6 SIX
             7 SEVEN
             8 EIGHT
             9 NINE
            10 TENBye Alessandro

  • Need Help With A Case Statement.

    Apex 3.2
    I currently have a report with the sql
    select oid oid,
    APEX_ITEM.MD5_CHECKSUM(oid, jobid, gdc, status)||
    apex_item.hidden(2,oid)||
    apex_item.display_and_save(3,jobid) jobid,
    apex_item.display_and_save(4,gdc) gdc,
    apex_item.display_and_save(5,bday) bday,
    num_rows num_rows,
    status current_status,
    APEX_ITEM.SELECT_LIST_FROM_LOV(6,status,'WORKLOAD_STATUS_FULL_LIST',null,'YES',null,'-Select-') new_status,
    case
        when status in ('TO_TABLE','ERROR_TABLE') then 'PREPARED'
        when status in ('TO_FILE','ERROR_FILE') then 'IN_TABLE'
        when status like '%SEND%' and status <> 'SEND_RENAME_OK' then 'IN_FILE'
        when trim(translate(status,'-1234567890',' ')) is null then to_char(jobid)
        else status
      end status_if_reset
    from scp_workload
    where jobid = :P28_JOBIDWhat I want to do is, if the result of status_if_reset column
    is not in ('PREPARED','EMPTY_FILE','IN_FILE','SEND_RENAME_OK','DEPRICIATED')
    then the new_status status column should be the APEX_ITEM.SELECT_LIST_FROM_LOV.
    If not it should just be status (normal report column)
    Hope I have explained properly
    Gus

    Your function had errors but maybe that was copy paste. The way you wrote your code is way to complicated. This should work for you:
    CREATE OR REPLACE FUNCTION fn_28_get_status (p_status IN VARCHAR2)
       RETURN NUMBER
    AS
       v_status   NUMBER;
    BEGIN
       IF    p_status IN
                ('TO_TABLE', 'ERROR_TABLE', 'TO_FILE', 'ERROR_FILE',
                 'SEND_RENAME_OK')
          OR p_status LIKE '%SEND%'
       THEN
          v_status := 1;
       ELSE
          v_status := 0;
       END IF;
       RETURN v_status;
    END fn_28_get_status;
    SELECT OID OID,
              apex_item.md5_checksum (OID, jobid, gdc, status)
           || apex_item.hidden (2, OID)
           || apex_item.display_and_save (3, jobid) jobid,
           apex_item.display_and_save (4, gdc) gdc,
           apex_item.display_and_save (5, bday) bday, num_rows num_rows,
           status current_status,
           CASE
              WHEN fn_28_get_status (status) = 1
                 THEN apex_item.select_list_from_lov
                                         (9,
                                          status,
                                          'WORKLOAD_STATUS_FULL_LIST',
                                          NULL,
                                          'YES',
                                          NULL,
                                          '-Select-'
              ELSE status
           END new_status
      FROM scp_workload
    WHERE jobid = :p28_jobidYou should not expect the others will debug you code. They don't have your objects to test.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • I need to find someone to help with a case # from a previous chat

    On 11/17 I chatted online with a gentleman for quite a while discussing a printhead issue. He gave me a case # and sent me new ink to try. That did not work and I have been trying to contact someone to resume the conversation. I was to;ld the printer would then have to be replaced. It is still under warranty. Now I cannot find any help online.

    I will ask to have an HP support agent contact you via private message.  Do not post any private information (including contact information, case ID's or serial numbers) in the forum here, but you can supply this to the agent in private message if requested.
    To access messages look for a number next to the envelope in the upper right of the page.  Click on the envelope to read messages.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

Maybe you are looking for

  • USB Host Controller not recognized by Windows 7.

    Just installed Windows 7 in a1130n desktop.  The USB Host Controller and the Std USB Host Controller are not recognized by the operating system.  The USB ports and the media memory ports on the front panel will not work.

  • Can Grid Control 10gR2 create a standby database when primary db uses ASM?

    Does anyone know if Grid Control 10gR2 will be able to create a standby database when the primary database uses ASM for data files, redo log files, and archive log files but the standby database will use mounted disks? If it can, would it matter that

  • Bad file system performance in OS X Mavericks

    After installing OS X Mavericks I experience bad file system performance approx. three times per day: Opening Finder and trying to a access a directory gets my MacBook Air (1.8 GHz Intel Core i7 4 GB 1333 MHz DDR3 with 250 GB Flash) stuck every appro

  • Using in operator with bindveriable

    Dear All, i facing proplem when i try to make SQL query using "in" operator but i send value as bind virable example Select emp.emp_id from emp where emp.emp_id in (:pEmpId) but when i execute it and enter value for the bind i didn't get the result .

  • Calendar won't update

    Help! The calendar on my iPod won't update when I connect my iPod photo 40 gig to my powerbook G4.