Re: How to pass servername as vaiable?
Posted in 1996
Why not just use the function "DBSERVERNAME"?
select dbservername from systables where tabid=1.
or
let var_server = 'select dbservername from systables where tabid=1'
or
let var_server = DBSERVERNAME;Yet unlike 4gl and E/SQL ... I do not see how you go about preparing
a select statement (a cursors).
-------------------------------------------------------------------------
Cheryl Kendricks
Internet:cherylk@prod1.jcdc.doleta.gov
OR
kendric@gwysmtp.jcdc.doleta.gov
OR
cherylk@spamis.jcdc.doleta.gov
DTSI, Inc. Voice: 1-800-598-5008
Database Administrator - DOL Job Corps San Marcos, Texas
------------------------------------------------------------------------
On 22 Apr 1996, John Powell wrote:
}
}
} I need to know how to how to place the name of a server in
} a stored procedure variable and then use that variable as
} the server name when specifying a fully qualified table name
}
} I would like to go from something like this
}
}
} select * from mydatabase@myserver:mytable:
}
}
} to something like this
}
}
} DEFINE hold_server char(8);
}
} LET holdserver = "myserver";
}
} select * from mydatabase@holdserver:mytable;
}
}
}
} ________________________________________________________________________
} | John Powell |
} | Hewlett-Packard Company Phone: 541-715-8389 |
} | Inkjet Supplies Business Unit Fax: 541-715-2283 |
} | 1040 NE Circle Blvd. E-mail: jpowell@cv.hp.com |
} | Corvallis, OR 97330-4200 |
} | MS: 633A |
} ------------------------------------------------------------------------
}