Question : Passing values from External table into a cursor

Hello,

I have values in an external table (col1, col2) which I want to pass into a cursor.  The cursor is part of a procedure.

CURSOR cTocc IS
SELECT DISTINCT TOCCID, TTORDIRNO FROM TOCCOBJD
WHERE OBJDID = <value from col1>
and OBJDBATCHREF= <value from col2>

Is it better to create a function to pass those values in? I've tried to use a SELECT INTO statement before the cursor, but the procedure doesn't seem to like that SELECT before the cursor.

Thanks

Answer : Passing values from External table into a cursor

Sorry, I don't know of an existing one, but if you use BigStringEditor and UITypeEditor for the "?"s, and define a class BigStringEditor as in the included code (sorry, I don't have VB.Net on my machine, but the code should be almost the same) then when you click in the property a "..." will appear (I think you need to set Browsable(true) also)  and if you click on that a 100x100 dialog will appear which will let you edit.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
public class BigStringEditor: UITypeEditor
    {
        public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
        {
            return UITypeEditorEditStyle.Modal;
        }

        IWindowsFormsEditorService editorService = null;

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                editorService =
                    provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            }

            if (editorService != null)
            {
                Form foo = new Form();
                TextBox tb = new TextBox();
                tb.Multiline = true;
                tb.Height = 100;
                tb.Width = 100;
                foo.Height = 100;
                foo.Width = 100;
                tb.Text = value.ToString();
                foo.Controls.Add(tb);
                editorService.ShowDialog(foo);
                return tb.Text;
            }

            return value;
        }


    }
Random Solutions  
 
programming4us programming4us