ASP/SQL - Sort Combofield A-Z

I best tell you what ive got, before i throw in the
questions!
A database with a table and how the data is called in DW8:
strSQL = "SELECT customer_id,customer_name FROM tbl_customer
where cust_active='y'"
Then theres the code for the combofield (currently displaying
non-sorted).
If Prospect Then
Call Response.Write(vbCrLf & "<tr>" & vbCrLf
& ComboField(intPosProspId,garCusNam,garCusVal,False,"") &
vbCrLf & InputField(intPosPType,True) & vbCrLf &
"</tr>")
I want the combofield to be in alphabetical order by
"customer_name", but have no idea how to do it.
Any takers?
thanks

The combofield is populated by the initial SQL query, so
update the query
like this:
SELECT customer_id,customer_name FROM tbl_customer WHERE
cust_active='y' ORDER BY customer_name ASC
* ASC = asecnding
DESC - descending
"Max10128" <[email protected]> wrote in
message
news:ec4kt7$fll$[email protected]..
>I best tell you what ive got, before i throw in the
questions!
>
> A database with a table and how the data is called in
DW8:
> strSQL = "SELECT customer_id,customer_name FROM
tbl_customer where
> cust_active='y'"
>
> Then theres the code for the combofield (currently
displaying non-sorted).
> If Prospect Then
> Call Response.Write(vbCrLf & "<tr>" &
vbCrLf &
> ComboField(intPosProspId,garCusNam,garCusVal,False,"")
> vbCrLf & InputField(intPosPType,True) & vbCrLf
& "</tr>")
>
> I want the combofield to be in alphabetical order by
"customer_name", but
> have
> no idea how to do it.
>
> Any takers?
> thanks
>

