---
title: "存储过程中变量的定义"
author: "xiajava2011"
date: "2011-08-25T09:21:40Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2011-08-25T09:21:40Z"
id: 1157515
url: "https://xiajava2011.iteye.com/blog/1157515"
---

```
1.常用类型：
number  数字型（包括小数）    char(n)  varchar2(n)  字符型
boolean 布尔型
2.定义与表相关：
tableA.columnA%type;    字段类型相同
tableA%rowtype;

3.包头部分定义：
定义集合
TYPE dt_deduct_fund is RECORD(
    invest_id t_contract_invest.invest_id%TYPE,
    fund_type t_contract_invest.fund_type%type,
    fund_code t_fund.fund_code%TYPE,
    money_id t_money.money_id%TYPE); 
```