ADP: QueryDef equivalent?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PeteCresswell

    ADP: QueryDef equivalent?

    Seems like ADP is predicated on the notion that you'd only want to use
    stored procedures in the back end or in-line SQL in the front end.

    Makes it really messy to develop something like
    -------------------------------------
    SELECT
    v.SECURITY_ALIA S,
    v.NEXT_REFIX_DA TE AS ConversionDate,
    v.RESET_DAY AS VariableRateMod e,
    CASE
    WHEN v.RESET_DAY='MO ' THEN 'Monday'
    WHEN v.RESET_DAY='TU ' THEN 'Tuesday'
    WHEN v.RESET_DAY='WE ' THEN 'Wednesday'
    WHEN v.RESET_DAY='W' THEN 'Wednesday'
    WHEN v.RESET_DAY='TH ' THEN 'Thursday'
    WHEN v.RESET_DAY='FR ' THEN 'Friday'
    WHEN v.RESET_DAY='F' THEN 'Friday'
    WHEN v.RESET_DAY='1' THEN '1-Day'
    WHEN v.RESET_DAY='7' THEN '7-Day'
    WHEN v.RESET_DAY='28 ' THEN '28-Day'
    WHEN v.RESET_DAY='35 ' THEN '35-Day'
    WHEN v.RESET_DAY='90 ' THEN '90-Day'
    WHEN v.RESET_DAY='D' THEN 'Daily'
    WHEN v.RESET_DAY='FM O' THEN 'First of Month'
    WHEN v.RESET_DAY='H' THEN 'Holiday Rules Appl'
    WHEN v.RESET_DAY='MM ' THEN 'Mid-Month'
    WHEN v.RESET_DAY='NA ' THEN Null
    WHEN v.RESET_DAY='NU L' THEN Null
    ELSE Null
    END AS VariableRateMod e_Mapped

    FROM
    SECURITYDBO.VAR IABLE_RATE v,
    (
    SELECT
    v0.SECURITY_ALI AS AS Security_Alias,
    Max(v0.EFFECTIV E_DATE) AS Effective_Date

    FROM
    SECURITYDBO.VAR IABLE_RATE v0

    WHERE
    v0.SRC_INTFC_IN ST = 83

    GROUP BY
    v0.SECURITY_ALI AS
    ) mx

    WHERE
    v.SECURITY_ALIA S = mx.Security_Ali as AND
    v.EFFECTIVE_DAT E = mx.Effective_Da te AND
    v.SRC_INTFC_INS T = 83
    -------------------------------------

    in, say, SQL Programmer and then adapt it to the ADP.

    In regluar MS Access, you'd just create a passthrough query and paste
    the SQL directly into it, and go.

    With an ADP it seems like one has to choose between a humongous
    in-line string and laborously putting in "_ " line continuation
    strings - which makes it really time-consuming to flip-flop
    back-and-forth between the SQL development tool and ADP...

    Is there a better way for somebody who does not have CREATE authority
    for SPs in the back end?
  • MGFoster

    #2
    Re: ADP: QueryDef equivalent?

    PeteCresswell wrote:
    [color=blue]
    > Seems like ADP is predicated on the notion that you'd only want to use
    > stored procedures in the back end or in-line SQL in the front end.
    >
    > Makes it really messy to develop something like
    > -------------------------------------
    > SELECT
    > v.SECURITY_ALIA S,
    > v.NEXT_REFIX_DA TE AS ConversionDate,
    > v.RESET_DAY AS VariableRateMod e,
    > CASE
    > WHEN v.RESET_DAY='MO ' THEN 'Monday'
    > WHEN v.RESET_DAY='TU ' THEN 'Tuesday'
    > WHEN v.RESET_DAY='WE ' THEN 'Wednesday'
    > WHEN v.RESET_DAY='W' THEN 'Wednesday'
    > WHEN v.RESET_DAY='TH ' THEN 'Thursday'
    > WHEN v.RESET_DAY='FR ' THEN 'Friday'
    > WHEN v.RESET_DAY='F' THEN 'Friday'
    > WHEN v.RESET_DAY='1' THEN '1-Day'
    > WHEN v.RESET_DAY='7' THEN '7-Day'
    > WHEN v.RESET_DAY='28 ' THEN '28-Day'
    > WHEN v.RESET_DAY='35 ' THEN '35-Day'
    > WHEN v.RESET_DAY='90 ' THEN '90-Day'
    > WHEN v.RESET_DAY='D' THEN 'Daily'
    > WHEN v.RESET_DAY='FM O' THEN 'First of Month'
    > WHEN v.RESET_DAY='H' THEN 'Holiday Rules Appl'
    > WHEN v.RESET_DAY='MM ' THEN 'Mid-Month'
    > WHEN v.RESET_DAY='NA ' THEN Null
    > WHEN v.RESET_DAY='NU L' THEN Null
    > ELSE Null
    > END AS VariableRateMod e_Mapped
    >
    > FROM
    > SECURITYDBO.VAR IABLE_RATE v,
    > (
    > SELECT
    > v0.SECURITY_ALI AS AS Security_Alias,
    > Max(v0.EFFECTIV E_DATE) AS Effective_Date
    >
    > FROM
    > SECURITYDBO.VAR IABLE_RATE v0
    >
    > WHERE
    > v0.SRC_INTFC_IN ST = 83
    >
    > GROUP BY
    > v0.SECURITY_ALI AS
    > ) mx
    >
    > WHERE
    > v.SECURITY_ALIA S = mx.Security_Ali as AND
    > v.EFFECTIVE_DAT E = mx.Effective_Da te AND
    > v.SRC_INTFC_INS T = 83
    > -------------------------------------
    >
    > in, say, SQL Programmer and then adapt it to the ADP.
    >
    > In regluar MS Access, you'd just create a passthrough query and paste
    > the SQL directly into it, and go.
    >
    > With an ADP it seems like one has to choose between a humongous
    > in-line string and laborously putting in "_ " line continuation
    > strings - which makes it really time-consuming to flip-flop
    > back-and-forth between the SQL development tool and ADP...
    >
    > Is there a better way for somebody who does not have CREATE authority
    > for SPs in the back end?[/color]

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Arvin Meyers (I believe) used to store his queries in a table and
    retrieve them into a string before running. Do you have table creation
    permission on the db you are working with?

    Perhaps its time to talk to the DBA and get permission to do your work!
    Yeah! You tell 'em!! :-)

    If that fails, maybe you can create a local .mdb file that has a table
    of queries, or the queries themselves if the .mdb file can be linked to
    the SQL back-end. Some OpenDatabase() or Automation work to get at the
    local tables/queries. Just some ideas . . . .

    --
    MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
    Oakland, CA (USA)

    -----BEGIN PGP SIGNATURE-----
    Version: PGP for Personal Privacy 5.0
    Charset: noconv

    iQA/AwUBQIQ9n4echKq OuFEgEQLfOwCgvT 8JACkpKmJ5zfoMA Tm6bAGk6bgAoOYt
    JkA1hwzmFvsiwm2 nV7POefKl
    =jnHD
    -----END PGP SIGNATURE-----

    Comment

    Working...