Similar Messages

  • Only on tempfile used during sql sorts

    environment : Entreprise 92010/W2K
    My temp tablespace (locally managed and temporary) has 3 tempfile, each with autoextend and maxsize limit.
    When i create an index on a big table, my 3 tempfile are used.
    But when a big sort occurs during a sql statement, only one tempfile is used and i get an ora-1652.
    Why all tempfiles are not used during sorts statements (union, max...) ?
    This behavior can be easily tested :
    - create a new temp ts with 3 small tempfile, autoextend on but very small maxsize
    - alter the user who will do the sorts
    - log on as user altered
    - create an index on a big table => the 3 tempfiles will grow
    - execute a query (max, min, union ,distinct...) => only one tempfile is used.
    SQL sort always done in only one file or bug ?
    Jean-Fran�ois L�guillier

    The 3 tempfile belong to the same ts.
    This ts is the temporary ts for my user which executes the sort sql statement.
    During execution, i monitor size of the 3 files (from v$tempfile) : only one was used during query and when it reached maxsize, i got ora 1652 but fres space were available in the 2 others tempfile.
    When i create a big index, i see changes in bytes for all tempfiles (in v$tempfile).
    One of my customer has same problem. He added tempfile to his temp ts but sort statement failed again.
    I tested this behavior with 92010/EE with W2K.
    I think it's a bug but nothing appears in patchset 9204.

  • ASP/SQL - Excel Question

    Hi
    Ive got an ASP file calling a database using SQL. Once you
    hit the "go" button, it puts this data into an Excel file, under a
    new window (still showing the asp file in the address bar).
    Item numbers that end in "0" i.e. 3.10, 12.20 appear as 3.1
    and 12.2 respectively in the Bill of Materials … i.e. being
    treated as decimals … I need them to show-up as text.
    Any takers?
    I will post some of the code if requested - but I may need a
    little guidance in what is required.
    I'm trying to learn ASP/SQL the hard way: from the deep end!!
    thanks

    You're correct, Rob. Excel will interpret the data regardless
    of what it
    looks like in the source.
    You can try placing an apostrophe in front of the number.
    This supposedly
    tells Excel to treat it as text. I've had no luck with that
    approach,
    though.
    The proper way is to use the style mso-number-format on the
    cells you want
    formatted.
    Example:
    td.number {
    mso-number-format:#.00;
    You can use any valid format code (see your Excel F1 help on
    custom number
    formats) as the rule's value. The above format should be the
    one the OP is
    looking for, though.
    "RobGT" <[email protected]> wrote in
    message
    news:echle1$s1g$[email protected]..
    > The problem I think you'll have regardless of what you
    end up outputting
    > from your code is that Excel will interpret and assign a
    datatype to the
    > data when it gets loaded.
    > If you add 41.30 as text into a cell in Excel from
    VBScript, then open
    > that spreadsheet in excel, I think it will have
    automatically judged the
    > content to be a number and set the cell format as
    numeric.
    >
    > I could be wrong though...
    >
    > Just a quick thought - have you tried adding a space
    before the numbers
    > when exporting them to see if that would solve it?
    > Cheers,
    > Rob
    >
    http://robgt.com/ [Tutorials and
    Extensions]
    > Firebox stuff:
    http://robgt.com/firebox
    > Skype stuff:
    http://robgt.com/skype
    > SatNav stuff:
    http://robgt.com/satnav
    >
    >

  • 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
    >
    >

  • Error with insert using ASP, SQL and ValidationTool Kit

    i finally got my 1st of 5 pages setup to insert, validate and
    redirect.. but
    now i get an error i have no idea what it means
    The page loads fine, but when i attempt to submit the page to
    insert the
    record, i receive the error below...
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC SQL Server Driver][SQL Server]Parameterized
    Query '(@P1
    text,@P2 nvarchar(50),@P3 nvarchar(50),@P4 nvarchar(50),@P5'
    expects
    parameter @P18, which was not supplied.
    /cemp_app1.asp, line 123
    Here is the line in question
    Line#123 MM_editCmd.Execute
    I dont understand why the error mentions Parameterized Query
    when im not
    doing anything special, just a simple insert(after being
    validated)
    Below is the insert code that seems to mention parameters
    If (CStr(Request("MM_insert")) = "form1") Then
    If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_has_STRING
    MM_editCmd.CommandText = "INSERT INTO dbo.EmpCandidate
    (cssn, cfname,
    cmname, clname, caddr, caddr1, capt, ccounty, ccity, cstate,
    czip, chphone,
    cmphone, cophone, qlegal, ost, qref, refemp, webother, qage,
    qgrpast,
    qgrpastsel, qgrrel, qgrrelsel1, qgrrelsel2, qcontact, qterm,
    cdesiredpos1,
    cdesiredpos2, cdesiredpay1, cdesiredpay2, cte, availsun1,
    availsun2,
    availmon1, availmon2, availtue1, availtue2, availwed1,
    availwed2,
    availthur1, availthur2, availfri1, availfri2, availsat1,
    availsat2, casppos,
    cattsuce) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param1", 201,
    1, 9, Request.Form("cssn")) ' adLongVarChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param2", 202,
    1, 50, Request.Form("cfname")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param3", 202,
    1, 50, Request.Form("cmname")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param4", 202,
    1, 50, Request.Form("clname")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param5", 202,
    1, 75, Request.Form("caddr")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param6", 202,
    1, 75, Request.Form("caddr1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param7", 202,
    1, 10, Request.Form("capt")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param8", 202,
    1, 15, Request.Form("ccounty")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param9", 202,
    1, 30, Request.Form("ccity")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param10", 202,
    1, 2, Request.Form("cstate")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param11", 202,
    1, 5, Request.Form("czip")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param12", 202,
    1, 10, Request.Form("chphone")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param13", 202,
    1, 10, Request.Form("cmphone")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param14", 202,
    1, 10, Request.Form("cophone")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param15", 202,
    1, 1, Request.Form("qlegal")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param16", 202,
    1, 15, Request.Form("ost")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param17", 202,
    1, 10, Request.Form("qref")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param18", 202,
    1, 25, Request.Form("refemp")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param19", 202,
    1, 25, Request.Form("webother")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param20", 202,
    1, 1, Request.Form("qage")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param21", 202,
    1, 1, Request.Form("qgrpast")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param22", 202,
    1, 10, Request.Form("qgrpastsel")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param23", 202,
    1, 1, Request.Form("qgrrel")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param24", 202,
    1, 10, Request.Form("qgrrelsel1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param25", 202,
    1, 10, Request.Form("qgrrelsel2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param26", 202,
    1, 3, Request.Form("qcontact")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param27", 202,
    1, 1, Request.Form("qterm")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param28", 202,
    1, 35, Request.Form("cdesiredpos1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param29", 202,
    1, 35, Request.Form("cdesiredpos2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param30", 202,
    1, 25, Request.Form("cdesiredpay1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param31", 202,
    1, 25, Request.Form("cdesiredpay2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param32", 202,
    1, 15, Request.Form("cte")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param33", 202,
    1, 35, Request.Form("availsun1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param34", 202,
    1, 35, Request.Form("availsun2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param35", 202,
    1, 35, Request.Form("availmon1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param36", 202,
    1, 35, Request.Form("availmon2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param37", 202,
    1, 35, Request.Form("availtue1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param38", 202,
    1, 35, Request.Form("availtue2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param39", 202,
    1, 35, Request.Form("availwed1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param40", 202,
    1, 35, Request.Form("availwed2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param41", 202,
    1, 35, Request.Form("availthur1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param42", 202,
    1, 35, Request.Form("availthur2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param43", 202,
    1, 35, Request.Form("availfri1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param44", 202,
    1, 35, Request.Form("availfri2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param45", 202,
    1, 35, Request.Form("availsat1")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param46", 202,
    1, 35, Request.Form("availsat2")) ' adVarWChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param47", 201,
    1, -1, Request.Form("casppos")) ' adLongVarChar
    MM_editCmd.Parameters.Append
    MM_editCmd.CreateParameter("param48", 201,
    1, -1, Request.Form("cattsuce")) ' adLongVarChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
    End If
    End If
    %>

    Seems Adobe has a bit of a mistake there in the insert
    behavior.
    This line appears just below the query (you'll see VALUES
    with a lot of
    question marks):
    MM_editCmd.Prepared = true
    Change it to
    MM_editCmd.Prepared = false
    That will fix you up.
    "Daniel" <[email protected]> wrote in message
    news:f05ce4$s04$[email protected]..
    >i finally got my 1st of 5 pages setup to insert, validate
    and redirect..
    >but now i get an error i have no idea what it means
    >
    > The page loads fine, but when i attempt to submit the
    page to insert the
    > record, i receive the error below...
    >
    >
    > Microsoft OLE DB Provider for ODBC Drivers error
    '80040e14'
    > [Microsoft][ODBC SQL Server Driver][SQL
    Server]Parameterized Query '(@P1
    > text,@P2 nvarchar(50),@P3 nvarchar(50),@P4
    nvarchar(50),@P5' expects
    > parameter @P18, which was not supplied.
    >
    > /cemp_app1.asp, line 123
    >
    >

  • Different results on a SQL sort depending on the tool?

    Hi,
    i've a problem with sorting a column, getting different results depending on the tool.
    Environment:
    Oracle 8.1.6 on Solaris, Oracle Client on NT 4.0 (SP5)
    The Query:
    SELECT * FROM mytable ORDER BY mycolumn ASC
    This is the result of a query by SQL Plus Worksheet:
    0000000006
    0000100100
    A00000
    A06015
    A06016
    This is the result of a query by SQL*Plus (and Oracle ODBC 32Bit Test and a jdbc query) :
    A00000
    A06015
    A06016
    0000000006
    0000100100
    Why has the same SQL statement different results?
    Why are there different collating orders?
    How can this be solved?
    Can anyone help me?
    Regards Stefan
    null

    At this point I think you should get Applejack...
    http://www.macupdate.com/info.php/id/15667/applejack
    After installing, reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
    applejack AUTO
    Then let it do all 6 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 6 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    Trash old Log files.
    First reboot will be slower, sometimes 2 or 3 restarts will be required for full benefit... my guess is files relying upon other files relying upon other files! :-)
    Disconnect the USB cable from any Uninterruptible Power Supply so the system doesn't shut down in the middle of the process.
    Then... Try putting these numbers in Network>TCP/IP>DNS Servers, for the Interface you connect with...
    208.67.222.222
    208.67.220.220
    Then Apply. For 10.5/10.6 Network, highlight Interface>Advanced button>DNS tab>little + icon.
    DNS Servers are a bit like Phone books where you look up a name and it gives you the phone number, in our case, you put in apple.com and it comes back with 17.149.160.49 behind the scenes.  
    These Servers have been patched to guard against DNS poisoning, and are faster/more reliable than most ISP's DNS Servers.
    The Interface that connects to the Internet, needs to be drug to the top of System Preferences>Network>Show:>Network Port Configurations and checked ON.
    10.5.x/10.6.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.

  • PL/SQL Sort an array Oracle 10g

    Does Oracle 10g have a built in method to sort an array (collection)?

    A quick method for sorting ( no massive data ) may be the following.
    SQL> set serveroutput on
    SQL> declare
      2     tab sys.owa_util.vc_arr;
      3     type sorted_tab is table of varchar2(32767) index by varchar2(32767);
      4     sorted sorted_tab;
      5     id1 pls_integer;
      6     id2 varchar2(32767);
      7  begin
      8     tab(1) := 'hello';
      9     tab(2) := 'george';
    10     tab(5) := 'no';
    11     id1 := tab.FIRST;
    12     WHILE id1 IS NOT NULL LOOP
    13             sorted(tab(id1)) := tab(id1);
    14             id1 := tab.NEXT(id1);
    15     END LOOP;
    16
    17
    18
    19     id2  := sorted.FIRST;
    20     WHILE id2 IS NOT NULL LOOP
    21             dbms_output.put_line(sorted(id2));
    22             id2 := sorted.NEXT(id2);
    23     END LOOP;
    24  end;
    25  /
    george
    hello
    no
    PL/SQL procedure successfully completed.But next time be correct. Index by tables defined in packages are not considered as collections.
    Bye Alessandro
    Edited by: Alessandro Rossi on 4-nov-2008 16.51

  • Finding Paths Between Two Nodes Using SQL Sorted by Cost

    Hi Gurus,
    I want to find all paths from source node to target node that shall be sorted by the cost. I don't know whether it could be achieved with SQL statement. How to start with this query? The script to create the underlying tables along with the data are given below:
    create table nodes ( nodeId int Primary Key, nodeName varchar(50));
    create table paths ( pathId int Primary Key, fromNodeId int, toNodeId int, cost int );
    insert into nodes values (1,'ISL');
    insert into nodes values (2,'LHR');
    insert into nodes values (3,'HYD');
    insert into nodes values (4,'FSL');
    insert into nodes values (5,'MUL');
    insert into nodes values (6,'KHI');
    insert into nodes values (7,'QT');
    insert into paths values (1,1,3,20);
    insert into paths values (2,1,5,10);
    insert into paths values (3,1,7,80);
    insert into paths values (4,2,4,10);
    insert into paths values (5,3,4,40);
    insert into paths values (6,3,5,20);
    insert into paths values (7,3,6,10);
    insert into paths values (8,6,7,30);
    insert into paths values (9,6,5,30);
    insert into paths values (10,6,3,10);
    insert into paths values (11,7,2,20);
    insert into paths values (12,5,4,40);
    insert into paths values (13,5,7,40);
    Suppose the source = ISL and target = QT, their are various paths from ISL to QT:
    Ord# Relative Path Cost
    ==== ================================= =================
    1. ISL -> MUL -> QT 50
    2. ISL -> HYD -> KHI -> QT 60
    3. ISL -> QT 80
    4. ISL -> HYD -> MUL -> QT 80
    5. ISL -> HYD to KHI -> MUL -> QT 100
    This gives us all possible paths sorted by cost.
    Any hint or help will be highly appreciated.
    Thanks in advance and best regards
    Bilal
    Edited by: naive2Oracle on Feb 11, 2011 9:59 AM

    I like recursive with clause B-)
    col path for a30
    with nodes(nodeId,nodeName) as(
    select 1,'ISL' from dual union
    select 2,'LHR' from dual union
    select 3,'HYD' from dual union
    select 4,'FSL' from dual union
    select 5,'MUL' from dual union
    select 6,'KHI' from dual union
    select 7,'QT'  from dual),
    paths(fromNodeId,toNodeId,cost) as(
    select 1,3,20 from dual union
    select 1,5,10 from dual union
    select 1,7,80 from dual union
    select 2,4,10 from dual union
    select 3,4,40 from dual union
    select 3,5,20 from dual union
    select 3,6,10 from dual union
    select 6,7,30 from dual union
    select 6,5,30 from dual union
    select 6,3,10 from dual union
    select 7,2,20 from dual union
    select 5,4,40 from dual union
    select 5,7,40 from dual),
    tmp(nodeName,fromNodeId,toNodeId,cost) as(
    select a.nodeName,b.fromNodeId,b.toNodeId,b.cost
      from nodes a,paths b
    where a.nodeId=b.fromNodeId),
    rec(nodeName,path,fromNodeId,toNodeId,cost) as(
    select nodeName,cast(nodeName as varchar2(40)),
    fromNodeId,toNodeId,cost
      from tmp
    where nodeName = 'ISL'
    union all
    select b.nodeName,a.path || '->' || b.nodeName,
    b.fromNodeId,b.toNodeId,
    a.cost+decode(b.nodeName,'QT',0,b.cost)
      from rec a,tmp b
    where a.toNodeId = b.fromNodeId
       and a.nodeName !='QT')
    CYCLE fromNodeId SET IsLoop TO 'Y' DEFAULT 'N'
    select path,cost from rec
    where IsLoop ='N'
      and nodeName ='QT'
    order by cost;
    PATH                    COST
    ISL->MUL->QT              50
    ISL->HYD->KHI->QT         60
    ISL->HYD->MUL->QT         80
    ISL->QT                   80
    ISL->HYD->KHI->MUL->QT   100

  • Forms/ASP/SQL

    Where do I begin? I am a Dreamweaver user (approx 5 years). Now need to learn how to connect my site using DW to a SQL Database. Need an overall understanding/overview of asp/forms/database. The site I am working on has forms created in DW using ASP. How to get the data captured in the form to transfer to the database. Thanks much.

    Thank you. I believe I created the database correctly thru our web hosting service (very simple set up) using the form field "names" (see below). Currently the only info I receive is first name, last name, organization, and email address (as shown in the coding below). This info is sent to me in an email. What I want is for the data entered in the form to populate the database when submitted. I am continuing to study and will certainly look at the info you sent. Any other advice is greatly appreciated. Thank you.
               <form action="scripts/formmail.asp" method="POST" name="form1" style="margin-bottom: 0" ID="Form1">
        <input type=hidden name="recipient" value="[email protected]">
      <p><br />
        <input type="text" name="First" value="First Name">
        <input type="text" name="Last" value="Last Name">
        <br />
        <br />
      WORK INFORMATION:</p>
      <p>  <input type="text" name="Organization" value="Organization">
    <br />
    <input type="text" name="Title" value="Title">
    <br />
        <input type="text" name="W_Address" value="Address">
        <br />
        <input type="text" name="W_City" value="City">
        <input type="text" name="W_State" value="State">
        <input type="text" name="W_Zip" value="Zip">
        <br />
        <input type="text" name="W_Phone" value="Phone">
        <input type="text" name="W_Fax" value="Fax">
        <input type="text" name="W_Cell" value="Cell">
        <br />
    <input type="text" name="Email" value="Email">
    <br />
        <br />
        HOME INFORMATION:<br />
        <input type="text" name="H_Address" value="Address">
        <br />
        <input type="text" name="H_City" value="City">
        <input type="text" name="H_State" value="State">
        <input type="text" name="H_Zip" value="Zip">
        <br />
        <input type="text" name="H_Phone" value="Phone">
        <input type="text" name="H_Fax" value="Fax">
        <input type="text" name="H_Cell" value="Cell">
        <br />
        <input type="text" name="Spouse" value="Spouse">
        <br />
        <br />
         <input type="hidden" name="_fieldOrder" value="first, last, Organization,email">
         <input type="hidden" name="_recipients" value="[email protected]">
         <input type="hidden" name="_requiredFields" value="first, email">
         <input type=hidden name="_redirect" value="tocheckoutpage.com">
         <input type="hidden" name="_subject" value="Membership">
        <input type="submit" value="Submit">
      </p>
    </form>

  • Display User Name - ASP & SQL

    I have a login page that asks the user for only the password
    (NOT username/password combo). This verifies against my MS SQL
    database that contains columns for both "Username" and "Password".
    On successful login, the user is directed to my "Survey.asp" page.
    My question is, how do I display "Welcome User Name" on my
    survey page? Thanks!

    Pull it from your recordset and display it like this some
    where on your
    page.
    Welcome
    <%=(Recordset_Name.Fields.Item("UserName").Value)%>
    Dave
    "bake01" <[email protected]> wrote in
    message
    news:ffb0pq$8nt$[email protected]..
    > I have a login page that asks the user for only the
    password (NOT
    > username/password combo). This verifies against my MS
    SQL database that
    > contains columns for both "Username" and "Password". On
    successful login,
    the
    > user is directed to my "Survey.asp" page.
    >
    > My question is, how do I display "Welcome User Name" on
    my survey page?
    > Thanks!
    >

  • CS3 VISTA ASP SQL

    I have been running CS3 DW on an XP machine for quite a while
    with no problems using ASP and connecting to an SQL DB. Last week
    my machine crashed and burned so I decided to upgrade whilst
    getting it together again. Now I have set up the same scenario
    except instead of XP I have Vista. I loaded up my backups and
    everything seemed great - the Manage site section connected, the
    sign in sign out was perfect - but then I got to testing the
    database connection string (which is identical to that on the XP
    version) and I got an error that says "Microsft ODBC Driver Manager
    Data source name not found and no default driver specified". Any
    ideas? I gather I haven't set something up but what? Any help
    gratefully received

    I assume by 'SQL DB' you are referring to MS SQL Server,
    correct? Did you install the SQL Server middleware and ODBC
    drivers? Did you create the ODBC data source? If yes to these, did
    you test the datasource connection via the ODBC manager?

  • Sql sorting question

    Hello,
    I have a table "XXDUMMY" with a column "F1".
    Right now, When I do a "select * from XXDUMMY", I get the following...
    F1
    4444089014
    DGV3142004
    5JN430151I
    7JN430151I
    9JN430151I
    JN430151ID
    I want to order by (sort) the results so that I get rows which start with an Alphabet first and then the numeric ones (Ascending). So the expected output should be...
    F1
    DGV3142004
    JN430151ID
    4444089014
    5JN430151I
    7JN430151I
    9JN430151I
    Thanks in advance!
    Bob
    Message was edited by:
    user615124

    I think he wants something like this:
    WITH DATA AS
         (SELECT '4444089014' f1
            FROM DUAL
          UNION ALL
          SELECT 'DGV3142004'
            FROM DUAL
          UNION ALL
          SELECT '5JN430151I'
            FROM DUAL
          UNION ALL
          SELECT '7JN430151I'
            FROM DUAL
          UNION ALL
          SELECT '9JN430151I'
            FROM DUAL
          UNION ALL
          SELECT 'JN430151ID'
            FROM DUAL)
    SELECT *
      FROM (SELECT   *
                FROM DATA
               WHERE REGEXP_LIKE (SUBSTR (f1, 1, 1), '[[:alpha:]]')
            ORDER BY (SUBSTR (f1, 1, 1)))
    UNION ALL
    SELECT *
      FROM (SELECT   *
                FROM DATA
               WHERE REGEXP_LIKE (SUBSTR (f1, 1, 1), '[[:digit:]]')
            ORDER BY (SUBSTR (f1, 1, 1)))
    F1       
    DGV3142004
    JN430151ID
    4444089014
    5JN430151I
    7JN430151I
    9JN430151I
    Message was edited by:
            Bolev                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Select and SQL sorting

    LedgerID Name  
     Type  ParentID
    1001 AA
    CLASS 1
    1002 BB
    A/C 1001
    1003 CC
    A/C 1001
    1004 EE
    CLASS 1008
    1005 DD
    A/C 1004
    1006 FF
    A/C 1004
    1007 GG
    A/C 1001
    1008 HH
    CLASS 1001
    1009 II
    A/C 1008
    1010 JJ
    A/C 1009
    First sorting Type=CLASS  then  add child ID
    When i pass LedgerID = 1001  then I Want like Below
    LedgerID Name    
    Type ParentID
    1001 AA
    CLASS 1
    1002 BB
    A/C 1001
    1003 CC
    A/C 1001
    1007 GG
    A/C 1001
    1008 HH
    CLASS 1001
    1009 II
    A/C 1008
    1010 JJ
    A/C 1008
    1004 EE
    CLASS 1008
    1005 DD
    A/C 1004
    1006 FF
    A/C 1004

    HI..
    Some error coming u pasted query...
    below i have pasted values ....
    pls help
    CREATE TABLE LedgerTable (LedgerID INT,Description VARCHAR(MAX),LedgerType VARCHAR(50),ParentAccount INT)
    INSERT INTO LedgerTable VALUES (102 ,'Cash & Bank'
    ,'Class' ,101)
    INSERT INTO LedgerTable VALUES (103 ,'Cash'
    ,'Class' ,102)
    INSERT INTO LedgerTable VALUES (107 ,'Bank'
    ,'Class' ,102)
    INSERT INTO LedgerTable VALUES (104 ,'Cash In Hand'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (108 ,'UAB'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (109 ,'NBQ'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (4937 ,'CASH - I'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (4938 ,'CASH - II'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (4939 ,'FORGEIN CURRENCY IN HAND'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (4940 ,'I-PAY CARD ACCOUNT'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (4941 ,'PETTY CASH'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (4942 ,'COMMERICAL BANK OF DUBAI A'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (4943 ,'COMMERICAL BANK OF DUBAI S'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (4944 ,'NATIONAL BANK OF DUBAI'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (4945 ,'NATIONAL BANK OF FUJAIRAH'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (4946 ,'NATIONAL BANK OF UMM AL QUWAIN'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (4947 ,'UNITED ARAB BANK-SHARJAH'
    ,'Control AC' ,107)
    INSERT INTO LedgerTable VALUES (5377 ,'Focus Pool AC'
    ,'Control AC' ,103)
    INSERT INTO LedgerTable VALUES (5399 ,'TEST CASH'
    ,'Control AC' ,103)
    SELECT * FROM LedgerTable
    DROP TABLE LedgerTable
    I Want need below Order...
    LedgerType=Class then  in TOP
    LedgerType=Control AC  Under Coming

  • ASP SQL Access distinct from one column

    I have a query from two tables: table company and tables
    subcategories
    A company can have many subcategories.
    In the query I have put the fields id_company, company,
    keywords from
    table company and subcategories from table categories.
    When I use the select distinct * (or field names) the sql
    returns all
    the data whit double company's. This is normal, there
    different by
    subcategories. I need the subcategories to use for a search
    field. I
    can delete the categories field from my query and put the
    names
    manually in the keywords field.
    Is there a way to use the distinct only on the id_comany
    field so the
    sql returns only one company whit many subcategories?
    I hope this makes sense, can somebody helping my out?
    Thanks in advance,
    Sam

    Table = companys - fields = id_company, company, keywords
    Table = subcategories - fields = id_subcategorie,
    subcategorie and
    id_company with a relation to the table companys.
    The companys can have many subcategories.
    I created a query "qry_search" with the fields id_company,
    company,
    keywords, subcategorie
    in the page with the text field "search" I created a
    Request.QuerySting.varcompany, Request.QuerySting.varkeywords
    and
    Request.QuerySting.varsubcategorie
    In the result page I have a recordset whit:
    SELECT id_company, company, keywords, subcategorie
    FROM qry_search
    WHERE company LIKE %varcompany% OR keywords LIKE
    %varkeywords% OR
    subcategorie LIKE %varsubcategorie%
    I leave the DISTINCT function for this moment away
    Example DB qry_search:
    ID company keywords
    subcategorie
    1 BMW bmw new sales luxe cars
    1 BMW bmw new sales luxe garage
    2 Sam sandwich lunch wine restaurant
    2 Sam sandwich lunch wine snack
    3 Audi Audi new sales luxe cars
    When you put in the text field "search" bmw, I have 2 results
    for the same
    company
    When you put in the text field "search" cars, I have 2
    results but different
    companys
    When you put in the text field "search" sales, I have 3
    results but 2 for
    the same company and 1 for the Audi company
    I hope you can help me otherwise I will ad the subcategories
    in the keyword
    field and don't search in the subcategorie field.
    Thanks for your time Bregent !!!
    "bregent" <[email protected]> a écrit
    dans le message de news:
    f8d7vn$4pg$[email protected]..
    > Sorry Sam, I am not completely understanding the
    problem. Can you please
    > provide more details about your database schema and
    include sample data?

  • Adding multiple fields with ASP & SQL

    Hi there --
    I have a database that holds subscription info. Based on the time of payment and the length of subscription, I calculate an accrued monthly amount, assign that amount to a variable, and assign it to a month on a Web page.
    I want to tally up the totals for the columns that result. That means I'll need to add up several fields per record, and also add up all the records - like this:
    Customer 1: Field 1 + Field 2 + Field 3
    Customer 2: Field 1 + Field 2 + Field 3
    ... and so on - I want all those fields added together.
    I can get what looks like the last record's fields summed by using <% = (Field1) + (Field2) + (Field3) %> but it doesn't tally up all the records.
    It's possible to do, isn't it? Help?
    Thanks!

    Thank you!
    I am looping through the recordset. Can you tell me how I'd handle those variables? I can't quite get my head around it.
    Fields 1, 2 and 3 are already variables calculated from the values in the database, and they're getting output into that recordset loop...

Maybe you are looking for

  • Problem with reference and class

    I would like to transit a Data object in member function of another class with Labview 9.0 reference with "In place element structure". I use the reference for optimize allocation memory. When i use a dispatch static : Vi is executable  -> "TestRefAp

  • Dreamweaver and Java SE 6 Runtime problem on MAC Mountain Lion OSX

    I have a problem with dreamweaver. I really love dreamweaver for building web pages and have used it for years with a PC.  I recently switched from a PC to a MAC but I find that when I open the Dreamweaver app for the first time I get a prompt that s

  • IPhone 4S OS 5.0.1 - Music and YouTube pauses for no reason!

    Hi, I am frustrated with a major issue with my iPhone 4S. Recently, when I listen to music on the iPhone it pauses repeateldy with no reason.  It happens every 1-1.5 minute and on every track I tried in my library.  This is not specific to HOW I am l

  • How do I get my iMac to read (speak) text in Pages?

    I Use the computer's speaking function often. I was surpused that it does not work in Pages. Is there a way to have my iMac read aloud the text I type in Pages if I select it? I am using a iMac, OS 10.9. Richard

  • No default connection to Airport Express

    Upon each wakeup from sleep or start-up, connection does not default to Airport Express. How do we make it automatically default to Airport Express?