Questions tagged [alias]

An alias is an alternative name. In computer science, the most common contexts are command aliases in shells, column aliases in databases, or variable references in languages like C++.

For bash aliases use the tag.

4406 questions
95
votes
6 answers

ORA-00972 identifier is too long alias column name

i have a query like : SELECT column as averyveryveryverylongalias (more than 30 characters) FROM Table_name it returns the error ORA-00972 identifier is too long , is there any tip to make it work without making the alias shorter?
mcha
  • 2,938
  • 4
  • 25
  • 34
94
votes
15 answers

Cannot find module that is defined in tsconfig `paths`

I am trying to setup aliases for my mock server. Whenever I try to compile ts files, it returns error that it couldn't find proper modules even though those are defined in tsconfig,json->paths Folder structure: ├── server │   └── src │   …
Jamil Alisgenderov
  • 1,448
  • 2
  • 12
  • 23
91
votes
5 answers

How do I create some variable type alias in Java

let say I have this code Map list = new HashMap(); list.put("number1", "one"); list.put("number2", "two"); how can I make some "alias" the type Map to something that easier to be rewritten like //…
Lee
  • 3,259
  • 4
  • 21
  • 27
91
votes
6 answers

JavaScript function aliasing doesn't seem to work

I was just reading this question and wanted to try the alias method rather than the function-wrapper method, but I couldn't seem to get it to work in either Firefox 3 or 3.5beta4, or Google Chrome, both in their debug windows and in a test web…
Kev
  • 15,899
  • 15
  • 79
  • 112
85
votes
12 answers

How to find out where alias (in the bash sense) is defined when running Terminal in Mac OS X

How can I find out where an alias is defined on my system? I am referring to the kind of alias that is used within a Terminal session launched from Mac OS X (10.6.3). For example, if I enter the alias command with no parameters at a Terminal…
Richard Fuhr
  • 3,195
  • 3
  • 22
  • 14
78
votes
5 answers

How to make an import shortcut/alias in create-react-app?

How to set import shortcuts/aliases in create-react-app? From this: import { Layout } from '../../Components/Layout' to this: import { Layout } from '@Components/Layout' I have a webpack 4.42.0 version. I don't have a webpack.config.js file in the…
a b
  • 947
  • 1
  • 6
  • 7
78
votes
4 answers

How do you alias a type in Python?

In some (mostly functional) languages you can do something like this: type row = list(datum) or type row = [datum] So that we can build things like this: type row = [datum] type table = [row] type database = [table] Is there a way to do this in…
Lara
  • 2,594
  • 4
  • 24
  • 36
75
votes
2 answers

How to install NPM package under alias or different name

How can I npm install a package into a different directory?
Vincent
  • 3,191
  • 3
  • 29
  • 35
74
votes
8 answers

Why can't I use alias in a count(*) "column" and reference it in a having clause?

I was wondering why can't I use alias in a count(*) and reference it in the having clause. For instance: select Store_id as StoreId, count(*) as _count from StoreProduct group by Store_id having _count > 0 Wouldn't work.. But it…
Andre Pena
  • 56,650
  • 48
  • 196
  • 243
72
votes
5 answers

Using an Alias in a WHERE clause

I have a query which is meant to show me any rows in table A which have not been updated recently enough. (Each row should be updated within 2 months after "month_no".): SELECT A.identifier , A.name , TO_NUMBER(DECODE( A.month_no …
JPLemme
  • 4,374
  • 6
  • 31
  • 35
67
votes
7 answers

Is the 'as' keyword required in Oracle to define an alias?

Is the 'AS' keyword required in Oracle to define an alias name for a column in a SELECT statement? I noticed that SELECT column_name AS "alias" is the same as SELECT column_name "alias" I am wondering what the consequences are of defining a…
Jonathan
  • 10,936
  • 8
  • 64
  • 79
66
votes
6 answers

Is it possible to override git command by git alias?

my ~/.gitconfig is: [alias] commit = "!sh commit.sh" However, when I type git commit, script is not called. Is it possible, or I have to use another alias name?
noisy
  • 6,495
  • 10
  • 50
  • 92
66
votes
16 answers

How to alias a function in PHP?

Is it possible to alias a function with a different name in PHP? Suppose we have a function with the name sleep. Is there a way to make an alias called wait? By now I'm doing like this: function wait( $seconds ) { sleep($seconds); }
Atif
  • 10,623
  • 20
  • 63
  • 96
57
votes
4 answers

Why aliases in a non-interactive Bash shell do not work

I am trying to use aliases in a non-interactive bash shell. I have defined my aliases in ~/.bashrc and I have set the variable BASH_ENV=~/startUpFile. The contents of the startUpFile are source ~/.bashrc. I can see that my aliases are recognized,…
nisah
  • 2,478
  • 3
  • 22
  • 20
54
votes
4 answers

Alias hostname for localhost

Assuming that a local Python-Script is running a webserver. Is there any way to set an alias, so that http://localwebapp/ equals http://localhost:1234/? Edit: Or at least http://localwebapp:1234/ equals http://localhost:1234/?
WhatIsName
  • 2,294
  • 4
  • 24
  • 36